/* ============================================
   SharePanel Tickets — TicketShare Glassmorphic Theme
   Premium Support Platform Design System
   ============================================ */

:root {
    /* Primary - Sky Blue */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;

    /* Secondary - Slate */
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;

    /* Accents */
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-purple-dark: #7c3aed;
    --accent-emerald: #10b981;
    --accent-emerald-light: #34d399;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fbbf24;
    --accent-rose: #f43f5e;
    --accent-rose-light: #fb7185;

    /* Semantic */
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    --info: #0284c7;
    --info-bg: rgba(2, 132, 199, 0.1);

    /* Layout */
    --sidebar-width-desktop: min(320px, 20vw);
    --navbar-height: 64px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
    color: var(--secondary-900);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Radial gradient overlays on body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

a:hover {
    color: var(--primary-700);
}

/* ---- Navbar ---- */
.navbar {
    background: var(--secondary-900);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-brand {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.85;
}

.nav-brand::before {
    content: '\f3c5';
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free';
    font-weight: 900;
    -webkit-text-fill-color: var(--primary-400);
    font-size: 1.1rem;
    display: none;
}

.nav-brand i {
    -webkit-text-fill-color: var(--primary-400);
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s var(--ease);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(139, 92, 246, 0.15));
    border-left-color: var(--primary-500);
}

.nav-agent {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    padding-left: 1rem;
    margin-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-agent::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    display: inline-block;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ---- Container ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 2rem;
    position: relative;
    z-index: 1;
}

.container-narrow {
    max-width: 640px;
}

/* ---- Page Headers ---- */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--secondary-900);
    line-height: 1.3;
}

.page-header p {
    color: var(--secondary-500);
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

/* ---- Glass Cards ---- */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--secondary-800);
}

/* ---- Stat Cards (Dashboard) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

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

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    font-size: 1.25rem;
}

.stat-card .stat-icon.open {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.15));
    color: var(--accent-emerald);
}

.stat-card .stat-icon.in-progress {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.15));
    color: var(--accent-amber);
}

.stat-card .stat-icon.resolved {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(2, 132, 199, 0.15));
    color: var(--primary-500);
}

.stat-card .stat-icon.closed {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1), rgba(71, 85, 105, 0.15));
    color: var(--secondary-500);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--secondary-500);
    margin-top: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Gradient stat cards (for homepage) */
.stat-card-gradient {
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    color: #fff;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card-gradient:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card-gradient.emerald {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card-gradient.amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card-gradient.sky {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.stat-card-gradient.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-card-gradient .stat-icon-white {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem auto;
    font-size: 1.25rem;
    backdrop-filter: blur(10px);
}

.stat-card-gradient .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card-gradient .stat-label {
    font-size: 0.8rem;
    margin-top: 0.4rem;
    opacity: 0.85;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-700);
    margin-bottom: 0.45rem;
}

.form-group label .required {
    color: var(--accent-rose);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid var(--secondary-200);
    border-radius: var(--border-radius);
    color: var(--secondary-900);
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
    transition: all 0.2s var(--ease);
    backdrop-filter: blur(10px);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15), var(--shadow);
    background: #fff;
}

input::placeholder, textarea::placeholder {
    color: var(--secondary-400);
}

textarea {
    min-height: 130px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.form-help {
    font-size: 0.8rem;
    color: var(--secondary-400);
    margin-top: 0.35rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

/* Ripple effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--ease), height 0.4s var(--ease);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--secondary-700);
    border-color: var(--secondary-200);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--secondary-50);
    border-color: var(--secondary-300);
    color: var(--secondary-900);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-rose), #e11d48);
    color: #fff;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald), var(--success));
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success), #047857);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--secondary-500);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-500);
    border-color: var(--primary-200);
}

.btn-ghost:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn i, .btn .fa, .btn .fas, .btn .far, .btn .fab {
    font-size: 0.85em;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 100px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Named status badges */
.badge-open {
    background: linear-gradient(135deg, var(--accent-emerald), #059669);
}

.badge-in-progress {
    background: linear-gradient(135deg, var(--accent-amber), #d97706);
}

.badge-resolved {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

.badge-closed {
    background: linear-gradient(135deg, var(--secondary-400), var(--secondary-500));
}

.badge-escalated {
    background: linear-gradient(135deg, var(--accent-rose), #e11d48);
}

.badge-on-hold {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-dark));
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(14, 165, 233, 0.08);
    color: var(--primary-700);
    border-radius: 100px;
    margin-right: 0.25rem;
    transition: all 0.2s;
}

.tag:hover {
    background: rgba(14, 165, 233, 0.15);
}

/* ---- Glass Tables ---- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-glass);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

th, td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.9rem;
}

th {
    background: rgba(241, 245, 249, 0.8);
    color: var(--secondary-500);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

tr:last-child td {
    border-bottom: none;
}

tr {
    transition: background 0.15s var(--ease);
}

tr:hover td {
    background: rgba(14, 165, 233, 0.03);
}

td code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    background: rgba(14, 165, 233, 0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    color: var(--primary-700);
    font-weight: 500;
}

td .subject-link {
    color: var(--secondary-800);
    font-weight: 600;
    transition: color 0.2s;
}

td .subject-link:hover {
    color: var(--primary-500);
}

td .meta {
    color: var(--secondary-400);
    font-size: 0.8rem;
}

/* ---- Ticket Thread ---- */
.thread {
    margin-top: 1.5rem;
}

.thread-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    padding: 1.35rem;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s var(--ease);
}

.thread-item:hover {
    box-shadow: var(--shadow);
}

.thread-item.agent {
    border-left: 3px solid var(--primary-500);
}

.thread-item.customer {
    border-left: 3px solid var(--accent-emerald);
}

.thread-item.system {
    border-left: 3px solid var(--secondary-400);
    background: rgba(241, 245, 249, 0.8);
}

.thread-item .thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.thread-item .thread-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary-800);
}

.thread-item .thread-role {
    font-size: 0.7rem;
    color: var(--secondary-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 0.5rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    font-weight: 600;
}

.thread-item .thread-time {
    font-size: 0.8rem;
    color: var(--secondary-400);
}

.thread-item .thread-body {
    color: var(--secondary-700);
    line-height: 1.75;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---- Ticket Sidebar ---- */
.ticket-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.ticket-sidebar .sidebar-section {
    margin-bottom: 1.25rem;
}

.ticket-sidebar .sidebar-section h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--secondary-400);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ticket-sidebar .sidebar-value {
    font-size: 0.95rem;
    color: var(--secondary-800);
    font-weight: 500;
}

/* ---- Filters Bar ---- */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: end;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

.filters-bar select, .filters-bar input {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
}

.filters-bar label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-500);
    font-weight: 600;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--secondary-200);
    border-radius: 8px;
    color: var(--secondary-500);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s var(--ease);
    backdrop-filter: blur(10px);
}

.pagination a:hover, .pagination a.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-color: var(--primary-500);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

/* ---- Flash Messages ---- */
.flash {
    padding: 0.85rem 1.15rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s var(--ease);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-success {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.flash-error {
    background: rgba(220, 38, 38, 0.08);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.flash-info {
    background: rgba(2, 132, 199, 0.08);
    color: var(--info);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.flash-warning {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* ---- Canned Response Picker ---- */
.canned-picker {
    margin-bottom: 0.75rem;
}

.canned-picker select {
    max-width: 300px;
}

/* ---- Login Page ---- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height) - 4rem);
}

.login-box {
    width: 100%;
    max-width: 440px;
}

.login-box h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--secondary-800), var(--primary-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .login-sub {
    text-align: center;
    color: var(--secondary-500);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-box .login-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

/* ---- Status Page ---- */
.status-lookup {
    text-align: center;
    max-width: 500px;
    margin: 4rem auto;
}

.status-lookup h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.status-lookup p {
    color: var(--secondary-500);
    margin-bottom: 1.5rem;
}

.ref-input {
    display: flex;
    gap: 0.5rem;
}

.ref-input input {
    flex: 1;
    text-align: center;
    font-size: 1.15rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ---- Install Page ---- */
.install-wrapper {
    max-width: 600px;
    margin: 3rem auto;
    text-align: center;
}

.install-wrapper h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.install-log {
    background: var(--secondary-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--accent-emerald);
    margin: 1.5rem 0;
}

.install-log .err {
    color: var(--accent-rose);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--secondary-400);
}

.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(14, 165, 233, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: var(--secondary-300);
    font-size: 1.5rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-500);
    font-weight: 600;
}

/* ---- Hero Section (Homepage) ---- */
.hero-section {
    text-align: center;
    padding: 2rem 0 1rem 0;
}

.hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--secondary-900), var(--primary-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--secondary-500);
    font-size: 1.1rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---- Quick Action Cards (Homepage) ---- */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 2rem 0;
}

.action-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 165, 233, 0.2);
}

.action-card:hover::before {
    opacity: 1;
}

.action-card .action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(139, 92, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: var(--primary-500);
    font-size: 1.35rem;
    transition: all 0.3s var(--ease);
}

.action-card:hover .action-icon {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-purple));
    color: #fff;
    transform: scale(1.05);
}

.action-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--secondary-800);
}

.action-card p {
    font-size: 0.85rem;
    color: var(--secondary-500);
    line-height: 1.5;
}

/* ---- Misc Utilities ---- */
.text-muted { color: var(--secondary-500); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ---- Footer ---- */
footer.site-footer {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--secondary-400);
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

footer.site-footer a {
    color: var(--primary-500);
    font-weight: 500;
}

footer.site-footer a:hover {
    color: var(--primary-700);
}

/* ---- Admin Tab Navigation ---- */
.tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 0.35rem;
    box-shadow: var(--shadow-sm);
}

.tab-nav a {
    flex: 1;
    padding: 0.65rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-500);
    border-radius: 10px;
    transition: all 0.2s var(--ease);
    text-decoration: none;
}

.tab-nav a:hover {
    color: var(--secondary-800);
    background: rgba(0, 0, 0, 0.03);
}

.tab-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-900);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-md);
    animation: tooltipIn 0.15s var(--ease);
}

@keyframes tooltipIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Mobile Overlay ---- */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.nav-overlay.active {
    display: block;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-inner {
        position: relative;
    }

    .mobile-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--secondary-900);
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1rem 2rem 1rem;
        gap: 0.25rem;
        z-index: 1001;
        transition: right 0.3s var(--ease);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        border-left: 3px solid transparent;
    }

    .nav-agent {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding: 0.75rem 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin-top: 0.5rem;
        padding-top: 1rem;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

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

    .ref-input {
        flex-direction: column;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem 0.65rem;
    }

    /* Agent/Canned two-column layouts */
    .admin-two-col {
        grid-template-columns: 1fr !important;
    }
}

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

    .hero-title {
        font-size: 1.5rem;
    }
}

/* ---- Utility: admin two-col layout ---- */
.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    align-items: start;
}

.admin-two-col-wide {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: start;
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ---- Selection ---- */
::selection {
    background: rgba(14, 165, 233, 0.15);
    color: var(--secondary-900);
}
