/* -------------------------------------------------------------
 * VNeID Style Sheet - Desktop & General Admin styling
 * ------------------------------------------------------------- */

:root {
    --primary-color: #a11a1a;
    --primary-dark: #7a1212;
    --primary-light: #fff5f5;
    --accent-color: #f59e0b;
    --accent-dark: #d97706;
    --success-color: #10b981;
    --success-dark: #047857;
    --danger-color: #ef4444;
    --danger-dark: #b91c1c;
    --bg-main: #f8f9fa;
    --bg-panel: #ffffff;
    --border-color: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================================
 * HEADER
 * ===================================================================== */
.admin-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, #3e0505 100%);
    color: white;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--accent-color);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    width: 48px;
    height: 48px;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-titles h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-color);
}

.header-titles h2 {
    font-size: 0.85rem;
    font-weight: 400;
    color: #f1f3f5;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--primary-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.7rem;
    opacity: 0.8;
}

.user-profile-button {
    appearance: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 10px;
}

.user-profile-button:hover,
.user-profile-button:focus-visible {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.22);
    outline: none;
}

.officer-actions { display:flex; gap:6px; flex-wrap:wrap; }
.account-status { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.72rem; font-weight:750; white-space:nowrap; }
.account-status.active { color:#166534; background:#dcfce7; border:1px solid #bbf7d0; }
.account-status.locked { color:#991b1b; background:#fee2e2; border:1px solid #fecaca; }
.account-active-toggle { display:flex; align-items:center; gap:9px; cursor:pointer; }
.account-active-toggle input { width:18px; height:18px; accent-color:var(--accent-color); }

.admin-profile-page-header { display:flex; align-items:center; justify-content:space-between; }
.admin-profile-page-card { max-width:1040px; overflow:hidden; border:1px solid #e2e8f0; box-shadow:0 14px 34px rgba(15,23,42,.08); }
.admin-profile-body { display:grid; grid-template-columns:260px minmax(0,1fr); gap:28px; padding:28px !important; background:linear-gradient(145deg,#fff 0%,#f8fafc 100%); }
.admin-profile-identity { position:sticky; top:20px; display:flex; flex-direction:column; align-items:center; align-self:start; padding:34px 22px; text-align:center; color:white; border-radius:18px; background:linear-gradient(145deg,#991b1b,#450a0a); box-shadow:0 16px 34px rgba(127,29,29,.24); overflow:hidden; }
.admin-profile-identity::before { content:""; position:absolute; width:190px; height:190px; top:-105px; right:-85px; border-radius:50%; background:rgba(251,191,36,.16); }
.admin-profile-avatar { display:grid; place-items:center; width:82px; height:82px; margin-bottom:14px; color:#7f1d1d; background:#fff; border:4px solid #fbbf24; border-radius:50%; font-size:1.45rem; font-weight:850; }
.admin-profile-identity strong { font-size:1.05rem; }
.admin-profile-identity span { margin-top:5px; color:#fde68a; font-size:.78rem; }
.admin-profile-identity small { margin-top:12px; padding:5px 9px; background:rgba(255,255,255,.1); border-radius:999px; }
.admin-profile-security-badge { margin-top:24px; padding:9px 11px; color:#dcfce7; background:rgba(22,163,74,.2); border:1px solid rgba(134,239,172,.28); border-radius:9px; font-size:.7rem; font-weight:700; }
.admin-profile-forms { display:flex; flex-direction:column; gap:18px; }
.admin-profile-forms form { padding:22px; border:1px solid #e2e8f0; border-radius:14px; background:#fff; box-shadow:0 5px 16px rgba(15,23,42,.04); }
.profile-form-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; padding-bottom:14px; border-bottom:1px solid #e2e8f0; }
.profile-form-heading span { display:block; margin-bottom:4px; color:#b91c1c; font-size:.65rem; font-weight:850; letter-spacing:1.2px; }
.profile-form-heading h3 { margin:0; color:#1e293b; font-size:1rem; }
.profile-form-note { margin:-4px 0 16px; padding:10px 12px; color:#475569; background:#f8fafc; border-left:3px solid #f59e0b; border-radius:6px; font-size:.76rem; line-height:1.5; }
.profile-details-grid { gap:18px; }
.profile-field { min-width:0; margin:0; }
.profile-field > label { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px; color:#334155; font-size:.76rem; font-weight:800; }
.profile-required { padding:3px 7px; color:#991b1b; background:#fef2f2; border:1px solid #fecaca; border-radius:999px; font-size:.55rem; font-weight:800; letter-spacing:.25px; text-transform:uppercase; }
.profile-input-wrap { position:relative; display:flex; align-items:center; min-height:50px; overflow:hidden; background:#f8fafc; border:1.5px solid #dbe3ee; border-radius:11px; transition:border-color .18s ease,box-shadow .18s ease,background .18s ease; }
.profile-input-wrap > svg { position:absolute; left:14px; width:19px; height:19px; fill:#94a3b8; pointer-events:none; transition:fill .18s ease; }
.profile-input-wrap > input { width:100% !important; min-width:0; height:50px; padding:0 14px 0 44px !important; color:#0f172a; background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; font-size:.82rem; font-weight:650; outline:0 !important; }
.profile-input-wrap > input::placeholder { color:#94a3b8; font-weight:450; }
.profile-input-wrap:hover { border-color:#c0cad8; background:#fff; }
.profile-input-wrap:focus-within { background:#fff; border-color:#b91c1c; box-shadow:0 0 0 4px rgba(185,28,28,.1); }
.profile-input-wrap:focus-within > svg { fill:#b91c1c; }
.profile-field > small { display:block; margin-top:6px; color:#64748b; font-size:.64rem; line-height:1.35; }

.dashboard-background-shortcut { width:100%; display:flex; align-items:center; gap:14px; margin:0 0 1.5rem; padding:15px 18px; color:#1e293b; text-align:left; background:linear-gradient(110deg,#fff7ed,#fff); border:1px solid #fed7aa; border-radius:14px; cursor:pointer; box-shadow:0 7px 18px rgba(124,45,18,.06); transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease; }
.dashboard-background-shortcut:hover { transform:translateY(-2px); border-color:#f59e0b; box-shadow:0 12px 24px rgba(124,45,18,.11); }
.dashboard-background-shortcut-icon { display:grid; place-items:center; width:44px; height:44px; flex:0 0 44px; color:#fff; background:linear-gradient(145deg,#b91c1c,#7f1d1d); border-radius:12px; }
.dashboard-background-shortcut-icon svg { width:23px; height:23px; fill:currentColor; }
.dashboard-background-shortcut > span:nth-child(2) { display:flex; flex:1; flex-direction:column; gap:3px; }
.dashboard-background-shortcut strong { font-size:.84rem; }
.dashboard-background-shortcut small { color:#64748b; font-size:.7rem; }
.dashboard-background-shortcut-arrow { color:#b91c1c; font-size:1.25rem; font-weight:800; }

.guest-bg-status { padding:6px 10px; color:#475569; background:#f1f5f9; border:1px solid #e2e8f0; border-radius:999px; font-size:.68rem; font-weight:800; }
.guest-bg-status.active { color:#166534; background:#dcfce7; border-color:#bbf7d0; }
.guest-bg-editor-grid { display:grid; grid-template-columns:minmax(300px,390px) minmax(420px,1fr); gap:20px; align-items:start; max-width:1120px; }
.guest-bg-settings-card,.guest-bg-preview-card { overflow:hidden; border:1px solid #e2e8f0; }
.guest-bg-settings-card .card-header,.guest-bg-preview-card .card-header { display:flex; align-items:center; justify-content:space-between; padding:15px 18px; background:#f8fafc; border-bottom:1px solid #e2e8f0; }
.guest-bg-settings-card .card-header h3,.guest-bg-preview-card .card-header h3 { margin:0; color:#1e293b; font-size:.9rem; }
.guest-bg-preview-card .card-header span { color:#b91c1c; font-size:.66rem; font-weight:800; text-transform:uppercase; }
.guest-bg-settings-card .card-body { padding:18px; }
.guest-bg-dropzone { display:flex; flex-direction:column; align-items:center; padding:22px 16px; text-align:center; background:#fffaf5; border:1.5px dashed #f59e0b; border-radius:13px; cursor:pointer; transition:background .18s ease,border-color .18s ease; }
.guest-bg-dropzone:hover { background:#fff7ed; border-color:#b91c1c; }
.guest-bg-dropzone input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.guest-bg-dropzone-icon { display:grid; place-items:center; width:42px; height:42px; margin-bottom:9px; color:#fff; background:#b91c1c; border-radius:50%; font-size:1.3rem; }
.guest-bg-dropzone strong { color:#1e293b; font-size:.8rem; }
.guest-bg-dropzone small { margin-top:5px; color:#64748b; font-size:.62rem; line-height:1.45; }
.guest-bg-dropzone em { max-width:100%; margin-top:10px; padding:5px 8px; overflow:hidden; color:#9a3412; background:#ffedd5; border-radius:6px; font-size:.63rem; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
.guest-bg-control { margin-top:18px; }
.guest-bg-control > div { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.guest-bg-control label { color:#334155; font-size:.73rem; font-weight:800; }
.guest-bg-control output { color:#b91c1c; font-size:.7rem; font-weight:800; }
.guest-bg-control input[type=range] { width:100%; accent-color:#b91c1c; }
.guest-bg-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:20px; }
.guest-bg-preview-card { padding-bottom:14px; }
.guest-bg-preview { position:relative; aspect-ratio:16/10; margin:18px; overflow:hidden; background:linear-gradient(145deg,#b91c1c,#450a0a); border:1px solid #dbe3ee; border-radius:16px; box-shadow:0 12px 30px rgba(15,23,42,.14); }
.guest-bg-preview-media,.guest-bg-preview-overlay { position:absolute; inset:-14px; }
.guest-bg-preview-media img,.guest-bg-preview-media video { width:100%; height:100%; object-fit:cover; }
.guest-bg-preview-overlay { z-index:1; background:rgba(39,7,7,.58); }
.guest-bg-preview-content { position:relative; z-index:2; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px; color:#fff; text-align:center; }
.guest-bg-preview-content > img { width:55px; height:55px; margin-bottom:10px; object-fit:contain; filter:drop-shadow(0 3px 7px rgba(0,0,0,.35)); }
.guest-bg-preview-content > strong { color:#fbbf24; font-size:.84rem; letter-spacing:.4px; }
.guest-bg-preview-content > span { margin-top:4px; font-size:.57rem; letter-spacing:1px; }
.guest-bg-preview-content > div { width:min(260px,80%); display:flex; flex-direction:column; margin-top:18px; padding:14px; color:#1e293b; background:rgba(255,255,255,.94); border:1px solid rgba(251,191,36,.7); border-radius:12px; box-shadow:0 8px 20px rgba(0,0,0,.18); }
.guest-bg-preview-content b { font-size:.66rem; text-transform:uppercase; }
.guest-bg-preview-content small { margin-top:4px; color:#64748b; font-size:.55rem; }
.guest-bg-preview-note { margin:0 18px; color:#64748b; font-size:.65rem; line-height:1.45; }

@media (max-width: 760px) {
    .admin-profile-body { grid-template-columns:1fr; }
    .admin-profile-identity { position:static; padding:20px; }
    .profile-form-heading { align-items:flex-start; flex-direction:column; }
    .profile-details-grid { grid-template-columns:1fr; }
    .guest-bg-editor-grid { grid-template-columns:1fr; }
    .guest-bg-actions { grid-template-columns:1fr; }
}

@media (max-width: 1050px) {
    .guest-bg-editor-grid { grid-template-columns:1fr; }
}

.btn-back-home {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-back-home:hover {
    background: rgba(255,255,255,0.25);
    color: var(--accent-color);
}

/* =====================================================================
 * APP CONTAINER LAYOUT
 * ===================================================================== */
.admin-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SIDEBAR */
.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #3a0000 0%, #1c0000 100%);
    border-right: 2px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 0.8rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow-y: auto;
}

/* =====================================================================
 * CUSTOM DELEGATE CARD DESIGNER
 * ===================================================================== */
.card-template-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.card-template-library {
    position: sticky;
    top: 0;
    overflow: hidden;
}

.card-template-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 1rem;
    max-height: calc(100vh - 245px);
    overflow-y: auto;
}

.card-template-list-empty,
.card-template-assignment-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.card-template-list-item {
    width: 100%;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.card-template-list-item:hover,
.card-template-list-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(122, 18, 18, .1);
    transform: translateY(-1px);
}

.card-template-list-thumb {
    width: 54px;
    height: 68px;
    object-fit: cover;
    border-radius: 7px;
    background: #f3f4f6;
}

.card-template-list-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.card-template-list-copy strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .86rem;
}

.card-template-list-copy small {
    color: var(--text-muted);
    font-size: .7rem;
}

.card-template-list-actions {
    display: flex;
    gap: 6px;
    margin-top: 3px;
}

.card-template-list-actions span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: .69rem;
}

.card-template-list-actions button {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--danger-dark);
    cursor: pointer;
    font-size: .69rem;
    font-weight: 700;
}

.card-template-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.card-template-editor-grid {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(300px, 1fr);
    gap: 1.5rem;
    padding: 1.25rem;
}

.card-template-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-template-controls input[type="text"],
.card-template-controls input:not([type]) {
    width: 100%;
}

.card-template-slider-group label,
.card-template-preview-label,
.card-template-target-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-template-slider-group label {
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.card-template-slider-group output {
    color: var(--primary-color);
    font-family: monospace;
}

.card-template-slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

.card-template-help {
    padding: 10px 12px;
    border-left: 3px solid var(--accent-color);
    border-radius: 5px;
    background: #fffbeb;
    color: #7c5b15;
    font-size: .75rem;
    line-height: 1.5;
}

.card-template-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: .25rem;
}

.card-template-preview-column {
    min-width: 0;
}

.card-template-preview-label {
    margin-bottom: 8px;
}

.card-template-preview-label span {
    font-size: .82rem;
    font-weight: 700;
}

.card-template-preview-label small {
    color: var(--text-muted);
    font-size: .7rem;
}

.card-template-stage {
    position: relative;
    width: min(100%, 540px);
    margin: 0 auto;
    aspect-ratio: 1000 / 1450;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid #d6d9de;
    background-color: #eef0f3;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 12px 30px rgba(26, 26, 26, .1);
    touch-action: none;
}

.card-template-stage > #card-template-background {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
}

.card-template-stage.empty > #card-template-background,
.card-template-stage.empty .card-template-qr-overlay {
    display: none;
}

.card-template-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    background-image: linear-gradient(45deg, #e4e7eb 25%, transparent 25%), linear-gradient(-45deg, #e4e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4e7eb 75%), linear-gradient(-45deg, transparent 75%, #e4e7eb 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.card-template-stage:not(.empty) .card-template-empty-state {
    display: none;
}

.card-template-qr-overlay {
    position: absolute;
    left: 30%;
    top: 30%;
    width: 40%;
    aspect-ratio: 1;
    cursor: grab;
    border: 2px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 4px 18px rgba(0,0,0,.24);
    background: #fff;
    user-select: none;
}

.card-template-qr-overlay:active {
    cursor: grabbing;
}

.card-template-qr-overlay img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.card-template-resize-handle {
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #2563eb;
    cursor: nwse-resize;
}

.card-template-assignment-grid {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr);
    gap: 1rem;
    padding: 1.25rem;
}

.card-template-target-box {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.card-template-target-header {
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.card-template-target-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-template-target-header small {
    color: var(--text-muted);
    font-size: .68rem;
}

.card-template-target-header button {
    border: 0;
    background: transparent;
    color: var(--primary-color);
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
}

.card-template-target-search {
    width: calc(100% - 20px);
    margin: 10px 10px 0;
}

.card-template-target-list {
    max-height: 270px;
    overflow-y: auto;
    padding: 6px 10px 10px;
}

.card-template-target-list.tall {
    max-height: 330px;
}

.card-template-target-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 4px;
    border-bottom: 1px dashed #e5e7eb;
    cursor: pointer;
}

.card-template-target-item:last-child {
    border-bottom: 0;
}

.card-template-target-item input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.card-template-target-item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: .78rem;
}

.card-template-target-item small {
    color: var(--text-muted);
    font-size: .68rem;
    margin-top: 2px;
}

@media (max-width: 1180px) {
    .card-template-editor-grid,
    .card-template-assignment-grid {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/image/heritage-pattern.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80%;
    opacity: 0.02;
    pointer-events: none;
    z-index: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: none;
    background: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #f1f5f9;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    gap: 12px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--accent-color);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-weight: 700;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.scanner-nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}
.scanner-nav-item.active:hover {
    background: var(--primary-dark);
    color: white;
}

.animate-pulse-svg {
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); }
}

.sidebar-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--accent-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

/* MAIN CONTENT */
.admin-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-main);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* =====================================================================
 * PANELS & CARDS
 * ===================================================================== */
.panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-body {
    padding: 1.5rem;
}

/* DASHBOARD STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    right: -15px;
    bottom: -15px;
    width: 90px;
    height: 90px;
    background-image: url('/image/heritage-pattern.svg');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.08;
    pointer-events: none;
}

.bg-red-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7a1212 100%);
}

.bg-gold-gradient {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-color) 100%);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.9;
}

.stat-header h3 {
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* DASHBOARD PROGRESS LIST */
.catalog-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.catalog-stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.catalog-stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.catalog-stat-bar-bg {
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.catalog-stat-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 1s ease-out;
}

/* =====================================================================
 * TABLES
 * ===================================================================== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th {
    background-color: #fafbfc;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.2rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: #fcfdfe;
}

.text-center {
    text-align: center;
}

.font-mono {
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =====================================================================
 * FILTER BAR
 * ===================================================================== */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

.search-box {
    position: relative;
    flex: 2;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: white;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Cấu hình chung cho Select (sẽ được ghi đè ở phần Form bên dưới để đồng bộ) */
select {
    outline: none;
}

/* =====================================================================
 * BUTTONS
 * ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-dark);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.catalog-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #e2e8f0;
    color: var(--text-secondary);
}

.catalog-badge.badge-v {
    background-color: #fef3c7;
    color: var(--accent-dark);
    border: 1px solid #fde68a;
}

.catalog-badge.badge-nn {
    background-color: #fee2e2;
    color: var(--primary-color);
    border: 1px solid #fca5a5;
}

.catalog-badge.badge-bc {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

/* =====================================================================
 * MODAL OVERLAY
 * ===================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeInModal 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm {
    max-width: 420px;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-main);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #374151;
}

.required {
    color: var(--danger-color);
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #1f2937;
    background-color: #f8fafc;
    outline: none;
    cursor: text;
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

select {
    cursor: pointer;
}

input[type="text"]:hover,
input[type="date"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
select:hover,
textarea:hover {
    border-color: #9ca3af;
    background-color: #f1f5f9;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(161, 26, 26, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

/* =====================================================================
 * SCANNER LAYOUT & COMPONENTS
 * ===================================================================== */
.scanner-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

.scanner-panel {
    min-height: 450px;
}

.flex-center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#reader-wrapper {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1;
    border: 3px dashed var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #000;
    margin-bottom: 1.5rem;
}

#reader {
    width: 100%;
    height: 100%;
}

/* Ẩn các nút điều khiển mặc định của thư viện html5-qrcode */
#reader button, #reader select {
    display: none !important;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    justify-content: center;
}

.divider-text {
    width: 100%;
    max-width: 380px;
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background-color: var(--border-color);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

.file-scan-area {
    width: 100%;
    max-width: 380px;
    display: flex;
    justify-content: center;
}

.result-panel {
    min-height: 450px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.result-placeholder p {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
}

.result-placeholder span {
    font-size: 0.8rem;
}

/* =====================================================================
 * VNEID PREMIUM CHECK-IN CARD
 * ===================================================================== */
.vneid-card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 2px solid var(--success-color);
    overflow: hidden;
    animation: slideUpIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vneid-card.card-failed {
    border-color: var(--danger-color);
}

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

.vneid-card-header {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success-color) 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vneid-card-header.bg-danger {
    background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger-color) 100%);
}

.badge-emblem {
    background-color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.vneid-card-title h4 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.vneid-card-title span {
    font-size: 0.65rem;
    opacity: 0.9;
    letter-spacing: 0.2px;
    display: block;
}

.vneid-card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vneid-avatar-box {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.vneid-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffc107;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.vneid-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.vneid-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vneid-field.full-width {
    grid-column: 1 / -1;
}

.vneid-field label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

.vneid-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vneid-value.highlight-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}

.vneid-card-footer {
    background-color: var(--bg-main);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: center;
}

.verified-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* =====================================================================
 * TICKET CARD (IN VÉ)
 * ===================================================================== */
.vneid-ticket-card {
    background: linear-gradient(185deg, #a11a1a 0%, #680d0d 100%);
    color: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 320px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--accent-color);
    position: relative;
}

.vneid-ticket-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/image/heritage-pattern.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 80%;
    opacity: 0.05;
    pointer-events: none;
}

.vneid-ticket-header {
    display: flex;
    align-items: center;
    width: 100%;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.vneid-ticket-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-color);
}

#ticket-catalog-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: var(--accent-color);
    color: var(--primary-dark);
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
}

.vneid-ticket-qr-container {
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.vneid-ticket-qr-container img {
    width: 160px;
    height: 160px;
    margin-bottom: 6px;
}

#ticket-code-label {
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.vneid-ticket-info {
    text-align: center;
    width: 100%;
}

.ticket-name {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.ticket-org {
    font-size: 0.8rem;
    opacity: 0.9;
}

.ticket-position {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* =====================================================================
 * LOGIN OVERLAY (XÁC THỰC CÁN BỘ BẰNG QR)
 * ===================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #a11a1a 0%, #3a0000 100%);
    background-image: radial-gradient(circle at 20% 30%, rgba(161, 26, 26, 0.15) 0%, transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1.5rem;
}

.login-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('/image/heritage-pattern.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70vh;
    opacity: 0.03;
    pointer-events: none;
}

.login-overlay.active {
    display: flex;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    border: 2px solid var(--accent-color);
    text-align: center;
}

.login-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

#account-login-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

#account-login-form input:focus {
    border-color: var(--accent-color);
    outline: 3px solid rgba(185, 28, 28, .12);
}

/* Conference workspace picker */
.conference-picker-overlay {
    z-index: 99998;
    justify-content: center;
    padding: 28px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 8% 12%, rgba(245, 158, 11, 0.18), transparent 27%),
        radial-gradient(circle at 88% 85%, rgba(153, 27, 27, 0.3), transparent 34%),
        linear-gradient(135deg, #111827 0%, #2b1014 54%, #450a0a 100%);
    backdrop-filter: blur(12px);
}

.conference-picker-shell {
    position: relative;
    z-index: 2;
    width: min(1120px, 100%);
    max-height: min(860px, calc(100vh - 56px));
    overflow-x: hidden;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}
.conference-picker-shell svg { stroke-linecap:round;stroke-linejoin:round; }

.conference-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    color: white;
    background: linear-gradient(120deg, #991b1b 0%, #6b1010 62%, #3f0909 100%);
    border-bottom: 4px solid #f59e0b;
}

.conference-picker-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.conference-picker-logo-wrap {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    background: rgba(255,255,255,.96);
    border: 2px solid #fbbf24;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.conference-picker-logo-wrap img { width: 54px; height: 54px; object-fit: contain; }
.conference-picker-eyebrow { display: block; margin-bottom: 4px; color: #fde68a; font-size: .69rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.conference-picker-header h3 { margin: 0 0 5px; color: white; font-size: 1.45rem; font-weight: 800; letter-spacing: -.2px; text-transform: uppercase; }
.conference-picker-header p { margin: 0; color: rgba(255,255,255,.78); font-size: .78rem; line-height: 1.45; }
.conference-picker-role { display:flex;align-items:center;gap:7px;padding:7px 12px;white-space:nowrap;color:#fef3c7;font-size:.7rem;font-weight:800;text-transform:uppercase;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.22);border-radius:999px; }
.conference-picker-role svg { width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2; }

.conference-picker-content {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    min-height: 405px;
}

.conference-picker-list-panel,
.conference-create-panel { min-width: 0; padding: 24px 26px; text-align: left; }
.conference-create-panel { background: white; border-left: 1px solid #e2e8f0; }
.conference-picker-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.conference-picker-section-title > div { display: flex; align-items: center; gap: 9px; }
.conference-picker-section-title h4 { margin: 0; color: #1e293b; font-size: .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .35px; }
.conference-picker-step { display: grid; place-items: center; width: 28px; height: 28px; color: #991b1b; font-size: .68rem; font-weight: 900; background: #fee2e2; border-radius: 8px; }
.conference-picker-count { padding: 5px 9px; color: #475569; font-size: .68rem; font-weight: 700; background: #e2e8f0; border-radius: 999px; }

.conference-choice-list { display: grid; gap: 10px; max-height: 330px; padding-right: 5px; overflow-y: auto; }
.conference-choice-list::-webkit-scrollbar { width: 6px; }
.conference-choice-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.conference-choice-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 13px 14px; background: white; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 2px 8px rgba(15,23,42,.04); transition: border-color .18s, box-shadow .18s, transform .18s; }
.conference-choice-card:hover { border-color: #f59e0b; box-shadow: 0 8px 20px rgba(15,23,42,.09); transform: translateY(-1px); }
.conference-choice-icon { display: grid; place-items: center; width: 48px; height: 48px; color: #991b1b; background: linear-gradient(145deg,#fff1f2,#fee2e2); border-radius: 13px; }
.conference-choice-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.conference-choice-details { min-width: 0; }
.conference-choice-details strong { display: block; overflow: hidden; color: #172033; font-size: .86rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.conference-choice-description { display: -webkit-box; margin-top: 3px; overflow: hidden; color: #64748b; font-size: .7rem; line-height: 1.35; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.conference-choice-date { display:flex;align-items:center;gap:4px;margin-top:5px;color:#94a3b8;font-size:.63rem; }
.conference-choice-date svg { width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2; }
.conference-choice-actions { display: flex; align-items: center; gap: 6px; }
.conference-open-button { display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 12px;color:white;font-size:.72rem;font-weight:800;background:#991b1b;border:0;border-radius:9px;cursor:pointer;transition:background .18s,transform .18s,box-shadow .18s; }
.conference-open-button svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.2;transition:transform .18s; }
.conference-open-button:hover { background: #7f1d1d; transform: translateY(-1px); }
.conference-open-button:hover svg { transform:translateX(2px); }
.conference-delete-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #b91c1c; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 9px; cursor: pointer; }
.conference-delete-button svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2; }
.conference-delete-button:hover { color: white; background: #b91c1c; }
.conference-edit-button { display:grid;place-items:center;width:32px;height:32px;padding:0;color:#1d4ed8;background:#eff6ff;border:1px solid #bfdbfe;border-radius:9px;cursor:pointer;transition:color .18s,background .18s,transform .18s; }
.conference-edit-button svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2; }
.conference-edit-button:hover { color:white;background:#1d4ed8;transform:translateY(-1px); }
.conference-empty-state { display:flex;flex-direction:column;align-items:center;gap:6px;padding:42px 20px;color:#64748b;font-size:.78rem;text-align:center;background:white;border:1px dashed #cbd5e1;border-radius:14px; }
.conference-empty-state > span { display:grid;place-items:center;width:46px;height:46px;margin-bottom:3px;color:#991b1b;background:#fff1f2;border-radius:13px; }
.conference-empty-state svg { width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8; }
.conference-empty-state strong { color:#1e293b;font-size:.82rem; }
.conference-empty-state small { color:#64748b;font-size:.68rem; }

.conference-create-hint { margin: -4px 0 18px; color: #64748b; font-size: .72rem; line-height: 1.5; }
.conference-create-form { display: flex; flex-direction: column; gap: 7px; }
.conference-create-form label { margin-top: 4px; color: #334155; font-size: .71rem; font-weight: 750; }
.conference-create-form input,
.conference-create-form textarea { width: 100%; padding: 10px 11px; color: #1e293b; font: inherit; font-size: .76rem; line-height: 1.45; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 9px; resize: vertical; box-sizing: border-box; outline: none; }
.conference-create-form input:focus,
.conference-create-form textarea:focus { background: white; border-color: #b91c1c; box-shadow: 0 0 0 3px rgba(185,28,28,.1); }
.conference-create-button { display:flex;align-items:center;justify-content:center;gap:8px;margin-top:9px;padding:11px 14px;color:white;font-size:.77rem;font-weight:800;background:linear-gradient(135deg,#a11a1a,#7f1d1d);border:0;border-radius:10px;box-shadow:0 8px 18px rgba(127,29,29,.2);cursor:pointer;transition:transform .18s,box-shadow .18s; }
.conference-create-button svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2; }
.conference-create-button:hover { transform:translateY(-1px);box-shadow:0 11px 22px rgba(127,29,29,.26); }

.conference-system-tools { padding:17px 26px 22px;background:#fff;border-top:1px solid #e2e8f0; }
.conference-system-tools-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px; }
.conference-system-tools-heading > div { display:flex;align-items:center;gap:8px;color:#334155;font-size:.72rem;font-weight:850;letter-spacing:.45px;text-transform:uppercase; }
.conference-system-tools-heading > div svg { width:16px;height:16px;color:#991b1b;fill:none;stroke:currentColor;stroke-width:2; }
.conference-system-tools-heading small { color:#94a3b8;font-size:.62rem; }
.conference-system-tools-grid { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px; }
.conference-tool-card { position:relative;display:grid;grid-template-columns:42px minmax(0,1fr) 20px;align-items:center;gap:10px;min-width:0;padding:12px;color:#1e293b;text-align:left;background:#fff;border:1px solid #e2e8f0;border-radius:13px;box-shadow:0 3px 10px rgba(15,23,42,.04);cursor:pointer;overflow:hidden;transition:border-color .18s,box-shadow .18s,transform .18s; }
.conference-tool-card::before { position:absolute;top:0;bottom:0;left:0;width:3px;content:"";background:#b91c1c; }
.conference-tool-card.email-action::before { background:#2563eb; }
.conference-tool-card.security-action::before { background:#475569; }
.conference-tool-card:hover { border-color:#cbd5e1;box-shadow:0 9px 22px rgba(15,23,42,.1);transform:translateY(-2px); }
.conference-tool-icon { display:grid;place-items:center;width:42px;height:42px;color:#991b1b;background:#fff1f2;border-radius:11px; }
.conference-tool-card.email-action .conference-tool-icon { color:#1d4ed8;background:#eff6ff; }
.conference-tool-card.security-action .conference-tool-icon { color:#334155;background:#f1f5f9; }
.conference-tool-icon svg { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9; }
.conference-tool-copy { min-width:0; }
.conference-tool-copy strong { display:block;color:#1e293b;font-size:.7rem;font-weight:850;text-transform:uppercase; }
.conference-tool-copy small { display:block;margin-top:3px;overflow:hidden;color:#64748b;font-size:.61rem;line-height:1.35;text-overflow:ellipsis;white-space:nowrap; }
.conference-tool-arrow { width:17px;height:17px;color:#94a3b8;fill:none;stroke:currentColor;stroke-width:2;transition:transform .18s,color .18s; }
.conference-tool-card:hover .conference-tool-arrow { color:#475569;transform:translateX(2px); }
.conference-tool-card:focus-visible,.conference-open-button:focus-visible,.conference-edit-button:focus-visible,.conference-delete-button:focus-visible,.conference-create-button:focus-visible { outline:3px solid rgba(245,158,11,.35);outline-offset:2px; }

/* Global outreach composer with adjacent SMTP settings */
.global-campaign-workspace { display:grid;grid-template-columns:minmax(0,1.65fr) minmax(310px,.72fr);align-items:start;gap:18px;max-width:1240px;margin-bottom:2rem; }
.global-campaign-composer-card { min-width:0;margin:0; }
.global-smtp-card { position:sticky;top:16px;min-width:0;margin:0;overflow:hidden; }
.global-smtp-card-header { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 17px;color:white;background:linear-gradient(135deg,#1e293b,#0f172a);border-bottom:3px solid #3b82f6; }
.global-smtp-card-header > div > span { display:block;margin-bottom:3px;color:#93c5fd;font-size:.6rem;font-weight:800;letter-spacing:.8px;text-transform:uppercase; }
.global-smtp-card-header h3 { margin:0;font-size:.98rem;font-weight:850;text-transform:uppercase; }
.global-smtp-status { padding:5px 8px;font-size:.6rem;font-weight:800;border-radius:999px;white-space:nowrap; }
.global-smtp-status.neutral { color:#cbd5e1;background:rgba(255,255,255,.1); }
.global-smtp-status.ready { color:#bbf7d0;background:rgba(22,163,74,.25); }
.global-smtp-status.missing,.global-smtp-status.error { color:#fecaca;background:rgba(220,38,38,.24); }
.global-smtp-status.checking { color:#fde68a;background:rgba(245,158,11,.2); }
.global-smtp-card-body { display:flex;flex-direction:column;gap:10px;padding:16px; }
.global-smtp-help { margin:0 0 3px;color:#64748b;font-size:.69rem;line-height:1.45; }
.global-smtp-card .form-group { margin:0; }
.global-smtp-card .form-group label { font-size:.68rem; }
.global-smtp-card .form-group input { padding:9px 10px;font-size:.73rem; }
.global-smtp-card .form-group small { display:block;margin-top:5px;color:#94a3b8;font-size:.6rem;line-height:1.35; }
.global-smtp-check { display:flex;align-items:center;gap:8px;padding:9px 10px;color:#475569;font-size:.67rem;font-weight:700;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px; }
.global-smtp-check input { width:16px;height:16px; }
.global-smtp-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 16px 16px; }
.global-smtp-actions .btn { padding:9px;font-size:.69rem; }

@media (max-width: 1080px) {
    .global-campaign-workspace { grid-template-columns:1fr; }
    .global-smtp-card { position:static; }
}

@media (max-width: 1180px) {
    .conference-picker-overlay { align-items: flex-start; padding: 24px; }
    .conference-picker-shell { max-height: none; }
}

@media (max-width: 760px) {
    .conference-picker-overlay { padding: 14px; }
    .conference-picker-header { align-items: flex-start; padding: 18px; }
    .conference-picker-logo-wrap { width: 54px; height: 54px; flex-basis: 54px; border-radius: 14px; }
    .conference-picker-logo-wrap img { width: 44px; height: 44px; }
    .conference-picker-header h3 { font-size: 1.1rem; }
    .conference-picker-header p, .conference-picker-role { display: none; }
    .conference-picker-content { grid-template-columns: 1fr; }
    .conference-picker-list-panel, .conference-create-panel { padding: 18px; }
    .conference-create-panel { border-top: 1px solid #e2e8f0; border-left: 0; }
    .conference-choice-list { max-height: 330px; }
    .conference-choice-card { grid-template-columns: 42px minmax(0,1fr); }
    .conference-choice-icon { width: 42px; height: 42px; }
    .conference-choice-actions { grid-column: 1 / -1; }
    .conference-open-button { flex: 1; }
    .conference-system-tools { padding:16px 18px 19px; }
    .conference-system-tools-grid { grid-template-columns:1fr; }
    .conference-system-tools-heading small { display:none; }
}

#login-reader-wrapper {
    width: 240px;
    height: 240px;
    border: 3px dashed var(--primary-color);
    border-radius: 16px;
    overflow: hidden;
    background-color: #000000;
    margin: 1.5rem auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

#login-reader {
    width: 100%;
    height: 100%;
}

#login-reader button, #login-reader select {
    display: none !important;
}

/* =====================================================================
 * UX & RESPONSIVE REFINEMENTS
 * ===================================================================== */
html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .32);
    outline-offset: 2px;
}

.admin-header {
    min-height: 72px;
}

.header-titles {
    min-width: 0;
}

.header-titles h1,
.header-titles h2,
#active-conference-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar {
    scrollbar-color: rgba(245, 158, 11, .55) transparent;
    scrollbar-width: thin;
}

.nav-item {
    min-height: 46px;
}

.admin-main {
    min-width: 0;
}

.tab-content {
    width: min(100%, 1600px);
    margin-inline: auto;
}

.panel {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.table-responsive {
    position: relative;
    overscroll-behavior-x: contain;
    scrollbar-color: #cbd5e1 transparent;
    scrollbar-width: thin;
}

.table-responsive::after {
    content: 'Cuộn ngang để xem thêm →';
    position: sticky;
    right: 10px;
    bottom: 8px;
    float: right;
    display: none;
    width: max-content;
    padding: 4px 8px;
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    background: rgba(248, 250, 252, .94);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    pointer-events: none;
}

.admin-table {
    min-width: 920px;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.admin-table td {
    max-width: 320px;
}

.btn {
    min-height: 38px;
    line-height: 1.2;
}

.btn-sm {
    min-height: 34px;
}

.btn:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none !important;
}

.action-buttons {
    flex-wrap: wrap;
}

.modal-overlay {
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 40px);
}

.modal-header {
    flex: 0 0 auto;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
}

.close-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: -8px;
    border-radius: 50%;
}

.close-btn:hover {
    background: #e2e8f0;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

@media (max-width: 1240px) {
    .admin-sidebar {
        width: 218px;
    }

    .admin-main {
        padding: 1.5rem;
    }

    .table-responsive::after {
        display: block;
    }
}

@media (max-width: 980px) {
    .admin-header {
        position: sticky;
        padding: .65rem 1rem;
    }

    .admin-container {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .admin-sidebar {
        position: sticky;
        top: 72px;
        z-index: 90;
        width: 100%;
        padding: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 2px solid var(--accent-color);
    }

    .sidebar-nav {
        flex-direction: row;
        width: max-content;
        min-width: 100%;
        gap: 6px;
    }

    .nav-item {
        width: auto;
        min-height: 42px;
        padding: .65rem .8rem;
        border-radius: 9px;
        white-space: nowrap;
    }

    .nav-item.active {
        border-left: 0;
        border-bottom: 3px solid var(--accent-color);
    }

    .sidebar-footer {
        display: none;
    }

    .admin-main {
        overflow: visible;
    }

    .card-template-library {
        position: static;
    }
}

@media (max-width: 720px) {
    .admin-header {
        min-height: 62px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .header-titles h1 {
        max-width: 48vw;
        font-size: .9rem;
    }

    .header-titles h2,
    .user-info {
        display: none;
    }

    .admin-sidebar {
        top: 62px;
    }

    .admin-main {
        padding: 1rem;
    }

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

    .page-header h2 {
        font-size: 1.25rem;
    }

    .flex-header > .btn,
    .flex-header > button {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        gap: .75rem;
    }

    .filter-item {
        width: 100%;
        min-width: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .panel-header,
    .panel-body {
        padding: 1rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: none !important;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
        animation: slideUpModal .22s ease-out;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-actions,
    .modal-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn,
    .modal-actions .btn {
        flex: 1 1 140px;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.login-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
}
