/* ==========================================================================
   WAPrimeDesk Frontend Styles - Modern UI/UX Design
   ========================================================================== */

/* Reset and Base Styles */
.primedesk-dashboard {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Header Navigation */
.primedesk-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.primedesk-header-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 64px;
}

.primedesk-logo h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: -0.02em;
}

.primedesk-logo a {
    text-decoration: none;
}

.primedesk-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.primedesk-nav .nav-item {
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-width: 100px;
    min-height: 40px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.primedesk-nav .nav-item:hover {
    background: #f9fafb;
    color: #374151;
}

.primedesk-nav .nav-item.active {
    color: #667eea;
    background: #eef2ff;
}

.primedesk-nav .nav-item .badge {
    background: #ef4444;
    color: #ffffff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.primedesk-nav .nav-item .badge.highlight {
    background: #f59e0b;
}

/* User Menu */
.primedesk-user-menu {
    position: relative;
    margin-left: auto;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-trigger:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.user-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.user-icon {
    font-size: 10px;
    color: #9ca3af;
}

/* ==========================================================================
   Main Dashboard Styles (Homepage)
   ========================================================================== */

/* Main Wrapper */
.primedesk-dashboard .primedesk-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Page Header */
.primedesk-dashboard .primedesk-page-header {
    margin-bottom: 30px;
}

.primedesk-dashboard .primedesk-page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
}

.primedesk-dashboard .primedesk-page-header .subtitle {
    margin: 0;
    font-size: 16px;
    color: #718096;
}

/* Statistics Cards */
.primedesk-dashboard .primedesk-stats-section {
    margin-bottom: 30px;
}

.primedesk-dashboard .primedesk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.primedesk-dashboard .stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.primedesk-dashboard .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.primedesk-dashboard .stat-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primedesk-dashboard .stat-card.highlight .stat-value,
.primedesk-dashboard .stat-card.highlight .stat-label {
    color: white;
}

.primedesk-dashboard .stat-icon {
    font-size: 32px;
    opacity: 0.9;
}

.primedesk-dashboard .stat-content {
    flex: 1;
}

.primedesk-dashboard .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-bottom: 4px;
}

.primedesk-dashboard .stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

/* Categories Overview */
.primedesk-dashboard .primedesk-categories-overview {
    margin-bottom: 40px;
}

.primedesk-dashboard .primedesk-categories-overview h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 20px;
}

.primedesk-dashboard .categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.primedesk-dashboard .category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.primedesk-dashboard .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.primedesk-dashboard .category-header {
    padding: 20px;
    color: white;
    font-weight: 600;
}

.primedesk-dashboard .category-header h3 {
    margin: 0;
    font-size: 18px;
}

.primedesk-dashboard .category-body {
    padding: 24px;
    text-align: center;
}

.primedesk-dashboard .category-count {
    font-size: 48px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-bottom: 8px;
}

.primedesk-dashboard .category-label {
    font-size: 14px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.primedesk-dashboard .category-description {
    font-size: 13px;
    color: #a0aec0;
    margin: 12px 0 0;
}

.primedesk-dashboard .category-footer {
    padding: 16px 24px;
    background: #f7fafc;
    text-align: center;
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* Recent Conversations */
.primedesk-dashboard .primedesk-recent-section {
    margin-top: 40px;
}

.primedesk-dashboard .primedesk-recent-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 20px;
}

.primedesk-dashboard .conversations-simple-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.primedesk-dashboard .conversation-simple-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}

.primedesk-dashboard .conversation-simple-item:hover {
    background: #f7fafc;
}

.primedesk-dashboard .conversation-simple-item:last-child {
    border-bottom: none;
}

.primedesk-dashboard .conversation-avatar {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
    border-radius: 50%;
    flex-shrink: 0;
}

.primedesk-dashboard .conversation-info {
    flex: 1;
}

.primedesk-dashboard .conversation-sender-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.primedesk-dashboard .sender-number {
    font-weight: 600;
    font-size: 15px;
    color: #1a202c;
}

.primedesk-dashboard .conversation-message {
    font-size: 14px;
    color: #718096;
    margin-bottom: 6px;
    line-height: 1.5;
}

/* ==========================================================================
   Category Page Styles (Specific)
   ========================================================================== */

.primedesk-category-dashboard .wrap.waprimedesk-wrap {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.primedesk-category-dashboard .waprimedesk-layout {
    display: flex;
    flex: 1;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #ffffff;
    overflow: hidden;
    min-height: 0;
}

/* Conversations Panel - Left (32%) */
.primedesk-category-dashboard .conversations-panel {
    flex: 0 0 380px;
    max-width: 380px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.primedesk-category-dashboard .conversations-header {
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.primedesk-category-dashboard .conversations-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

/* Filter Bar */
.primedesk-category-dashboard .conversation-filter-bar {
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.primedesk-category-dashboard .filter-controls {
    margin: 0;
}

.primedesk-category-dashboard #conversation-search {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #ffffff;
}

.primedesk-category-dashboard #conversation-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.primedesk-category-dashboard #conversation-search::placeholder {
    color: #9ca3af;
}

/* Status Tabs */
.primedesk-category-dashboard .conversation-status-tabs {
    display: flex;
    gap: 6px;
    background: transparent;
    padding: 0;
    border: none;
    flex-wrap: wrap;
}

.primedesk-category-dashboard .conversation-status-tab {
    flex: 1 0 0;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.primedesk-category-dashboard .conversation-status-tab:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.primedesk-category-dashboard .conversation-status-tab.is-active {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

.primedesk-category-dashboard .conversation-status-tab .tab-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    line-height: 1.2;
}

.primedesk-category-dashboard .conversation-status-tab.is-active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Conversations List */
.primedesk-category-dashboard #conversations-list {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
}

.primedesk-category-dashboard .conversation-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.15s;
}

.primedesk-category-dashboard .conversation-item:hover {
    background: #f9fafb;
}

.primedesk-category-dashboard .conversation-item.active {
    background: #eff6ff;
    border-left: 4px solid #667eea;
    padding-left: 16px;
}

.primedesk-category-dashboard .conversation-details {
    width: 100%;
}

.primedesk-category-dashboard .conversation-top {
    margin-bottom: 8px;
}

.primedesk-category-dashboard .conversation-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.primedesk-category-dashboard .conversation-sender-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.primedesk-category-dashboard .conversation-sender-number {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primedesk-category-dashboard .unread-badge {
    background: #ef4444;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    flex-shrink: 0;
}

.primedesk-category-dashboard .conversation-activity-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.primedesk-category-dashboard .thread-list {
    margin-top: 12px;
    padding-left: 1rem;
    border-left: 2px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.primedesk-category-dashboard .thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: none;
    background: #f7fafc;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #1f2937;
    cursor: pointer;
    transition: background 0.2s ease;
}

.primedesk-category-dashboard .thread-item.thread-main {
    background: transparent;
    border: 1px dashed rgba(15, 23, 42, 0.25);
}

.primedesk-category-dashboard .thread-item.active {
    background: #4f46e5;
    color: #fff;
}

.primedesk-category-dashboard .thread-label {
    font-weight: 600;
}

.primedesk-category-dashboard .thread-preview {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(15, 23, 42, 0.8);
}

.primedesk-category-dashboard .thread-time {
    font-size: 0.7rem;
    color: rgba(55, 65, 81, 0.85);
}

.primedesk-category-dashboard .thread-unread-badge,
.primedesk-category-dashboard .thread-activity-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.primedesk-category-dashboard .thread-unread-badge {
    background: #dc2626;
    color: #fff;
}

.primedesk-category-dashboard .thread-activity-badge {
    background: #fcd34d;
    color: #92400e;
}

.primedesk-category-dashboard .conversation-category-badge {
    padding: 3px 10px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.primedesk-category-dashboard .thread-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 6px;
}

.primedesk-category-dashboard .thread-main-badge {
    background: #f3f4f6;
    color: #6b7280;
}

.primedesk-category-dashboard .conversation-status-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-left: auto;
}

.primedesk-category-dashboard .status-new {
    background: #dbeafe;
    color: #1e40af;
}

.primedesk-category-dashboard .status-active {
    background: #d1fae5;
    color: #065f46;
}

.primedesk-category-dashboard .status-closed {
    background: #f3e8ff;
    color: #6b21a8;
}

.primedesk-category-dashboard .status-expired {
    background: #fed7aa;
    color: #92400e;
}

.primedesk-category-dashboard .conversation-preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.primedesk-category-dashboard .conversation-preview {
    flex: 1;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.primedesk-category-dashboard .you-label {
    color: #667eea;
    font-weight: 600;
}

.primedesk-category-dashboard .conversation-meta {
    font-size: 11px;
    color: #9ca3af;
}

.primedesk-category-dashboard .delete-conversation {
    background: transparent;
    border: none;
    color: #ef4444;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    visibility: hidden;
}

.primedesk-category-dashboard .conversation-item:hover .delete-conversation {
    opacity: 1;
    visibility: visible;
}

.primedesk-category-dashboard .delete-conversation:hover {
    background: #fef2f2;
}

.primedesk-category-dashboard .delete-conversation .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.primedesk-category-dashboard .no-conversations {
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

/* System Messages */
.primedesk-category-dashboard .message-system {
    background: #fffbe6;
    color: #4b5563;
    border: 1px dashed #fbbf24;
    border-radius: 12px;
    margin: 0 auto 15px;
    display: block;
    max-width: 60%;
    text-align: center;
}

.primedesk-category-dashboard .message-system-summary {
    font-weight: 600;
}

.primedesk-category-dashboard .message-system-details {
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
    word-break: break-word;
}

/* Chat Panel - Center */
.primedesk-category-dashboard .chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.primedesk-category-dashboard .chat-header {
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.primedesk-category-dashboard .chat-contact-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.primedesk-category-dashboard .chat-contact-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.primedesk-category-dashboard .chat-contact-status {
    display: flex;
    align-items: center;
}

.primedesk-category-dashboard .contact-name {
    margin: 0 0 2px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.primedesk-category-dashboard .contact-status {
    font-size: 12px;
    color: #6b7280;
    display: block;
}

.primedesk-category-dashboard .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f9fafb;
}

.primedesk-category-dashboard .no-conversation-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.primedesk-category-dashboard .welcome-message {
    text-align: center;
    color: #9ca3af;
    max-width: 320px;
}

.primedesk-category-dashboard .welcome-message .dashicons {
    font-size: 56px;
    width: 56px;
    height: 56px;
    color: #d1d5db;
    margin: 0 auto 20px;
    display: block;
}

.primedesk-category-dashboard .welcome-message h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.primedesk-category-dashboard .welcome-message p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.5;
}

.primedesk-category-dashboard .chat-input {
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.primedesk-category-dashboard .input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.primedesk-category-dashboard #message-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.4;
    max-height: 100px;
    min-height: 40px;
}

.primedesk-category-dashboard #message-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.primedesk-category-dashboard #send-message {
    padding: 10px 14px;
    background: #667eea;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
}

.primedesk-category-dashboard #send-message:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.primedesk-category-dashboard #send-message .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin: 0;
}

/* Actions Panel - Right */
.primedesk-category-dashboard .actions-panel {
    flex: 0 0 340px;
    max-width: 340px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.primedesk-category-dashboard .actions-header {
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.primedesk-category-dashboard .actions-header h2 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primedesk-category-dashboard .actions-context {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.primedesk-category-dashboard .actions-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.primedesk-category-dashboard .actions-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.primedesk-category-dashboard .actions-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.primedesk-category-dashboard .actions-placeholder p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

/* Action Groups */
.primedesk-category-dashboard .action-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.primedesk-category-dashboard .action-group h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

/* Status Controls */
.primedesk-category-dashboard .status-pill {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
}

.primedesk-category-dashboard .status-select-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

.primedesk-category-dashboard .status-select {
    width: 100%;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    transition: all 0.2s;
    color: #374151;
}

.primedesk-category-dashboard .status-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.primedesk-category-dashboard .status-select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.primedesk-category-dashboard .status-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.primedesk-category-dashboard .assign-notify-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Assignment Controls */
.primedesk-category-dashboard .assigned-member-display {
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
}

.primedesk-category-dashboard .assigned-member-info {
    font-size: 14px;
    color: #374151;
}

.primedesk-category-dashboard .no-assignment {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
}

.primedesk-category-dashboard .assigned-member-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

.primedesk-category-dashboard .assignment-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.primedesk-category-dashboard .assign-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.primedesk-category-dashboard .button {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    line-height: 1.4;
}

.primedesk-category-dashboard .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.primedesk-category-dashboard .button-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.primedesk-category-dashboard .button-secondary:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.primedesk-category-dashboard .button-primary {
    background: #667eea;
    color: #ffffff;
    border: none;
}

.primedesk-category-dashboard .button-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.primedesk-category-dashboard .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


.primedesk-category-dashboard .button.compact {
    padding: 8px;
    width: 40px;
    height: 40px;
    justify-content: center;
}


.primedesk-category-dashboard .assign-notify-group .notify-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.primedesk-category-dashboard .assign-notify-row .notify-select {
    flex: 1 1 180px;
    min-width: 180px;
}

.primedesk-category-dashboard .assign-notify-row .button {
    flex-shrink: 0;
}

.primedesk-category-dashboard .notify-select {
    width: 100%;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    transition: all 0.2s;
    color: #374151;
}

.primedesk-category-dashboard .notify-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.primedesk-category-dashboard .notify-select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Notes */
.primedesk-category-dashboard .notes-history {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.primedesk-category-dashboard .no-notes {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
}

.primedesk-category-dashboard .note-item {
    background: #ffffff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.primedesk-category-dashboard .note-item:last-child {
    margin-bottom: 0;
}

.primedesk-category-dashboard .note-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 6px;
}

.primedesk-category-dashboard .note-content {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.primedesk-category-dashboard .add-note-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primedesk-category-dashboard #new-internal-note {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s;
    line-height: 1.5;
}

.primedesk-category-dashboard #new-internal-note:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.primedesk-category-dashboard #new-internal-note:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.primedesk-category-dashboard .note-actions {
    display: flex;
    gap: 8px;
}

.primedesk-category-dashboard .description {
    margin: 8px 0 0 0;
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
}

/* Update Info */
.primedesk-category-dashboard .update-info {
    padding: 8px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    flex-shrink: 0;
}

/* Utility Classes */
.primedesk-category-dashboard .is-hidden {
    display: none !important;
}

.primedesk-category-dashboard .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Scrollbar Styling */
.primedesk-category-dashboard #conversations-list::-webkit-scrollbar,
.primedesk-category-dashboard .chat-messages::-webkit-scrollbar,
.primedesk-category-dashboard .actions-body::-webkit-scrollbar,
.primedesk-category-dashboard .notes-history::-webkit-scrollbar {
    width: 8px;
}

.primedesk-category-dashboard #conversations-list::-webkit-scrollbar-track,
.primedesk-category-dashboard .chat-messages::-webkit-scrollbar-track,
.primedesk-category-dashboard .actions-body::-webkit-scrollbar-track,
.primedesk-category-dashboard .notes-history::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.primedesk-category-dashboard #conversations-list::-webkit-scrollbar-thumb,
.primedesk-category-dashboard .chat-messages::-webkit-scrollbar-thumb,
.primedesk-category-dashboard .actions-body::-webkit-scrollbar-thumb,
.primedesk-category-dashboard .notes-history::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.primedesk-category-dashboard #conversations-list::-webkit-scrollbar-thumb:hover,
.primedesk-category-dashboard .chat-messages::-webkit-scrollbar-thumb:hover,
.primedesk-category-dashboard .actions-body::-webkit-scrollbar-thumb:hover,
.primedesk-category-dashboard .notes-history::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .primedesk-category-dashboard .conversations-panel {
        flex: 0 0 340px;
        max-width: 340px;
    }

    .primedesk-category-dashboard .actions-panel {
        flex: 0 0 320px;
        max-width: 320px;
    }
}

@media (max-width: 1200px) {
    .primedesk-category-dashboard .waprimedesk-layout {
        grid-template-columns: 320px 1fr;
    }

    .primedesk-category-dashboard .actions-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .primedesk-category-dashboard .waprimedesk-layout {
        flex-direction: column;
    }

    .primedesk-category-dashboard .conversations-panel {
        flex: 0 0 auto;
        max-width: 100%;
        max-height: 50vh;
    }

    .primedesk-category-dashboard .chat-panel {
        flex: 1;
    }

    .primedesk-header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
        gap: 12px;
    }

    .primedesk-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding: 8px 0;
    }
}

/* ==========================================================================
   Refined Popup Notification (Height Optimized)
   ========================================================================== */
.primedesk-popup {
    position: fixed;
    top: 20px; /* Reduced from 80px to sit higher */
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 360px; /* Slightly narrower for a tighter look */
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.primedesk-popup.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.primedesk-popup-content {
    background: #ffffff;
    border-radius: 10px; /* Slightly tighter radius */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.primedesk-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 10px 16px; /* Reduced padding from 14px/20px */
    display: flex;
    align-items: center;
}

.primedesk-popup-header strong {
    flex: 1;
    font-size: 14px; /* Slightly smaller header font */
    font-weight: 600;
}

.primedesk-popup-body {
    padding: 0; /* Removed 4px padding that adds unnecessary height */
    max-height: 220px; /* Reduced from 300px to keep it compact */
    overflow-y: auto;
}

.primedesk-popup-message {
    padding: 10px 14px; /* Reduced from 14px/16px */
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.primedesk-popup-sender {
    font-size: 13px; /* Scaled down */
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px; /* Reduced from 4px */
}

.primedesk-popup-preview {
    font-size: 12px; /* Scaled down */
    color: #6b7280;
    line-height: 1.3; /* Tighter leading */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .primedesk-popup {
        top: 10px; /* Bring it closer to top on mobile */
        right: 10px;
        left: 10px;
        min-width: 0;
        max-width: none;
        width: auto;
    }
}

/* Thread Tag Badge - More prominent than category badge */
.thread-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
}

/* Section Subtitle */
.section-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-top: -8px;
    margin-bottom: 16px;
}