/* ==========================================================================
   Premium SaaS Ticket Dashboard - Style System
   ========================================================================== */

/* Design Tokens & Theme Variables */
#premium-saas-dashboard-container {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Plus Jakarta Sans', var(--font-sans);
    
    /* Light Mode colors */
    --background: #f8f8fc;
    --foreground: #09090f;
    --card: #ffffff;
    --card-foreground: #09090f;
    --popover: #ffffff;
    --popover-foreground: #09090f;
    --primary: #5c4dff;
    --primary-foreground: #ffffff;
    --secondary: #f3f2ff;
    --secondary-foreground: #4a3bf5;
    --muted: #f1f1f6;
    --muted-foreground: #6b6b80;
    --accent: #ede9fe;
    --accent-foreground: #5c4dff;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --border: rgba(0, 0, 0, 0.05);
    --input: transparent;
    --input-background: #f1f1f6;
    --switch-background: #e5e7eb;
    --ring: #5c4dff;
    --radius: 16px;
    --sidebar: rgba(255, 255, 255, 0.7);
    --sidebar-foreground: #09090f;
    --sidebar-border: rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.01), 0 2px 8px rgba(0,0,0,0.02);
    --shadow-md: 0 12px 24px -6px rgba(92, 77, 255, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 24px 48px -12px rgba(92, 77, 255, 0.08), 0 8px 24px -4px rgba(0, 0, 0, 0.03);
    
    font-family: var(--font-sans);
    background: radial-gradient(at 0% 0%, rgba(92, 77, 255, 0.04) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.04) 0px, transparent 50%),
                var(--background) !important;
    color: var(--foreground) !important;
    height: 100vh !important;
    width: 100vw !important;
    display: flex !important;
    flex-direction: row !important;
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    overflow: hidden !important;
}

/* Adjust layout if WordPress Admin Bar is visible */
.admin-bar #premium-saas-dashboard-container {
    top: 32px !important;
    height: calc(100vh - 32px) !important;
}
@media screen and (max-width: 782px) {
    .admin-bar #premium-saas-dashboard-container {
        top: 46px !important;
        height: calc(100vh - 46px) !important;
    }
}

#premium-saas-dashboard-container.dark {
    /* Dark Mode overrides */
    --background: #07070b;
    --foreground: #f3f4f6;
    --card: rgba(17, 16, 28, 0.6);
    --card-foreground: #f3f4f6;
    --popover: #11101e;
    --popover-foreground: #f3f4f6;
    --primary: #7566ff;
    --primary-foreground: #ffffff;
    --secondary: #16152a;
    --secondary-foreground: #a399ff;
    --muted: #151424;
    --muted-foreground: #8c8da3;
    --accent: #16152a;
    --accent-foreground: #a399ff;
    --destructive: #991b1b;
    --destructive-foreground: #fca5a5;
    --border: rgba(255, 255, 255, 0.04);
    --input: rgba(255, 255, 255, 0.03);
    --input-background: #141322;
    --ring: #7566ff;
    --sidebar: rgba(10, 9, 18, 0.7);
    --sidebar-foreground: #f3f4f6;
    --sidebar-border: rgba(255, 255, 255, 0.03);
    background: radial-gradient(at 0% 0%, rgba(109, 93, 246, 0.12) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
                var(--background);
}

/* Reset modifications to avoid conflicting with theme styles */
#premium-saas-dashboard-container * {
    box-sizing: border-box;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

#premium-saas-dashboard-container h1,
#premium-saas-dashboard-container h2,
#premium-saas-dashboard-container h3,
#premium-saas-dashboard-container h4,
#premium-saas-dashboard-container h5,
#premium-saas-dashboard-container h6 {
    font-family: var(--font-heading), var(--font-sans);
}

#premium-saas-dashboard-container h1,
#premium-saas-dashboard-container h2,
#premium-saas-dashboard-container h3,
#premium-saas-dashboard-container h4,
#premium-saas-dashboard-container h5,
#premium-saas-dashboard-container h6,
#premium-saas-dashboard-container p,
#premium-saas-dashboard-container ul,
#premium-saas-dashboard-container ol,
#premium-saas-dashboard-container li {
    margin: 0;
    padding: 0;
}

/* Layout Framework */
.premium-dashboard-sidebar, #premium-saas-dashboard-container .dashboard-sidebar {
    width: 240px !important;
    flex-shrink: 0 !important;
    background: var(--sidebar) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    margin: 0 !important;
}

.premium-dashboard-main, #premium-saas-dashboard-container .dashboard-main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    background-color: transparent !important;
    box-sizing: border-box !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
}

.premium-dashboard-topnav, #premium-saas-dashboard-container .dashboard-topnav {
    height: 65px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 28px !important;
    position: relative !important;
    z-index: 90 !important;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
#premium-saas-dashboard-container.dark .premium-dashboard-topnav, #premium-saas-dashboard-container.dark .dashboard-topnav {
    background: rgba(7, 7, 11, 0.4) !important;
}

.premium-dashboard-content, #premium-saas-dashboard-container .dashboard-content {
    flex: 1 !important;
    padding: 24px 28px !important;
    background-color: transparent !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    float: none !important;
    margin: 0 !important;
}

#panel-kanban .premium-dashboard-content, #panel-kanban .dashboard-content {
    max-width: none;
}

/* Brand Header */
.premium-sidebar-brand, #premium-saas-dashboard-container .sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}
.premium-brand-logo, #premium-saas-dashboard-container .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-logo-img {
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
    transition: filter 150ms ease;
}
#premium-saas-dashboard-container.dark .brand-logo-img {
    filter: invert(1) brightness(2);
}
.premium-brand-text h3, #premium-saas-dashboard-container .brand-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
}
.premium-brand-text span, #premium-saas-dashboard-container .brand-text span {
    font-size: 11px;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* Navigation Menu */
.premium-sidebar-menu, #premium-saas-dashboard-container .sidebar-menu {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.premium-menu-item, #premium-saas-dashboard-container .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
}
.premium-menu-item i, #premium-saas-dashboard-container .menu-item i {
    width: 16px;
    height: 16px;
}
.premium-menu-item:hover, #premium-saas-dashboard-container .menu-item:hover {
    background-color: var(--muted);
    color: var(--foreground);
}
.premium-menu-item.active, #premium-saas-dashboard-container .menu-item.active {
    background: linear-gradient(135deg, rgba(92, 77, 255, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    color: var(--secondary-foreground);
    position: relative;
    box-shadow: 0 4px 12px rgba(92, 77, 255, 0.03);
    border: 1px solid rgba(92, 77, 255, 0.12);
}
#premium-saas-dashboard-container.dark .premium-menu-item.active, #premium-saas-dashboard-container.dark .menu-item.active {
    background: linear-gradient(135deg, rgba(117, 102, 255, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-color: rgba(117, 102, 255, 0.15);
}
.premium-menu-item.active::before, #premium-saas-dashboard-container .menu-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 25%;
    height: 50%;
    width: 3px;
    background-color: var(--primary);
    border-radius: 99px;
}

/* Sidebar Footer User Card */
.premium-sidebar-footer, #premium-saas-dashboard-container .sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
}
.premium-sidebar-user, #premium-saas-dashboard-container .sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--accent-foreground);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-avatar-initials.small {
    width: 30px;
    height: 30px;
    font-size: 11px;
}
.user-avatar-initials.large {
    width: 44px;
    height: 44px;
    font-size: 16px;
}
.premium-user-info h4, #premium-saas-dashboard-container .user-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}
.premium-user-info .user-role, #premium-saas-dashboard-container .user-info .user-role {
    font-size: 11px;
    color: var(--muted-foreground);
}

/* Top Navigation Buttons */
.premium-topnav-left h2, #premium-saas-dashboard-container .topnav-left h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.01em;
}
.premium-topnav-right, #premium-saas-dashboard-container .topnav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.premium-topnav-btn, #premium-saas-dashboard-container .topnav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, #6D5DF6, #8b5cf6);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(109,93,246,0.3);
}
.btn-primary:hover {
    opacity: 0.95;
    box-shadow: 0 4px 14px rgba(109,93,246,0.4);
}
.btn-secondary-outline {
    background-color: var(--card);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
}
.btn-secondary-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.premium-topnav-icon-btn, #premium-saas-dashboard-container .topnav-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: var(--card);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.premium-topnav-icon-btn:hover, #premium-saas-dashboard-container .topnav-icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Tab Panels Visibility */
.premium-tab-panel, #premium-saas-dashboard-container .tab-panel {
    display: none;
    animation: fadeIn 200ms ease;
}
.premium-tab-panel.active, #premium-saas-dashboard-container .tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* DASHBOARD BANNER */
.dashboard-banner {
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6D5DF6 0%, #8b5cf6 50%, #a78bfa 100%);
    box-shadow: 0 4px 24px rgba(109,93,246,0.25);
    margin-bottom: 24px;
}
.banner-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.banner-content {
    position: relative;
    z-index: 10;
}
.banner-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}
.banner-title {
    color: #ffffff;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.banner-title span {
    color: #fde68a;
}
.banner-description {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}
.banner-action-btn {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    cursor: pointer;
}
.banner-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-cols: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(92, 77, 255, 0.25);
}
#premium-saas-dashboard-container.dark .stat-card {
    background: rgba(17, 16, 28, 0.45);
    border-color: rgba(255, 255, 255, 0.05);
}
.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
}
.stat-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon-wrapper i {
    width: 16px;
    height: 16px;
}
.stat-icon-wrapper.purple { background-color: rgba(109,93,246,0.1); color: #6D5DF6; }
.stat-icon-wrapper.orange { background-color: rgba(245,158,11,0.1); color: #f59e0b; }
.stat-icon-wrapper.green { background-color: rgba(52,211,153,0.1); color: #34d399; }
.stat-icon-wrapper.red { background-color: rgba(239,68,68,0.1); color: #ef4444; }
.stat-icon-wrapper.blue { background-color: rgba(96,165,250,0.1); color: #60a5fa; }
.stat-value {
    font-family: var(--font-heading), var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
}
.stat-trend i {
    width: 12px;
    height: 12px;
}
.trend-up { color: #34d399; }
.trend-down { color: #f59e0b; }
.text-red { color: #ef4444; }
.trend-sub {
    color: var(--muted-foreground);
    font-weight: 400;
}

/* CHARTS LAYOUT */
.charts-row {
    display: grid;
    grid-template-cols: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.chart-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms ease;
}
.chart-container:hover {
    box-shadow: var(--shadow-md);
}
#premium-saas-dashboard-container.dark .chart-container {
    background: rgba(17, 16, 28, 0.45);
    border-color: rgba(255, 255, 255, 0.05);
}
.chart-container.span-2 {
    grid-column: span 2;
}
.chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}
.chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}
.chart-sub {
    font-size: 11px;
    color: var(--muted-foreground);
    margin-top: 2px;
}
.chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted-foreground);
}
.dot-legend {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-legend.open { background-color: #6D5DF6; }
.dot-legend.resolved { background-color: #34d399; }
.dot-legend.pending { background-color: #f59e0b; }

.chart-canvas-wrapper {
    position: relative;
    flex: 1;
    min-height: 200px;
}
.chart-canvas-wrapper.large-canvas {
    min-height: 320px;
}
.chart-donut-wrapper {
    position: relative;
    height: 160px;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

/* Donut legend details list */
.donut-details-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.donut-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}
.donut-detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--foreground);
}
.donut-detail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.donut-detail-percent {
    font-weight: 600;
    color: var(--muted-foreground);
}

/* BOX CONTAINERS */
.card-box {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 250ms ease, border-color 250ms ease;
}
#premium-saas-dashboard-container.dark .card-box {
    background: rgba(17, 16, 28, 0.45);
    border-color: rgba(255, 255, 255, 0.05);
}
.card-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.card-box-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}
.btn-text {
    background: transparent;
    border: none;
    color: #6D5DF6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-text:hover {
    opacity: 0.8;
}

/* TABLES DESIGN */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.dashboard-table th {
    padding: 12px 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.dashboard-table td {
    padding: 14px 20px;
    font-size: 13px;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
}
.dashboard-table tr:last-child td {
    border-bottom: none;
}
.dashboard-table.clickable-rows tbody tr {
    cursor: pointer;
}
.dashboard-table.clickable-rows tbody tr:hover {
    background-color: var(--muted);
}
.dashboard-table tr.selected {
    background-color: rgba(109, 93, 246, 0.04) !important;
}

/* Sortable Headers */
.dashboard-table th.sortable {
    cursor: pointer;
}
.dashboard-table th.sortable:hover {
    color: var(--foreground);
}
.dashboard-table th.sortable i {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    margin-right: 6px;
}

/* Status Colors */
.badge.open { background-color: rgba(109,93,246,0.12); color: #6D5DF6; }
.badge.in-progress { background-color: rgba(245,158,11,0.12); color: #d97706; }
.badge.pending { background-color: rgba(96,165,250,0.12); color: #2563eb; }
.badge.resolved { background-color: rgba(52,211,153,0.12); color: #059669; }
.badge.closed { background-color: rgba(107,114,128,0.12); color: #4b5563; }

/* Priority Colors */
.badge.priority-critical { background-color: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.15); }
.badge.priority-high { background-color: rgba(249,115,22,0.1); color: #f97316; border: 1px solid rgba(249,115,22,0.15); }
.badge.priority-medium { background-color: rgba(234,179,8,0.1); color: #ca8a04; border: 1px solid rgba(234,179,8,0.15); }
.badge.priority-low { background-color: rgba(107,114,128,0.1); color: #6b7280; border: 1px solid rgba(107,114,128,0.15); }

/* Monospace IDs */
.monospace-id {
    font-family: monospace;
    font-weight: 700;
    color: #6D5DF6;
    font-size: 13px;
}

/* Table Avatar alignment */
.avatar-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}
.table-subject-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.table-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    background-color: var(--muted);
    color: var(--muted-foreground);
}

/* Row Action Buttons */
.row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.action-btn:hover {
    background-color: var(--accent);
    color: var(--primary);
}
.action-btn.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* TOOLBARS & FILTERS */
.toolbar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 360px;
}
.search-input-wrapper input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 38px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    font-size: 13px;
    outline: none;
}
.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 93, 246, 0.1);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--muted-foreground);
    pointer-events: none;
}
.toolbar-select {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}
.toolbar-select:focus {
    border-color: var(--primary);
}
.toolbar-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background-color: var(--card);
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.toolbar-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.flex-spacer {
    flex: 1;
}

/* Status tabs filters inside Tickets tab */
.status-tab-filters {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.status-filter-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted-foreground);
    padding-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
}
.status-filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.status-filter-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
    background-color: var(--muted);
    color: var(--muted-foreground);
}
.status-filter-btn.active .status-filter-count {
    background-color: rgba(109, 93, 246, 0.12);
    color: var(--primary);
}

/* Pagination bar styling */
.table-pagination-bar {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pagination-summary {
    font-size: 13px;
    color: var(--muted-foreground);
}
.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pag-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pag-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.pag-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

/* KANBAN BOARD */
.kanban-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: calc(100vh - 160px);
    align-items: flex-start;
}
.kanban-column {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--muted);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 2px solid transparent;
    max-height: calc(100vh - 120px);
}
.kanban-column.drag-over {
    border-color: var(--primary);
    background-color: rgba(109, 93, 246, 0.03);
}
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 12px;
}
.kanban-column-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.kanban-dot.new { background-color: #6b7280; }
.kanban-dot.assigned { background-color: #6D5DF6; }
.kanban-dot.in-progress { background-color: #f59e0b; }
.kanban-dot.review { background-color: #60a5fa; }
.kanban-dot.resolved { background-color: #34d399; }

.kanban-column-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
}
.kanban-column-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--muted-foreground);
}
.kanban-column-header button {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
}
.kanban-column-header button:hover {
    color: var(--primary);
}

.kanban-column-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 100px;
}
.kanban-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.dragging {
    opacity: 0.5;
}
.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: break-word;
}
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.kanban-card-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--muted-foreground);
}
.kanban-card-icons span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.kanban-card-icons i {
    width: 12px;
    height: 12px;
}
.kanban-card-sla {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #ef4444;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}
.kanban-card-sla i {
    width: 11px;
    height: 11px;
}
.kanban-empty-placeholder {
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--muted-foreground);
}

/* TICKET DETAIL VIEW */
.detail-header-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.detail-ids-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-layout {
    display: grid;
    grid-template-cols: 1fr 280px;
    gap: 20px;
}
.detail-chat-area {
    display: flex;
    flex-direction: column;
}
.detail-subject {
    font-size: 18px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
}
.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted-foreground);
}
.detail-tags {
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-dot {
    color: var(--border);
}

/* Chat Messages */
.chat-messages-container {
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-height: 600px;
}
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
}
.chat-subtitle {
    font-size: 12px;
    color: var(--muted-foreground);
    margin-left: 8px;
}
.chat-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.chat-msg-row {
    display: flex;
    gap: 12px;
}
.chat-msg-row.agent-side {
    flex-direction: row-reverse;
}
.chat-bubble-wrapper {
    flex-1: 1;
    max-width: 80%;
    display: flex;
    flex-direction: column;
}
.chat-msg-row.agent-side .chat-bubble-wrapper {
    align-items: flex-end;
}
.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}
.chat-msg-row.agent-side .chat-msg-header {
    flex-direction: row-reverse;
}
.chat-sender-name {
    font-weight: 600;
    color: var(--foreground);
}
.chat-time {
    color: var(--muted-foreground);
    font-size: 11px;
}
.chat-agent-label {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    background-color: rgba(109, 93, 246, 0.1);
    color: var(--primary);
}
.chat-bubble {
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
}
.chat-msg-row:not(.agent-side) .chat-bubble {
    background-color: var(--muted);
    color: var(--foreground);
    border-top-left-radius: 4px;
}
.chat-msg-row.agent-side .chat-bubble {
    background: linear-gradient(135deg, #6D5DF6, #8b5cf6);
    color: #ffffff;
    border-top-right-radius: 4px;
}

/* Chat Reply Input */
.chat-input-box {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.chat-input-wrapper {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    overflow: hidden;
}
.chat-input-wrapper textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 16px 4px;
    font-size: 13px;
    outline: none;
    resize: none;
    color: var(--foreground);
}
.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 10px;
}
.chat-attachment-btn {
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
}
.chat-attachment-btn:hover {
    color: var(--primary);
}

/* Detail Right Sidebar Profile */
.detail-sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sidebar-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 12px;
}
.customer-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.customer-profile-card h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--foreground);
}
.customer-profile-card span {
    font-size: 11px;
    color: var(--muted-foreground);
}
.profile-details-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}
.profile-label {
    color: var(--muted-foreground);
}
.profile-value {
    font-weight: 600;
    color: var(--foreground);
}
.text-green { color: #34d399; }

/* SLA Timer sidebar */
.sla-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.sla-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}
.sla-time-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}
.sla-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background-color: var(--muted);
    overflow: hidden;
    margin-bottom: 8px;
}
.sla-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #34d399, #f59e0b, #ef4444);
}
.sla-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--muted-foreground);
}

/* Agent assignment */
.agent-assignment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.agent-assignment-header h3 {
    font-size: 13px;
    font-weight: 600;
}
.btn-text-primary {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.agent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background-color 150ms ease;
}
.agent-card:hover {
    background-color: var(--muted);
}
.kanban-agent-initials {
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.kanban-agent-initials:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--primary);
}
.agent-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}
.agent-card span {
    font-size: 11px;
    color: var(--muted-foreground);
}
.agent-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted-foreground);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green { background-color: #34d399; }

/* Timeline design */
.timeline-wrapper {
    display: flex;
    flex-direction: column;
}
.timeline-item {
    display: flex;
    gap: 12px;
}
.timeline-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.timeline-badge.purple { background-color: rgba(109,93,246,0.1); color: #6D5DF6; }
.timeline-badge.blue { background-color: rgba(96,165,250,0.1); color: #60a5fa; }
.timeline-badge i {
    width: 11px;
    height: 11px;
}
.timeline-content {
    padding-bottom: 16px;
}
.timeline-content h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--foreground);
}
.timeline-content span {
    font-size: 10.5px;
    color: var(--muted-foreground);
    margin-top: 2px;
    display: block;
}

/* AGENTS GRID */
.agents-grid {
    display: grid;
    grid-template-cols: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.agent-grid-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.agent-grid-card .avatar-large {
    width: 52px;
    height: 52px;
    font-size: 18px;
    margin-bottom: 12px;
}
.agent-grid-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 2px;
}
.agent-grid-card p {
    font-size: 11.5px;
    color: var(--muted-foreground);
    margin-bottom: 12px;
}
.agent-grid-stats {
    width: 100%;
    display: grid;
    grid-template-cols: 1fr 1fr;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 4px;
}
.agent-grid-stat-box {
    display: flex;
    flex-direction: column;
}
.agent-grid-stat-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
}
.agent-grid-stat-lbl {
    font-size: 10px;
    color: var(--muted-foreground);
    margin-top: 2px;
}

/* SETTINGS FORM */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-grid {
    display: grid;
    grid-template-cols: 1fr 1fr;
    gap: 16px;
}
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--foreground);
}
.form-helper {
    font-size: 11px;
    color: var(--muted-foreground);
}
.form-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    font-size: 13px;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
}
textarea.form-input {
    height: auto;
    padding: 10px 12px;
}
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--muted);
    border-radius: 8px;
    padding: 12px;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.checkbox-row label {
    font-weight: 500;
    cursor: pointer;
}
.settings-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

/* MODALS */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(10, 9, 22, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1), visibility 250ms ease;
}
.premium-modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.premium-modal-card {
    width: 90%;
    max-width: 520px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.75) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(92, 77, 255, 0.15), 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
#premium-saas-dashboard-container.dark .premium-modal-card {
    background: linear-gradient(135deg, rgba(18, 17, 32, 0.85) 0%, rgba(13, 12, 22, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(255,255,255,0.02);
}
.premium-modal-overlay.active .premium-modal-card {
    transform: scale(1);
}
.premium-modal-card.max-w-sm {
    max-width: 380px;
}
.modal-card-header {
    padding: 20px 24px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-card-header h3 {
    font-family: var(--font-heading), var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    color: var(--foreground);
}
.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--muted);
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease, color 150ms ease;
}
.modal-close-btn:hover {
    background-color: var(--accent);
    color: var(--primary);
}
.modal-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
.modal-card-footer {
    padding: 16px 24px;
    background-color: rgba(0, 0, 0, 0.01);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Agent selection card list */
.agents-list-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.agent-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}
.agent-select-row:hover {
    background-color: var(--muted);
}
.agent-select-row.selected {
    border-color: var(--primary);
    background-color: var(--secondary);
}

/* PREMIUM SUBSCRIPTION CARD FOR FRONTEND GUESTS */
.premium-auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(at 0% 0%, rgba(92, 77, 255, 0.05) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%),
                var(--background);
}
#premium-saas-dashboard-container.dark .premium-auth-container {
    background: radial-gradient(at 0% 0%, rgba(109, 93, 246, 0.15) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
                var(--background);
}
.premium-auth-card {
    max-width: 440px;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
#premium-saas-dashboard-container.dark .premium-auth-card {
    background: rgba(17, 16, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.3);
}
.auth-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(92, 77, 255, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.premium-auth-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--foreground);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.premium-auth-card p {
    font-size: 13.5px;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: 24px;
}
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 150ms ease, opacity 150ms ease;
}
.auth-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.auth-btn:active {
    transform: translateY(0);
}
.auth-btn.btn-primary {
    background: linear-gradient(135deg, #6D5DF6, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(109,93,246,0.3);
}
.auth-btn.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}
.auth-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted-foreground);
    margin-bottom: 4px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* ==========================================================================
   Premium Support Login Form Styling
   ========================================================================== */
.auth-login-form {
    text-align: left;
    margin-top: 24px;
}

.auth-error-notice {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted-foreground);
}

.form-input {
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: var(--input-background);
    color: var(--foreground);
    font-size: 13.5px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 93, 246, 0.15);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted-foreground);
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid var(--border);
    accent-color: var(--primary);
    cursor: pointer;
}

.auth-btn.w-full {
    width: 100%;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: btn-spin 0.6s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Demo Info Helper Card */
.demo-info-card {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(92, 77, 255, 0.04);
    border: 1px dashed rgba(92, 77, 255, 0.25);
    text-align: left;
}
#premium-saas-dashboard-container.dark .demo-info-card {
    background: rgba(117, 102, 255, 0.04);
    border-color: rgba(117, 102, 255, 0.25);
}
.demo-info-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-accounts-grid {
    display: grid;
    grid-template-cols: 1fr;
    gap: 10px;
}
.demo-account-row {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--muted-foreground);
    background: var(--card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.demo-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.demo-account-role-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}
.demo-account-role-badge.admin {
    background-color: rgba(92, 77, 255, 0.1);
    color: var(--primary);
}
.demo-account-role-badge.customer {
    background-color: rgba(52, 211, 153, 0.1);
    color: #34d399;
}
.demo-account-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: monospace;
    color: var(--foreground);
}
.demo-autofill-btn {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 100ms ease;
}
.demo-autofill-btn:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ==========================================================================
   WordPress Admin Chrome Suppression
   Hides the WP admin sidebar and top admin bar to allow a clean, full-screen
   SaaS Dashboard interface on our plugin page.
   ========================================================================== */
body[class*="saas-ticket-dashboard"] #adminmenuwrap,
body[class*="saas-ticket-dashboard"] #adminmenuback,
body[class*="saas-ticket-dashboard"] #wpadminbar,
body[class*="saas-ticket-dashboard"] #wpfooter {
    display: none !important;
}

body[class*="saas-ticket-dashboard"] #wpcontent,
body[class*="saas-ticket-dashboard"] #wpbody,
body[class*="saas-ticket-dashboard"] #wpbody-content {
    margin-left: 0 !important;
    padding: 0 !important;
}

body[class*="saas-ticket-dashboard"] {
    padding-top: 0 !important;
    margin-top: 0 !important;
    background-color: var(--background) !important;
}

body[class*="saas-ticket-dashboard"] #wpbody-content {
    padding-bottom: 0 !important;
}

/* Hide WP notices and upgrade warnings on our screen to keep layout perfect */
body[class*="saas-ticket-dashboard"] .notice,
body[class*="saas-ticket-dashboard"] .updated,
body[class*="saas-ticket-dashboard"] .error,
body[class*="saas-ticket-dashboard"] .update-nag,
body[class*="saas-ticket-dashboard"] .wp-header-end,
body[class*="saas-ticket-dashboard"] #setting-error-settings_updated {
    display: none !important;
}

html.wp-toolbar {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ==========================================================================
   Mobile Responsive & Layout Adjustments
   ========================================================================== */

/* Toggle buttons & Overlay */
.mobile-menu-toggle-btn {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background-color 150ms ease;
}
.mobile-menu-toggle-btn:hover {
    background-color: var(--muted);
    color: var(--foreground);
}

.premium-sidebar-overlay, #premium-saas-dashboard-container .sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(13, 12, 24, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 250ms ease;
}
.premium-sidebar-overlay.active, #premium-saas-dashboard-container .sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* responsive queries */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-cols: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
        margin-bottom: 20px;
    }
    .charts-row {
        grid-template-cols: 1fr;
        gap: 16px;
    }
    .chart-container.span-2 {
        grid-column: span 1;
    }
    .agents-grid {
        grid-template-cols: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 992px) {
    .detail-layout {
        grid-template-cols: 1fr;
    }
    .detail-sidebar-area {
        margin-top: 12px;
    }
}

@media (max-width: 1024px) {
    .mobile-menu-toggle-btn {
        display: flex !important;
    }
    .premium-dashboard-sidebar, #premium-saas-dashboard-container .dashboard-sidebar {
        position: fixed !important;
        left: -245px !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        z-index: 999 !important;
        box-shadow: var(--shadow-lg) !important;
        transition: left 250ms cubic-bezier(0.4, 0, 0.2, 1) !important;
        width: 240px !important;
    }
    .admin-bar .premium-dashboard-sidebar, .admin-bar .dashboard-sidebar {
        top: 32px !important;
        height: calc(100vh - 32px) !important;
    }
    @media screen and (max-width: 782px) {
        .admin-bar .premium-dashboard-sidebar, .admin-bar .dashboard-sidebar {
            top: 46px !important;
            height: calc(100vh - 46px) !important;
        }
    }
    .premium-dashboard-sidebar.mobile-open, .dashboard-sidebar.mobile-open {
        left: 0 !important;
    }
    .premium-dashboard-topnav, .dashboard-topnav {
        padding: 0 16px !important;
    }
    .premium-dashboard-content, .dashboard-content {
        padding: 16px !important;
    }
    .dashboard-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
        padding: 20px !important;
    }
    .banner-action-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .toolbar-wrapper {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .search-input-wrapper {
        max-width: none !important;
    }
    .toolbar-select, .toolbar-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .flex-spacer {
        display: none !important;
    }
    .status-tab-filters {
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 12px !important;
        padding-bottom: 4px !important;
    }
}
@media (max-width: 600px) {
    .stats-grid {
        grid-template-cols: 1fr;
    }
}

/* ==========================================================================
   FIGMA DESIGN THEME ALIGNMENT OVERRIDES
   ========================================================================== */

#premium-saas-dashboard-container {
    --primary: #6D5DF6 !important;
    --ring: #6D5DF6 !important;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

#premium-saas-dashboard-container.dark {
    --primary: #7566ff !important;
    --ring: #7566ff !important;
}

/* Custom Scrollbars */
#premium-saas-dashboard-container *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#premium-saas-dashboard-container *::-webkit-scrollbar-track {
    background: transparent;
}
#premium-saas-dashboard-container *::-webkit-scrollbar-thumb {
    background: rgba(109, 93, 246, 0.2);
    border-radius: 99px;
}
#premium-saas-dashboard-container *::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 93, 246, 0.4);
}
#premium-saas-dashboard-container *::selection {
    color: inherit;
    background: rgba(109, 93, 246, 0.2);
}

/* Global Search Container */
.global-search-container {
    position: relative;
    width: 280px;
    margin-left: 12px;
}
.global-search-input {
    width: 100%;
    padding: 8px 36px 8px 36px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    border: 1.5px solid transparent !important;
    outline: none !important;
    background-color: var(--muted) !important;
    color: var(--foreground) !important;
    transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease !important;
}
.global-search-input:focus {
    background-color: var(--card) !important;
    border-color: #6D5DF6 !important;
    box-shadow: 0 0 0 3px rgba(109, 93, 246, 0.12) !important;
}
#premium-saas-dashboard-container.dark .global-search-input:focus {
    border-color: #7566ff !important;
    box-shadow: 0 0 0 3px rgba(117, 102, 255, 0.15) !important;
}
.global-search-kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--muted-foreground);
    font-family: monospace;
    pointer-events: none;
    user-select: none;
    transition: opacity 150ms ease;
    border: 1px solid var(--border);
}
#premium-saas-dashboard-container.dark .global-search-kbd {
    background: rgba(255, 255, 255, 0.05);
}
.global-search-input:focus + .global-search-kbd {
    opacity: 0;
}

/* Header Icon Buttons with Badges */
.header-badge-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background-color: var(--card);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.header-badge-btn:hover {
    background-color: var(--accent);
    color: #6D5DF6;
    border-color: #6D5DF6;
}
#premium-saas-dashboard-container.dark .header-badge-btn:hover {
    color: #7566ff;
    border-color: #7566ff;
}
.header-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 99px;
    font-size: 8px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.header-badge-count.red {
    background-color: #ef4444;
}
.header-badge-count.purple {
    background-color: #6D5DF6;
}

/* User Profile Selector Button */
.header-user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 3px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}
.header-user-profile-btn:hover {
    border-color: #6D5DF6;
    background-color: var(--accent);
}
#premium-saas-dashboard-container.dark .header-user-profile-btn:hover {
    border-color: #7566ff;
}
.header-user-profile-btn .avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6D5DF6 0%, #a78bfa 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-user-profile-btn .chevron-icon {
    color: var(--muted-foreground);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
}

/* Floating Popovers */
.header-popover-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    width: 300px;
    border-radius: 12px;
    background-color: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}
.header-popover-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.popover-header h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--foreground);
}
.popover-header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 2px;
    display: flex;
    align-items: center;
}
.popover-body {
    max-height: 240px;
    overflow-y: auto;
}
.popover-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: left;
}
.popover-item:hover {
    background-color: var(--muted);
}
.popover-item:last-child {
    border-bottom: none;
}
.popover-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.popover-item-dot.critical { background-color: #ef4444; }
.popover-item-dot.info { background-color: #6D5DF6; }
.popover-item-dot.success { background-color: #34d399; }
.popover-item-dot.warning { background-color: #f59e0b; }
.popover-item-text {
    flex-grow: 1;
}
.popover-item-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground);
    line-height: 1.4;
    margin: 0 !important;
    padding: 0 !important;
}
.popover-item-time {
    font-size: 10px;
    color: var(--muted-foreground);
    margin-top: 2px;
}
.popover-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.popover-footer-btn {
    background: none;
    border: none;
    color: #6D5DF6;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.popover-footer-btn:hover {
    text-decoration: underline;
}

/* Sidebar links custom layout */
.premium-menu-item {
    transition: all 150ms ease;
}
.premium-menu-item:hover {
    background-color: var(--muted) !important;
    color: var(--foreground) !important;
}
.premium-menu-item.active {
    background: rgba(109, 93, 246, 0.08) !important;
    color: #6D5DF6 !important;
    border: 1px solid rgba(109, 93, 246, 0.12) !important;
    box-shadow: 0 4px 12px rgba(109, 93, 246, 0.02) !important;
}
.premium-menu-item.active::before {
    background-color: #6D5DF6 !important;
}
#premium-saas-dashboard-container.dark .premium-menu-item.active {
    background: rgba(117, 102, 255, 0.12) !important;
    border-color: rgba(117, 102, 255, 0.15) !important;
    color: #7566ff !important;
}
#premium-saas-dashboard-container.dark .premium-menu-item.active::before {
    background-color: #7566ff !important;
}

/* Stat Cards adjustments */
.stat-card {
    border: 1px solid var(--border) !important;
}
.chart-container {
    border: 1px solid var(--border) !important;
}
.card-box {
    border: 1px solid var(--border) !important;
}

/* Badge system colors */
.badge.open { background-color: rgba(109, 93, 246, 0.12) !important; color: #6D5DF6 !important; }
.badge.in-progress { background-color: rgba(245, 158, 11, 0.12) !important; color: #d97706 !important; }
.badge.pending { background-color: rgba(96, 165, 250, 0.12) !important; color: #2563eb !important; }
.badge.resolved { background-color: rgba(52, 211, 153, 0.12) !important; color: #059669 !important; }
.badge.closed { background-color: rgba(107, 114, 128, 0.12) !important; color: #4b5563 !important; }

/* Pricing cards styling */
.pricing-card {
    background-color: var(--card) !important;
    border: 1px solid var(--border) !important;
    position: relative;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    overflow: hidden;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms ease !important;
}
.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(92, 77, 255, 0.25) !important;
}
.pricing-card.featured {
    border-color: rgba(92, 77, 255, 0.3) !important;
    box-shadow: var(--shadow-md);
}
.pricing-card.active-plan {
    border-color: var(--primary) !important;
    background: linear-gradient(135deg, rgba(92, 77, 255, 0.03) 0%, transparent 100%) !important;
}
#premium-saas-dashboard-container.dark .pricing-card.active-plan {
    background: linear-gradient(135deg, rgba(117, 102, 255, 0.05) 0%, transparent 100%) !important;
}

/* Proration Calculator styling */
#proration-calculator-widget {
    background-color: var(--muted) !important;
    border: 1px dashed var(--primary) !important;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 10px;
}
.proration-breakdown-details {
    border-bottom: 1px solid var(--border) !important;
}

/* Settings fields overrides */
#settings-customer-form .form-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(109, 93, 246, 0.15) !important;
    outline: none !important;
}
#premium-saas-dashboard-container.dark #settings-customer-form .form-input {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
#premium-saas-dashboard-container.dark #settings-customer-form .form-input:focus {
    border-color: #7566ff !important;
}


