/* ══════════════════════════════════════════════════════════
   QR Code ID Verification System — Custom Styles
   ══════════════════════════════════════════════════════════ */

:root {
    --primary:    #1e3a5f;
    --primary-lt: #2d6a9f;
    --gold:       #d4af37;
    --sidebar-w:  260px;
}

@font-face {
    font-family: 'Gobold Extra2';
    src: url('../fonts/Gobold%20Extra2.otf') format('opentype'),
         url('../fonts/Gobold%20Extra2.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Gobold Regular';
    src: url('../fonts/Gobold%20Regular.otf') format('opentype'),
         url('../fonts/Gobold%20Regular.ttf') format('truetype');
    font-display: swap;
}

/* ── Layout ──────────────────────────────────────────────── */
body {
    background: #f0f4f8;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
    overflow-x: hidden;
}

.wrapper { min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid #e8ecf0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    transition: width 0.25s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: #f0f4f8;
    color: var(--primary);
    border-left-color: var(--primary-lt);
}

.sidebar-link.active {
    background: #e8f0fe;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link i { width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e8ecf0;
    color: #a0aec0;
    font-size: 0.78rem;
}

/* ── Top navbar ──────────────────────────────────────────── */
.top-navbar {
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    min-height: 60px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Main content ────────────────────────────────────────── */
.main-content { overflow-x: hidden; max-width: calc(100vw - var(--sidebar-w)); }
.page-content { min-height: calc(100vh - 60px); }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 0.8rem; color: #718096; margin-top: 4px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.bg-primary-soft { background: rgba(30,58,95,0.1); }
.bg-success-soft { background: rgba(40,167,69,0.1); }
.bg-warning-soft { background: rgba(255,193,7,0.1); }
.bg-info-soft    { background: rgba(23,162,184,0.1); }

/* ── Cards ───────────────────────────────────────────────── */
.card { border-radius: 12px; }
.card-header { border-radius: 12px 12px 0 0 !important; }

/* ── Scanner page specific ───────────────────────────────── */
#reader video { border-radius: 12px; }
#reader { background: #000; border-radius: 12px; }

.avatar-circle {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-lt));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Action result badges ─────────────────────────────────── */
.result-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.result-not-allowed {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.result-already-taken {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.result-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

/* ── Meal eligibility grid ───────────────────────────────── */
.meal-allowed     { background: #d4edda; border-radius: 8px; }
.meal-not-allowed { background: #f8d7da; border-radius: 8px; }
.meal-taken       { background: #fff3cd; border-radius: 8px; }

/* ── Table overrides ─────────────────────────────────────── */
.table > :not(caption) > * > * { padding: 0.6rem 0.75rem; }
.dataTables_wrapper .dataTables_filter input { border-radius: 8px; border: 1px solid #ced4da; padding: 0.35rem 0.65rem; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }

/* ── Dashed border card ──────────────────────────────────── */
.border-dashed { border: 2px dashed #dee2e6 !important; }

.designer-stage-wrap {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
}

.designer-canvas-shell {
    width: 100%;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(45deg, rgba(30, 58, 95, 0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(30, 58, 95, 0.04) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(30, 58, 95, 0.04) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(30, 58, 95, 0.04) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    border: 1px dashed rgba(30,58,95,0.18);
    border-radius: 20px;
    padding: 1rem;
}

.designer-canvas-shell canvas {
    max-width: 100%;
    box-shadow: 0 18px 45px rgba(13, 37, 63, 0.18);
    border-radius: 14px;
}

.designer-control-card {
    box-shadow: 0 6px 20px rgba(30,58,95,0.06);
}

.designer-control-card .form-label {
    margin-bottom: 0.25rem;
}

/* ── Login specific ──────────────────────────────────────── */
.login-card .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 0.25rem rgba(30,58,95,0.2); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-lt); border-color: var(--primary-lt); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        top: 0; left: 0; bottom: 0;
    }
    .sidebar.open       { transform: translateX(0); }
    .main-content        { max-width: 100vw; }
    .top-navbar          { padding-left: 12px !important; padding-right: 12px !important; }
}

/* ── Print styles ─────────────────────────────────────────── */
@media print {
    .sidebar, .top-navbar, .btn, form { display: none !important; }
    .main-content { max-width: 100%; }
}
