/* ============================================
   BENED Support — Dark Theme Styles
   support.bened.works
   ============================================ */

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

:root {
    --bg-deep: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
}
.nav-brand-icon { font-size: 20px; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav-link-muted { color: var(--text-muted); }
.nav-user {
    color: var(--text-muted);
    font-size: 13px;
    padding: 4px 10px;
    background: var(--bg-deep);
    border-radius: var(--radius);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Landing Page ── */
.landing { max-width: 900px; margin: 0 auto; padding: 24px; }
.hero {
    text-align: center;
    padding: 64px 0 48px;
}
.hero-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}
.hero h1 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-note { color: var(--text-muted); font-size: 14px; margin-top: 12px; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 48px 0;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}
.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

.apps-section { text-align: center; margin: 48px 0; }
.apps-section h2 { font-size: 24px; margin-bottom: 8px; }
.section-sub { color: var(--text-secondary); margin-bottom: 24px; }
.app-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.app-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.app-badge-icon { font-size: 16px; }

/* ── Page Layout ── */
.page { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-header p { color: var(--text-secondary); margin-top: 4px; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.card-header h3 { font-size: 16px; font-weight: 600; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group .hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 120px; resize: vertical; }
select { cursor: pointer; }
select option { background: var(--bg-card); color: var(--text-primary); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── File Upload ── */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.file-upload:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-upload.dragging { border-color: var(--accent); background: var(--accent-soft); }
.file-upload input[type="file"] { display: none; }
.file-upload-icon { font-size: 32px; margin-bottom: 8px; }
.file-upload-text { color: var(--text-secondary); font-size: 14px; }
.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-deep);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-top: 12px;
}
.file-preview-name { font-size: 14px; flex: 1; }
.file-preview-remove { color: var(--danger); cursor: pointer; font-size: 18px; }

/* ── Ticket List ── */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.ticket-row:hover { border-color: var(--accent); background: var(--bg-hover); text-decoration: none; }
.ticket-number {
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    min-width: 50px;
}
.ticket-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.ticket-meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.ticket-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* ── Ticket Detail ── */
.ticket-header-card { margin-bottom: 24px; }
.ticket-detail-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}
.ticket-detail-meta strong { color: var(--text-primary); }

.message-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.message.staff {
    border-left: 3px solid var(--accent);
    background: rgba(59, 130, 246, 0.05);
}
.message.system {
    background: var(--bg-deep);
    border: 1px dashed var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 10px;
}
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.message-author { font-weight: 600; font-size: 14px; }
.message-staff-badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}
.message-time { font-size: 12px; color: var(--text-muted); }
.message-body { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.message-body p { margin-bottom: 8px; }
.message-attachments { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 13px;
    color: var(--accent);
}

.reply-box { margin-top: 24px; }

/* ── Settings ── */
.settings-section { margin-bottom: 32px; }
.settings-section h2 { font-size: 20px; margin-bottom: 16px; }
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label h4 { font-size: 14px; font-weight: 600; }
.toggle-label p { font-size: 13px; color: var(--text-muted); }
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Empty States ── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 24px; }

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-info { background: var(--accent-soft); border: 1px solid rgba(59,130,246,0.3); color: var(--accent); }

/* ── Confirmation Page ── */
.confirmation {
    text-align: center;
    padding: 64px 24px;
}
.confirmation-icon { font-size: 64px; margin-bottom: 16px; }
.confirmation h1 { font-size: 28px; margin-bottom: 12px; }
.confirmation p { color: var(--text-secondary); max-width: 500px; margin: 0 auto 24px; }
.confirmation .ticket-number-display {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 24px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 24px;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 64px;
}
.site-footer a { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .hero h1 { font-size: 28px; }
    .hero-sub { font-size: 16px; }
    .features { grid-template-columns: 1fr; }
    .ticket-row { grid-template-columns: 1fr; gap: 8px; }
    .nav-links { gap: 8px; }
    .nav-link { padding: 4px 8px; font-size: 13px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-header { flex-direction: column; padding: 20px; }
    .admin-controls-grid { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 10px; }
    .stat-number { font-size: 24px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ADMIN STYLES                                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Nav admin link */
.nav-link-admin {
    color: var(--warning) !important;
    font-weight: 600;
    background: rgba(234,179,8,0.1);
    border-radius: var(--radius);
}
.nav-link-admin:hover { color: #fbbf24 !important; background: rgba(234,179,8,0.2); }

/* Admin Banner (on tickets page) */
.admin-banner {
    background: linear-gradient(135deg, rgba(234,179,8,0.12), rgba(234,179,8,0.05));
    border: 1px solid rgba(234,179,8,0.3);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 24px;
}
.admin-banner-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #eab308;
    font-size: 15px;
}

.btn-warning {
    background: linear-gradient(135deg, #eab308, #d97706);
    color: #000;
    font-weight: 600;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(234,179,8,0.3);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #facc15, #eab308);
    text-decoration: none;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234,179,8,0.4);
}

.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid var(--border);
}

.nav-role-badge { font-size: 12px; margin-left: 2px; }

/* ── Admin Page Layout ── */
.admin-page { max-width: 1200px; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    padding: 28px 32px;
    background: linear-gradient(135deg, rgba(234,179,8,0.08) 0%, rgba(59,130,246,0.06) 50%, rgba(139,92,246,0.06) 100%);
    border: 1px solid rgba(234,179,8,0.2);
    border-radius: var(--radius-lg);
}
.admin-header h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #eab308 0%, #f59e0b 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.admin-header p { color: var(--text-secondary); font-size: 15px; }

/* ── Stat Cards ── */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    text-align: center;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stat-card:nth-child(1)::before { background: var(--accent); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: var(--purple); }
.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-card:nth-child(1) .stat-number { color: var(--accent); }
.stat-card:nth-child(2) .stat-number { color: var(--success); }
.stat-card:nth-child(3) .stat-number { color: var(--warning); }
.stat-card:nth-child(4) .stat-number { color: var(--purple); }
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Admin Tabs ── */
.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
.admin-tab {
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-tab:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-hover);
    border-radius: var(--radius) var(--radius) 0 0;
}
.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(59,130,246,0.05);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Admin Filters ── */
.admin-filters {
    margin-bottom: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}
.admin-filter-form .filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { flex: 1; min-width: 160px; }
.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Quick Status Filters ── */
.admin-quick-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ── Admin Table ── */
.admin-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(15,23,42,0.5);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.admin-table th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.admin-table th:last-child { border-radius: 0 var(--radius-lg) 0 0; }
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
    vertical-align: middle;
}
.admin-table tbody tr {
    transition: background 0.15s;
}
.admin-table tbody tr:hover {
    background: rgba(59,130,246,0.04);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .mono {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 6px;
}
.admin-table .center { text-align: center; }
.admin-table .muted { color: var(--text-muted); font-size: 13px; }

.admin-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
    line-height: 1.4;
}
.admin-link:hover { color: var(--accent); text-decoration: none; }

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.admin-actions {
    display: flex;
    gap: 6px;
}
.admin-actions .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.admin-actions .btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* ── Admin Pagination ── */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
}
.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-card);
    padding: 6px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* ── Role Badges ── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}
.role-super-admin {
    background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(234,179,8,0.1));
    color: #fbbf24;
    border: 1px solid rgba(234,179,8,0.3);
}
.role-admin {
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(59,130,246,0.1));
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}
.role-user {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ── Priority Badges ── */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.priority-urgent {
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.1));
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.3);
    animation: pulse-urgent 2s infinite;
}
@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
.priority-high {
    background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(249,115,22,0.1));
    color: #fb923c;
    border: 1px solid rgba(249,115,22,0.3);
}
.priority-normal {
    background: rgba(59,130,246,0.1);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.2);
}
.priority-low {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ── Role Select ── */
.role-select {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s;
}
.role-select:hover { border-color: var(--accent); }
.role-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* ── Admin Ticket Controls (on ticket detail page) ── */
.admin-ticket-controls {
    border-left: 3px solid #eab308;
    background: linear-gradient(135deg, rgba(234,179,8,0.05), transparent);
}
.admin-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(234,179,8,0.15);
}
.admin-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: flex-end;
}

/* ── Admin Ticket Row Status Accent ── */
.admin-table tbody tr[data-priority="urgent"] {
    border-left: 3px solid var(--danger);
}
.admin-table tbody tr[data-priority="high"] {
    border-left: 3px solid #f97316;
}

/* Avatar Placeholder */
.admin-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* App Badge Small */
.app-badge-sm {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(139,92,246,0.1);
    color: var(--purple);
    border: 1px solid rgba(139,92,246,0.2);
    white-space: nowrap;
}

/* Message Count Badge */
.msg-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
    border-radius: 12px;
    background: var(--bg-deep);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* AGREEMENT PAGE STYLES                                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

.agree-container { max-width: 720px; margin: 0 auto; }

.agree-header {
    text-align: center;
    margin-bottom: 32px;
}
.agree-icon { font-size: 48px; margin-bottom: 12px; }
.agree-header h1 { font-size: 28px; margin-bottom: 8px; }
.agree-header p { color: var(--text-secondary); font-size: 16px; }

.agree-document { margin-bottom: 20px; }
.agree-document h2 { font-size: 18px; margin-bottom: 12px; }

.legal-scroll {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--bg-deep);
}
.legal-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
}

.agree-form-card { margin-top: 24px; }

.agree-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 15px;
}
.agree-checkbox:last-of-type { border-bottom: none; }
.agree-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.agree-submit { text-align: center; margin-top: 24px; }
.agree-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 12px auto 0;
    line-height: 1.5;
}

/* ── Modal Overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.modal-content {
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content h3 { margin-bottom: 16px; }

/* ── Submit Loading State ── */
@keyframes spin { to { transform: rotate(360deg); } }

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-spinner .spinner-arc {
    animation: spin 0.7s linear infinite;
    transform-origin: center;
}

.submit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.82);
    backdrop-filter: blur(3px);
    border-radius: var(--radius, 12px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}
.submit-overlay-inner { padding: 32px; }
.submit-overlay-spinner .spinner-arc {
    animation: spin 0.8s linear infinite;
    transform-origin: center;
}
.submit-overlay-inner p {
    margin-top: 16px;
    font-size: 1.05rem;
    color: var(--text, #eee);
}
.submit-overlay-inner .hint {
    font-size: 0.85rem;
    margin-top: 6px;
    color: var(--text-muted, #888);
}
