/* =========================================
   FlashFix Support Ticket Platform
   Complete Theme Stylesheet
   ========================================= */

/* ── Google Fonts ───────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables (Dark Theme Default) ─── */
:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --secondary: #60A5FA;
    --accent: #06B6D4;
    --accent-light: #22D3EE;

    --bg-base: #0B1120;
    --bg-surface: #1E293B;
    --bg-surface-2: #0F1A2E;
    --bg-elevated: #253349;

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --text-soft: #64748B;

    --border-100: #1E293B;
    --border-200: #334155;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #8B5CF6;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;

    --shadow-sm: 0 2px 8px -2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px -4px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px -8px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(37,99,235,0.3);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: 150ms ease;
    --transition-slow: 300ms ease;
}

/* ── Light Theme Override ──────────────── */
[data-theme="light"] {
    --primary: #2563EB;
    --primary-light: #2563EB;
    --secondary: #3B82F6;
    --accent: #0891B2;
    --accent-light: #0891B2;

    --bg-base: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #F1F5F9;
    --bg-elevated: #E2E8F0;

    --text-main: #0F172A;
    --text-muted: #475569;
    --text-soft: #94A3B8;

    --border-100: #E2E8F0;
    --border-200: #CBD5E1;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(37,99,235,0.15);
}

[data-theme="light"] .admin-topbar {
    background: rgba(255,255,255,0.85);
}

[data-theme="light"] .navbar {
    background: rgba(255,255,255,0.9);
}

[data-theme="light"] .sidebar-overlay {
    background: rgba(0,0,0,0.3);
}

[data-theme="light"] .login-page::before {
    background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
}

[data-theme="light"] .login-page::after {
    background: radial-gradient(circle, rgba(6,182,212,0.06), transparent 70%);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(37,99,235,0.04);
}

[data-theme="light"] .sidebar-nav a:hover {
    background: rgba(37,99,235,0.06);
}

[data-theme="light"] .sidebar-nav a.active {
    background: rgba(37,99,235,0.1);
}

/* Theme toggle button */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1e293b; /* Explicit dark for default (dark mode) */
    border: 1px solid #334155;
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.theme-toggle-btn:hover {
    background: #334155;
    border-color: #3b82f6;
    color: #3b82f6;
}

[data-theme="light"] .theme-toggle-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.theme-toggle-btn svg {
    pointer-events: none;
    stroke: currentColor;
}

.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon { display: none; }

/* Dark mode: show sun icon */
.theme-toggle-btn .icon-sun { display: block; }
.theme-toggle-btn .icon-moon { display: none; }

/* Light mode: show moon icon */
[data-theme="light"] .theme-toggle-btn .icon-sun { display: none; }
[data-theme="light"] .theme-toggle-btn .icon-moon { display: block; }

/* ── Reset ──────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, select, textarea, button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* ── Layout ─────────────────────────────── */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm { max-width: 500px; margin: 0 auto; padding: 0 20px; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 20px; }

.main-content {
    flex: 1;
    padding: 32px 0;
}

/* ── Header / Navbar ────────────────────── */
.navbar {
    background: rgba(11,17,32,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-100);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand .accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand .sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-soft);
    border-left: 1px solid var(--border-200);
    padding-left: 10px;
    margin-left: 4px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-100);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-muted);
}

.navbar-user .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* ── Cards ──────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-200);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2, .card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-100);
}

/* ── Stat Cards ─────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-100);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
    border-color: var(--border-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 18px;
}

.stat-card .stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--primary-light); }
.stat-card .stat-icon.yellow { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-card .stat-icon.green { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-card .stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--info); }
.stat-card .stat-icon.red { background: rgba(239,68,68,0.15); color: var(--danger); }
.stat-card .stat-icon.cyan { background: rgba(6,182,212,0.15); color: var(--accent); }

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-soft);
    font-weight: 500;
}

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px -3px rgba(37,99,235,0.4);
}
.btn-primary:hover {
    box-shadow: 0 6px 25px -3px rgba(37,99,235,0.5);
    opacity: 0.92;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-200);
}
.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--primary-light);
}
.btn-ghost:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px -3px rgba(239,68,68,0.4);
}

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    opacity: 0.9;
}

.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ── Form Elements ──────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-100);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    transition: all var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-control::placeholder { color: var(--text-soft); }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select.form-control option {
    background: var(--bg-surface);
    color: var(--text-main);
}

/* ── Priority Selector (Radio Cards) ───── */
.priority-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.priority-option {
    position: relative;
}

.priority-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.priority-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-base);
    border: 2px solid var(--border-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition);
}

.priority-option label:hover { border-color: var(--border-200); }

.priority-option input:checked + label.p-low { border-color: var(--success); background: rgba(16,185,129,0.08); color: var(--success); }
.priority-option input:checked + label.p-medium { border-color: var(--primary-light); background: rgba(59,130,246,0.08); color: var(--primary-light); }
.priority-option input:checked + label.p-high { border-color: var(--warning); background: rgba(245,158,11,0.08); color: var(--warning); }
.priority-option input:checked + label.p-critical { border-color: var(--danger); background: rgba(239,68,68,0.08); color: var(--danger); }

.priority-option .p-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.p-low .p-dot { background: var(--success); }
.p-medium .p-dot { background: var(--primary-light); }
.p-high .p-dot { background: var(--warning); }
.p-critical .p-dot { background: var(--danger); }

/* ── Badges ─────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-open { background: rgba(59,130,246,0.15); color: #60A5FA; }
.badge-progress { background: rgba(245,158,11,0.15); color: #FBBF24; }
.badge-waiting { background: rgba(139,92,246,0.15); color: #A78BFA; }
.badge-resolved { background: rgba(16,185,129,0.15); color: #34D399; }
.badge-closed { background: rgba(100,116,139,0.15); color: #94A3B8; }

.priority-low { background: rgba(16,185,129,0.12); color: #34D399; }
.priority-medium { background: rgba(59,130,246,0.12); color: #60A5FA; }
.priority-high { background: rgba(245,158,11,0.12); color: #FBBF24; }
.priority-critical { background: rgba(239,68,68,0.12); color: #F87171; }

/* ── Tables ─────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-100);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-100);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(59,130,246,0.04);
}

.data-table .case-link {
    color: var(--accent-light);
    font-weight: 700;
    font-size: 13px;
}

.data-table .case-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.data-table .subject-text {
    font-weight: 500;
    color: var(--text-main);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Ticket Conversation Thread ─────────── */
.thread { display: flex; flex-direction: column; gap: 16px; }

.thread-message {
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    position: relative;
}

.thread-message.from-customer {
    background: var(--bg-base);
    border: 1px solid var(--border-100);
    margin-right: 40px;
}

.thread-message.from-admin {
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.2);
    margin-left: 40px;
}

.thread-message .msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.thread-message .msg-sender {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-message .msg-sender .sender-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
}

.from-customer .sender-badge { background: rgba(6,182,212,0.15); color: var(--accent-light); }
.from-admin .sender-badge { background: rgba(59,130,246,0.15); color: var(--primary-light); }

.thread-message .msg-time {
    font-size: 11px;
    color: var(--text-soft);
}

.thread-message .msg-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Ticket Detail Sidebar ──────────────── */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

.ticket-sidebar .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-100);
}

.ticket-sidebar .info-row:last-child { border-bottom: none; }

.ticket-sidebar .info-label {
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 500;
}

.ticket-sidebar .info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* ── Login Page ─────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.15), transparent 70%);
    top: -100px;
    right: -100px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6,182,212,0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-100);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    margin: 20px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
}

.login-logo p {
    font-size: 14px;
    color: var(--text-soft);
    margin-top: 8px;
}

/* Email sent confirmation */
.email-sent-icon {
    width: 80px; height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
    50% { box-shadow: 0 0 0 15px rgba(37,99,235,0); }
}

/* ── Empty State ────────────────────────── */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-soft);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-soft);
    margin-bottom: 24px;
}

/* ── Toast Notifications ────────────────── */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.4s ease, fadeOut 0.4s ease 4s forwards;
    box-shadow: var(--shadow-lg);
}

.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; pointer-events: none; }
}

/* ── Footer ─────────────────────────────── */
.footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-100);
    text-align: center;
    font-size: 12px;
    color: var(--text-soft);
    margin-top: auto;
}

.footer a {
    color: var(--primary-light);
    transition: color var(--transition);
}

.footer a:hover { color: var(--accent-light); }

/* ── Pagination ─────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-100);
    color: var(--text-muted);
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Filters Bar ────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filters-bar .form-control {
    width: auto;
    min-width: 150px;
    padding: 8px 14px;
    font-size: 13px;
}

.filters-bar .search-input {
    flex: 1;
    min-width: 200px;
}

/* ── Admin Sidebar Layout ───────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-100);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: transform var(--transition-slow);
}

.admin-sidebar .sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-100);
}

.admin-sidebar .sidebar-brand h2 {
    font-size: 18px;
    font-weight: 800;
}

.admin-sidebar .sidebar-brand .accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-sidebar .sidebar-brand small {
    display: block;
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 4px;
    font-weight: 500;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
    margin-bottom: 4px;
}

.sidebar-nav a:hover {
    background: rgba(59,130,246,0.08);
    color: var(--text-main);
}

.sidebar-nav a.active {
    background: rgba(59,130,246,0.12);
    color: var(--primary-light);
    font-weight: 600;
}

.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav .nav-section {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 16px 8px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-100);
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11,17,32,0.6);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-topbar h1 {
    font-size: 18px;
    font-weight: 700;
}

.admin-content {
    flex: 1;
    padding: 28px 32px;
}

/* ── Utility Classes ────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-accent { color: var(--accent-light); }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-top: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none; }

/* ── Page Title ─────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 800;
}

.page-header .subtitle {
    font-size: 14px;
    color: var(--text-soft);
    margin-top: 4px;
    font-weight: 400;
}

/* ── Gradient Accent Bar ────────────────── */
.gradient-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    width: 48px;
    margin-bottom: 12px;
}

/* ── Mobile Menu Toggle ─────────────────── */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 45;
}

/* ── Animations ─────────────────────────── */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

.fade-in-up:nth-child(1) { animation-delay: 0s; }
.fade-in-up:nth-child(2) { animation-delay: 0.05s; }
.fade-in-up:nth-child(3) { animation-delay: 0.1s; }
.fade-in-up:nth-child(4) { animation-delay: 0.15s; }
.fade-in-up:nth-child(5) { animation-delay: 0.2s; }
.fade-in-up:nth-child(6) { animation-delay: 0.25s; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open { display: block; }

    .admin-main { margin-left: 0; }

    .mobile-menu-toggle { display: block; }

    .ticket-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-content { padding: 20px 16px; }
    .admin-topbar { padding: 0 16px; }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .priority-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar .form-control {
        width: 100%;
        min-width: auto;
    }

    .page-header { flex-direction: column; align-items: flex-start; }

    .thread-message.from-admin { margin-left: 16px; }
    .thread-message.from-customer { margin-right: 16px; }

    .data-table td, .data-table th { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card { padding: 28px 20px; margin: 12px; }

    .container { padding: 0 16px; }
}
