/* ==========================================================================
   SecureGate - application styles (on top of Bootstrap 5.3)
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --sg-bg: #f3f5f9;
    --sg-surface: #ffffff;
    --sg-surface-2: #f8fafc;
    --sg-border: #e3e8ef;
    --sg-text: #172033;
    --sg-muted: #667085;
    --sg-primary: #1f6feb;
    --sg-primary-rgb: 31, 111, 235;
    --sg-primary-soft: #e8f0fe;
    --sg-success: #12a150;
    --sg-success-soft: #e3f6eb;
    --sg-danger: #d92d20;
    --sg-danger-soft: #fdecea;
    --sg-warning: #c27803;
    --sg-warning-soft: #fdf3dc;
    --sg-info: #0b84a5;
    --sg-info-soft: #e1f3f8;
    --sg-neutral: #475467;
    --sg-neutral-soft: #eef1f5;
    --sg-sidebar: #0c1524;
    --sg-sidebar-2: #13203a;
    --sg-sidebar-text: #9fadc4;
    --sg-sidebar-active: #ffffff;
    --sg-radius: 12px;
    --sg-radius-sm: 8px;
    --sg-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --sg-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
    --sg-sidebar-width: 264px;
    --sg-topbar-height: 64px;

    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --bs-body-bg: var(--sg-bg);
    --bs-body-color: var(--sg-text);
    --bs-border-color: var(--sg-border);
    --bs-primary: var(--sg-primary);
    --bs-primary-rgb: var(--sg-primary-rgb);
    --bs-link-color: var(--sg-primary);
    --bs-link-color-rgb: var(--sg-primary-rgb);
    --bs-link-hover-color: #1858c0;
    --bs-secondary-color: var(--sg-muted);
    --bs-border-radius: var(--sg-radius-sm);
}

[data-bs-theme="dark"] {
    --sg-bg: #0b111c;
    --sg-surface: #121a28;
    --sg-surface-2: #172133;
    --sg-border: #243047;
    --sg-text: #e4e9f2;
    --sg-muted: #94a0b4;
    --sg-primary: #4c8dff;
    --sg-primary-rgb: 76, 141, 255;
    --sg-primary-soft: rgba(76, 141, 255, .14);
    --sg-success: #3ccb7f;
    --sg-success-soft: rgba(60, 203, 127, .14);
    --sg-danger: #ff6b5e;
    --sg-danger-soft: rgba(255, 107, 94, .14);
    --sg-warning: #f5b544;
    --sg-warning-soft: rgba(245, 181, 68, .14);
    --sg-info: #4cc3e0;
    --sg-info-soft: rgba(76, 195, 224, .14);
    --sg-neutral: #b4bfd0;
    --sg-neutral-soft: rgba(180, 191, 208, .12);
    --sg-sidebar: #080d16;
    --sg-sidebar-2: #101a2b;
    --sg-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --sg-shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, .6);

    --bs-body-bg: var(--sg-bg);
    --bs-body-color: var(--sg-text);
    --bs-border-color: var(--sg-border);
    --bs-tertiary-bg: var(--sg-surface-2);
    --bs-link-hover-color: #7aa9ff;
}

body {
    background: var(--sg-bg);
    color: var(--sg-text);
    font-size: .9375rem;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .list-group-item:hover, .card-link:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6 { color: var(--sg-text); font-weight: 650; letter-spacing: -.01em; }
.text-muted, .text-secondary { color: var(--sg-muted) !important; }
.small-caps { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--sg-muted); }
.font-mono, code.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fw-semibold { font-weight: 600 !important; }

/* --------------------------------------------------------------------------
   Buttons & form controls
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-font-weight: 550;
    --bs-btn-border-radius: var(--sg-radius-sm);
    --bs-btn-padding-x: .95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}
.btn-primary {
    --bs-btn-bg: var(--sg-primary);
    --bs-btn-border-color: var(--sg-primary);
    --bs-btn-hover-bg: #1858c0;
    --bs-btn-hover-border-color: #1858c0;
    --bs-btn-active-bg: #144aa3;
    --bs-btn-disabled-bg: var(--sg-primary);
    --bs-btn-disabled-border-color: var(--sg-primary);
}
.btn-light {
    --bs-btn-bg: var(--sg-surface);
    --bs-btn-border-color: var(--sg-border);
    --bs-btn-color: var(--sg-text);
    --bs-btn-hover-bg: var(--sg-surface-2);
    --bs-btn-hover-border-color: #cfd6e1;
    --bs-btn-hover-color: var(--sg-text);
    --bs-btn-active-bg: var(--sg-neutral-soft);
    --bs-btn-active-color: var(--sg-text);
}
.btn-soft-danger { color: var(--sg-danger); background: var(--sg-danger-soft); border-color: transparent; }
.btn-soft-danger:hover { color: #fff; background: var(--sg-danger); }
.btn-soft-success { color: var(--sg-success); background: var(--sg-success-soft); border-color: transparent; }
.btn-soft-success:hover { color: #fff; background: var(--sg-success); }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; }
.btn-sm.btn-icon { width: 1.9rem; height: 1.9rem; }
.btn-xl { padding: .9rem 1.4rem; font-size: 1.05rem; border-radius: 10px; }

.form-control, .form-select {
    border-color: var(--sg-border);
    background-color: var(--sg-surface);
    border-radius: var(--sg-radius-sm);
    padding: .55rem .8rem;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--sg-primary-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--sg-primary-rgb), .15);
}
.form-label, .control-label { font-weight: 550; font-size: .875rem; margin-bottom: .35rem; }
.form-text, .hint-block { font-size: .8rem; color: var(--sg-muted); }
.input-group-text { background: var(--sg-surface-2); border-color: var(--sg-border); color: var(--sg-muted); }
.invalid-feedback { font-size: .8rem; }
.form-check-input:checked { background-color: var(--sg-primary); border-color: var(--sg-primary); }
.required > label::after, .required .form-label::after { content: " *"; color: var(--sg-danger); }

.form-section { padding: 1.25rem 0; border-top: 1px solid var(--sg-border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { font-size: .95rem; font-weight: 650; margin-bottom: .25rem; }
.form-section-hint { font-size: .825rem; color: var(--sg-muted); margin-bottom: 1rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; padding-top: 1.25rem; border-top: 1px solid var(--sg-border); margin-top: .5rem; }

/* File inputs with preview */
.upload-tile {
    display: flex; align-items: center; gap: 1rem;
    border: 1px dashed #c7d0dd; border-radius: var(--sg-radius); padding: .9rem; background: var(--sg-surface-2);
}
.upload-tile .upload-preview {
    width: 64px; height: 64px; border-radius: 10px; background: var(--sg-neutral-soft); flex-shrink: 0;
    display: grid; place-items: center; overflow: hidden; color: var(--sg-muted); font-size: 1.5rem;
}
.upload-tile .upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    --bs-card-border-color: var(--sg-border);
    --bs-card-border-radius: var(--sg-radius);
    --bs-card-inner-border-radius: calc(var(--sg-radius) - 1px);
    --bs-card-bg: var(--sg-surface);
    --bs-card-cap-bg: transparent;
    box-shadow: var(--sg-shadow);
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom-color: var(--sg-border);
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.card-title { font-size: 1rem; font-weight: 650; margin: 0; }
.card-subtitle { font-size: .8rem; color: var(--sg-muted); margin: .15rem 0 0; }
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top-color: var(--sg-border); padding: .85rem 1.25rem; }

/* --------------------------------------------------------------------------
   App shell: sidebar + topbar
   -------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--sg-sidebar-width);
    background: linear-gradient(180deg, var(--sg-sidebar) 0%, var(--sg-sidebar-2) 100%);
    color: var(--sg-sidebar-text);
    display: flex; flex-direction: column;
    transition: transform .2s ease;
}
.sidebar-brand {
    height: var(--sg-topbar-height);
    display: flex; align-items: center; gap: .65rem;
    padding: 0 1.25rem; color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.sidebar-brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(29, 78, 216, .45);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .75rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.sidebar-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 650; color: #5f6f8a; padding: 1.1rem .75rem .45rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem .75rem; margin: 1px 0; border-radius: 8px;
    color: var(--sg-sidebar-text); font-weight: 500; font-size: .9rem;
    position: relative;
}
.sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; opacity: .85; }
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, .05); text-decoration: none; }
.sidebar-link.active { color: var(--sg-sidebar-active); background: rgba(59, 130, 246, .16); }
.sidebar-link.active::before {
    content: ""; position: absolute; left: -.75rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: #3b82f6;
}
.sidebar-link.active i { opacity: 1; color: #6ea8ff; }
.sidebar-link .nav-count {
    margin-left: auto; font-size: .7rem; font-weight: 650; padding: .1rem .45rem; border-radius: 999px;
    background: rgba(245, 181, 68, .18); color: #f5b544;
}
.sidebar-link .nav-count.danger { background: rgba(255, 107, 94, .18); color: #ff8b80; }
.sidebar-footer { padding: .9rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .06); font-size: .78rem; color: #5f6f8a; }

.app-main { margin-left: var(--sg-sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--sg-topbar-height);
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--sg-border);
}
[data-bs-theme="dark"] .topbar { background: rgba(18, 26, 40, .85); }
.topbar-search { position: relative; flex: 1; max-width: 440px; }
.topbar-search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--sg-muted); }
.topbar-search .form-control { padding-left: 2.3rem; background: var(--sg-surface-2); border-color: transparent; }
.topbar-search .form-control:focus { background: var(--sg-surface); }
.topbar-search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-size: .7rem; background: var(--sg-neutral-soft); color: var(--sg-muted); border-radius: 5px; padding: .1rem .4rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.topbar-btn {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; position: relative;
    color: var(--sg-muted); background: transparent; border: 0; font-size: 1.15rem;
}
.topbar-btn:hover, .topbar-btn[aria-expanded="true"] { background: var(--sg-neutral-soft); color: var(--sg-text); }
.topbar-btn .dot-count {
    position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--sg-danger); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--sg-surface);
}
.user-menu-toggle { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; border: 0; background: transparent; color: var(--sg-text); }
.user-menu-toggle:hover, .user-menu-toggle[aria-expanded="true"] { background: var(--sg-neutral-soft); }
.user-menu-toggle .user-meta { line-height: 1.15; text-align: left; }
.user-menu-toggle .user-meta small { display: block; color: var(--sg-muted); font-size: .75rem; }

.dropdown-menu {
    --bs-dropdown-border-color: var(--sg-border);
    --bs-dropdown-border-radius: var(--sg-radius);
    --bs-dropdown-bg: var(--sg-surface);
    --bs-dropdown-link-hover-bg: var(--sg-surface-2);
    --bs-dropdown-link-active-bg: var(--sg-primary);
    --bs-dropdown-item-padding-y: .5rem;
    box-shadow: var(--sg-shadow-lg);
    padding: .4rem;
}
.dropdown-item { border-radius: 6px; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.dropdown-item i { color: var(--sg-muted); }

.notif-menu { width: 380px; max-width: calc(100vw - 2rem); padding: 0; }
.notif-menu .notif-head { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--sg-border); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--sg-border); color: var(--sg-text); }
.notif-item:hover { background: var(--sg-surface-2); text-decoration: none; color: var(--sg-text); }
.notif-item.unread { background: var(--sg-primary-soft); }
.notif-item .notif-title { font-weight: 600; font-size: .875rem; }
.notif-item .notif-msg { font-size: .825rem; color: var(--sg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item .notif-time { font-size: .72rem; color: var(--sg-muted); margin-top: .15rem; }
.notif-menu .notif-foot { display: block; text-align: center; padding: .7rem; font-size: .85rem; font-weight: 550; }

.app-content { padding: 1.75rem 1.5rem 2.5rem; flex: 1; width: 100%; max-width: 1480px; }
.app-footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--sg-muted); border-top: 1px solid var(--sg-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar-open .sidebar { transform: none; box-shadow: var(--sg-shadow-lg); }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 13, 22, .5); z-index: 1035; }
    .app-main { margin-left: 0; }
    .topbar { padding: 0 1rem; }
    .app-content { padding: 1.25rem 1rem 2rem; }
}

/* --------------------------------------------------------------------------
   Page header, breadcrumbs, alerts
   -------------------------------------------------------------------------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header .page-subtitle { color: var(--sg-muted); margin: .3rem 0 0; font-size: .9rem; }
.page-header .page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { --bs-breadcrumb-divider: "/"; --bs-breadcrumb-item-padding-x: .45rem; font-size: .8rem; margin-bottom: .45rem; }
.breadcrumb-item, .breadcrumb-item a { color: var(--sg-muted); }
.breadcrumb-item.active { color: var(--sg-text); }

.flash-stack { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.alert { border-radius: var(--sg-radius); border: 1px solid transparent; display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; font-size: .9rem; }
.alert > i { font-size: 1.1rem; line-height: 1.3; }
.alert .btn-close { margin-left: auto; padding: .35rem; font-size: .7rem; position: static; }
.alert-success { background: var(--sg-success-soft); color: var(--sg-success); border-color: rgba(18, 161, 80, .2); }
.alert-danger { background: var(--sg-danger-soft); color: var(--sg-danger); border-color: rgba(217, 45, 32, .2); }
.alert-warning { background: var(--sg-warning-soft); color: var(--sg-warning); border-color: rgba(194, 120, 3, .2); }
.alert-info { background: var(--sg-info-soft); color: var(--sg-info); border-color: rgba(11, 132, 165, .2); }
.alert .alert-body { color: var(--sg-text); }

/* --------------------------------------------------------------------------
   Badges, avatars, misc atoms
   -------------------------------------------------------------------------- */
.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap;
    background: var(--sg-neutral-soft); color: var(--sg-neutral);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.pill-success { background: var(--sg-success-soft); color: var(--sg-success); }
.pill-danger { background: var(--sg-danger-soft); color: var(--sg-danger); }
.pill-warning { background: var(--sg-warning-soft); color: var(--sg-warning); }
.pill-info { background: var(--sg-info-soft); color: var(--sg-info); }
.pill-primary { background: var(--sg-primary-soft); color: var(--sg-primary); }

.code-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; font-weight: 600; background: var(--sg-neutral-soft); padding: .15rem .45rem; border-radius: 6px; color: var(--sg-text); letter-spacing: .02em; }
.plate { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: .8rem; padding: .15rem .5rem; border-radius: 5px; background: #ffd84d; color: #1a1a1a; border: 1px solid #1a1a1a; letter-spacing: .04em; white-space: nowrap; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center; overflow: hidden;
    font-size: .8rem; font-weight: 650; color: #fff; background: #64748b;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.75rem; border-radius: 20px; }
.avatar-square { border-radius: 10px; }
.identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.identity .identity-name { font-weight: 600; color: var(--sg-text); line-height: 1.25; }
.identity .identity-sub { font-size: .8rem; color: var(--sg-muted); line-height: 1.25; }
a.identity:hover { text-decoration: none; }
a.identity:hover .identity-name { color: var(--sg-primary); }

.icon-chip { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; background: var(--sg-primary-soft); color: var(--sg-primary); }
.icon-chip.success { background: var(--sg-success-soft); color: var(--sg-success); }
.icon-chip.danger { background: var(--sg-danger-soft); color: var(--sg-danger); }
.icon-chip.warning { background: var(--sg-warning-soft); color: var(--sg-warning); }
.icon-chip.info { background: var(--sg-info-soft); color: var(--sg-info); }
.icon-chip.neutral { background: var(--sg-neutral-soft); color: var(--sg-neutral); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--sg-muted); }
.empty-state i { font-size: 2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.empty-state p { margin: 0; }
.empty-state .btn { margin-top: 1rem; }

.divider-label { display: flex; align-items: center; gap: .75rem; color: var(--sg-muted); font-size: .8rem; margin: 1.25rem 0; }
.divider-label::before, .divider-label::after { content: ""; height: 1px; flex: 1; background: var(--sg-border); }

/* --------------------------------------------------------------------------
   Stats & charts
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--sg-radius); padding: 1.1rem 1.15rem; box-shadow: var(--sg-shadow); display: flex; gap: .9rem; align-items: flex-start; color: inherit; }
a.stat-card:hover { border-color: rgba(var(--sg-primary-rgb), .4); text-decoration: none; color: inherit; }
.stat-card .stat-label { font-size: .8rem; color: var(--sg-muted); font-weight: 550; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin-top: .1rem; }
.stat-card .stat-sub { font-size: .75rem; color: var(--sg-muted); margin-top: .2rem; }

.bar-chart { display: flex; align-items: flex-end; gap: .75rem; height: 200px; padding-top: 1rem; }
.bar-chart .bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar-chart .bar { width: 100%; max-width: 18px; border-radius: 5px 5px 2px 2px; background: var(--sg-primary); min-height: 3px; position: relative; transition: opacity .15s; }
.bar-chart .bar.out { background: #9ec2ff; }
[data-bs-theme="dark"] .bar-chart .bar.out { background: #3a5a93; }
.bar-chart .bar.denied { background: var(--sg-danger); }
.bar-chart .bar:hover { opacity: .8; }
.bar-chart .bar-label { font-size: .72rem; color: var(--sg-muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--sg-muted); }
.chart-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .35rem; background: var(--sg-primary); vertical-align: -1px; }
.chart-legend .out::before { background: #9ec2ff; }
.chart-legend .denied::before { background: var(--sg-danger); }

/* Activity feed */
.feed { list-style: none; padding: 0; margin: 0; }
.feed-item { display: flex; gap: .8rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--sg-border); align-items: center; }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: .9rem; }
.feed-icon.in { background: var(--sg-success-soft); color: var(--sg-success); }
.feed-icon.out { background: var(--sg-info-soft); color: var(--sg-info); }
.feed-icon.denied { background: var(--sg-danger-soft); color: var(--sg-danger); }
.feed-body { flex: 1; min-width: 0; font-size: .875rem; }
.feed-body .feed-meta { font-size: .78rem; color: var(--sg-muted); }
.feed-time { font-size: .75rem; color: var(--sg-muted); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Tables & grids
   -------------------------------------------------------------------------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--sg-surface-2); --bs-table-color: var(--sg-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--sg-border); }
.table > thead > tr > th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; color: var(--sg-muted);
    background: var(--sg-surface-2); white-space: nowrap; border-bottom-width: 1px;
}
.table > thead > tr > th a { color: var(--sg-muted); }
.table > thead > tr > th a.asc::after { content: " \2191"; }
.table > thead > tr > th a.desc::after { content: " \2193"; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table .filters input, .table .filters select { font-size: .8rem; padding: .3rem .5rem; }
.card > .grid-view .table > thead > tr:first-child > th:first-child { border-top-left-radius: 0; }
.grid-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.25rem; border-top: 1px solid var(--sg-border); }
.grid-footer:empty { display: none; }
.grid-footer .summary { font-size: .8rem; color: var(--sg-muted); }
.pagination { --bs-pagination-border-color: var(--sg-border); --bs-pagination-bg: var(--sg-surface); --bs-pagination-color: var(--sg-text); --bs-pagination-active-bg: var(--sg-primary); --bs-pagination-active-border-color: var(--sg-primary); --bs-pagination-hover-bg: var(--sg-surface-2); }
.row-actions { display: flex; gap: .25rem; justify-content: flex-end; white-space: nowrap; }
.row-actions .btn { color: var(--sg-muted); }
.row-actions .btn:hover { color: var(--sg-text); background: var(--sg-neutral-soft); }
.row-actions .btn.text-danger:hover { color: var(--sg-danger) !important; background: var(--sg-danger-soft); }

.detail-table th { width: 34%; font-weight: 550; color: var(--sg-muted); font-size: .85rem; background: transparent !important; text-transform: none !important; letter-spacing: 0 !important; }
.detail-table td { font-size: .9rem; }
.detail-table tr:last-child > * { border-bottom: 0; }

.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .85rem 1.25rem; border-bottom: 1px solid var(--sg-border); }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 150px; padding-top: .4rem; padding-bottom: .4rem; font-size: .875rem; }
.toolbar .toolbar-search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.toolbar .toolbar-search .form-control { width: 100%; padding-left: 2.1rem; }
.toolbar .toolbar-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--sg-muted); font-size: .85rem; }

.tabs-filter { display: flex; gap: .25rem; flex-wrap: wrap; padding: .6rem 1rem 0; border-bottom: 1px solid var(--sg-border); }
.tabs-filter a { padding: .55rem .85rem; font-size: .85rem; font-weight: 550; color: var(--sg-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: .4rem; align-items: center; }
.tabs-filter a:hover { color: var(--sg-text); text-decoration: none; }
.tabs-filter a.active { color: var(--sg-primary); border-bottom-color: var(--sg-primary); }
.tabs-filter .count { font-size: .7rem; padding: .05rem .4rem; border-radius: 999px; background: var(--sg-neutral-soft); color: var(--sg-muted); }
.tabs-filter a.active .count { background: var(--sg-primary-soft); color: var(--sg-primary); }

/* Settings hub */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.settings-tile { display: flex; gap: .9rem; padding: 1.1rem; border: 1px solid var(--sg-border); border-radius: var(--sg-radius); background: var(--sg-surface); color: var(--sg-text); box-shadow: var(--sg-shadow); }
.settings-tile:hover { border-color: rgba(var(--sg-primary-rgb), .45); text-decoration: none; color: var(--sg-text); }
.settings-tile h3 { font-size: .95rem; margin: 0 0 .2rem; }
.settings-tile p { font-size: .8rem; color: var(--sg-muted); margin: 0; }

/* --------------------------------------------------------------------------
   Gate console
   -------------------------------------------------------------------------- */
.gate-hero {
    background: linear-gradient(135deg, #0c1524 0%, #15284a 60%, #1d3b70 100%);
    border-radius: 16px; padding: 1.75rem; color: #dbe5f5; margin-bottom: 1.5rem; position: relative; overflow: hidden;
}
.gate-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .35), transparent 70%); pointer-events: none; }
.gate-hero h1 { color: #fff; font-size: 1.35rem; margin: 0 0 .25rem; }
.gate-hero p { margin: 0 0 1.25rem; color: #9fb2d1; font-size: .9rem; }
.gate-hero .gate-clock { position: absolute; right: 1.75rem; top: 1.5rem; text-align: right; z-index: 1; }
.gate-hero .gate-clock .time { font-size: 1.6rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gate-hero .gate-clock .date { font-size: .8rem; color: #9fb2d1; }
.gate-scan { position: relative; z-index: 1; display: flex; gap: .6rem; max-width: 760px; }
.gate-scan .form-control {
    font-size: 1.2rem; padding: .9rem 1rem .9rem 3rem; border-radius: 12px; border: 2px solid transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; background: #fff; color: #172033;
}
.gate-scan .form-control:focus { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, .3); }
.gate-scan .scan-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: #64748b; }
.gate-hint { margin-top: .75rem; font-size: .8rem; color: #8ea3c4; position: relative; z-index: 1; }
.gate-hint .code-chip { background: rgba(255, 255, 255, .1); color: #dbe5f5; }

@media (max-width: 767.98px) {
    .gate-hero .gate-clock { position: static; text-align: left; margin-bottom: 1rem; }
    .gate-scan { flex-direction: column; }
}

.verdict { border-radius: 16px; overflow: hidden; border: 1px solid var(--sg-border); background: var(--sg-surface); box-shadow: var(--sg-shadow-lg); margin-bottom: 1.5rem; }
.verdict-banner { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; color: #fff; }
.verdict-banner i { font-size: 2rem; }
.verdict-banner .verdict-title { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.verdict-banner .verdict-reason { font-size: .9rem; opacity: .92; }
.verdict.allowed .verdict-banner { background: linear-gradient(90deg, #0f9447, #12a150); }
.verdict.denied .verdict-banner { background: linear-gradient(90deg, #b42318, #d92d20); }
.verdict.inside .verdict-banner { background: linear-gradient(90deg, #075e78, #0b84a5); }
.verdict.unknown .verdict-banner { background: linear-gradient(90deg, #475467, #667085); }
.verdict-body { padding: 1.5rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; }
.verdict-photo { width: 120px; height: 140px; border-radius: 14px; overflow: hidden; background: var(--sg-neutral-soft); display: grid; place-items: center; font-size: 2.6rem; color: var(--sg-muted); }
.verdict-photo img { width: 100%; height: 100%; object-fit: cover; }
.verdict-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem 1.5rem; }
.verdict-facts .fact-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sg-muted); font-weight: 600; }
.verdict-facts .fact-value { font-weight: 600; margin-top: .1rem; }
.verdict-actions { display: flex; flex-direction: column; gap: .5rem; min-width: 200px; }
@media (max-width: 991.98px) {
    .verdict-body { grid-template-columns: 1fr; }
    .verdict-photo { width: 100px; height: 116px; }
    .verdict-actions { min-width: 0; }
}

.onsite-list .list-group-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; border-color: var(--sg-border); background: transparent; }

/* --------------------------------------------------------------------------
   Gate pass card (screen + print)
   -------------------------------------------------------------------------- */
.pass-card {
    width: 100%; max-width: 360px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #fff; color: #172033;
    border: 1px solid #dfe5ee; box-shadow: var(--sg-shadow-lg);
}
.pass-card .pass-top { background: linear-gradient(135deg, #0c1524, #1d3b70); color: #fff; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; }
.pass-card .pass-top .brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.pass-card .pass-top .brand-mark { width: 26px; height: 26px; font-size: .85rem; border-radius: 7px; }
.pass-card .pass-top .kind { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.pass-card .pass-body { padding: 1.25rem; text-align: center; }
.pass-card .pass-photo { width: 104px; height: 120px; margin: -2.75rem auto .75rem; border-radius: 14px; overflow: hidden; border: 4px solid #fff; background: #eef1f5; display: grid; place-items: center; font-size: 2rem; color: #94a3b8; box-shadow: 0 6px 16px rgba(15, 23, 42, .15); position: relative; }
.pass-card .pass-photo img { width: 100%; height: 100%; object-fit: cover; }
.pass-card .pass-name { font-size: 1.2rem; font-weight: 700; margin: 0; }
.pass-card .pass-id { font-size: .8rem; color: #667085; margin-bottom: .9rem; }
.pass-card .pass-qr { width: 156px; height: 156px; margin: 0 auto .5rem; }
.pass-card .pass-qr img, .pass-card .pass-qr svg { width: 100%; height: 100%; }
.pass-card .pass-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; }
.pass-card .pass-validity { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px dashed #d5dce6; margin-top: 1rem; padding-top: .9rem; font-size: .8rem; text-align: left; gap: .5rem; }
.pass-card .pass-validity .lbl { color: #667085; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.pass-card .pass-validity .val { font-weight: 650; }
.pass-card .pass-foot { background: #f4f6fa; font-size: .7rem; color: #667085; text-align: center; padding: .6rem 1rem; }

/* Timeline (pass history) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--sg-border); }
.timeline li { position: relative; padding: 0 0 1.1rem 2.75rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-dot { position: absolute; left: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: var(--sg-surface); border: 2px solid var(--sg-border); color: var(--sg-muted); }
.timeline .tl-dot.success { border-color: var(--sg-success); color: var(--sg-success); }
.timeline .tl-dot.danger { border-color: var(--sg-danger); color: var(--sg-danger); }
.timeline .tl-dot.info { border-color: var(--sg-info); color: var(--sg-info); }
.timeline .tl-dot.primary { border-color: var(--sg-primary); color: var(--sg-primary); }
.timeline .tl-title { font-weight: 600; font-size: .875rem; }
.timeline .tl-meta { font-size: .78rem; color: var(--sg-muted); }

/* Document thumbnails */
.doc-thumb { display: flex; align-items: center; gap: .75rem; padding: .7rem; border: 1px solid var(--sg-border); border-radius: 10px; color: var(--sg-text); }
.doc-thumb:hover { border-color: rgba(var(--sg-primary-rgb), .4); text-decoration: none; color: var(--sg-text); }
.doc-thumb .doc-preview { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--sg-neutral-soft); display: grid; place-items: center; font-size: 1.3rem; color: var(--sg-muted); flex-shrink: 0; }
.doc-thumb .doc-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Profile header */
.profile-cover { height: 96px; background: linear-gradient(135deg, #0c1524, #1d3b70); border-radius: var(--sg-radius) var(--sg-radius) 0 0; }
.profile-head { display: flex; gap: 1.25rem; align-items: flex-end; padding: 0 1.5rem 1.25rem; margin-top: -40px; flex-wrap: wrap; }
.profile-head .avatar-xl { border: 4px solid var(--sg-surface); box-shadow: var(--sg-shadow); }
.profile-head h2 { font-size: 1.3rem; margin: 0; }

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--sg-surface); }
.auth-aside {
    position: relative; overflow: hidden; color: #cfdaee; padding: 2.75rem;
    background: radial-gradient(1200px 500px at -10% -10%, rgba(59, 130, 246, .35), transparent 60%), linear-gradient(160deg, #0a1220 0%, #12233f 55%, #183463 100%);
    display: flex; flex-direction: column;
}
.auth-aside .auth-brand { display: flex; align-items: center; gap: .65rem; color: #fff; font-weight: 700; font-size: 1.15rem; }
.auth-aside .auth-brand:hover { text-decoration: none; }
.auth-aside .auth-pitch { margin-top: auto; max-width: 460px; }
.auth-aside h2 { color: #fff; font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 1rem; }
.auth-aside .auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .9rem; }
.auth-aside .auth-points li { display: flex; gap: .75rem; align-items: flex-start; font-size: .92rem; }
.auth-aside .auth-points i { color: #6ea8ff; font-size: 1.1rem; }
.auth-aside .auth-foot { margin-top: 2.5rem; font-size: .78rem; color: #6f84a8; }
.auth-aside .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(180deg, #000, transparent 75%); pointer-events: none; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem; }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.auth-card .auth-sub { color: var(--sg-muted); margin-bottom: 1.75rem; }
.auth-card .demo-accounts { background: var(--sg-surface-2); border: 1px solid var(--sg-border); border-radius: var(--sg-radius); padding: .9rem 1rem; font-size: .8rem; margin-top: 1.5rem; }
.auth-card .demo-accounts button { border: 0; background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: 6px; padding: .2rem .55rem; font-size: .75rem; margin: .15rem .15rem 0 0; color: var(--sg-text); }
.auth-card .demo-accounts button:hover { border-color: var(--sg-primary); color: var(--sg-primary); }
.auth-mobile-brand { display: none; }
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 1.5rem 1rem; justify-content: flex-start; }
    .auth-mobile-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: 2rem; color: var(--sg-text); }
}

/* --------------------------------------------------------------------------
   Public site
   -------------------------------------------------------------------------- */
.site-nav { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--sg-border); }
[data-bs-theme="dark"] .site-nav { background: rgba(11, 17, 28, .86); }
.site-nav .navbar { padding: .7rem 0; }
.site-nav .navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--sg-text); }
.site-nav .nav-link { font-weight: 550; color: var(--sg-muted); font-size: .92rem; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--sg-text); }

.hero { position: relative; overflow: hidden; padding: 5.5rem 0 4.5rem; background: radial-gradient(900px 420px at 85% -10%, rgba(59, 130, 246, .18), transparent 60%), radial-gradient(700px 380px at -10% 20%, rgba(18, 161, 80, .08), transparent 60%); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; background: var(--sg-primary-soft); color: var(--sg-primary); font-size: .8rem; font-weight: 600; margin-bottom: 1.25rem; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 750; margin-bottom: 1.25rem; }
.hero h1 .accent { background: linear-gradient(90deg, #1f6feb, #0b84a5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.15rem; color: var(--sg-muted); max-width: 540px; margin-bottom: 2rem; }
.hero .hero-proof { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; font-size: .85rem; color: var(--sg-muted); }
.hero .hero-proof i { color: var(--sg-success); margin-right: .3rem; }

/* Product mock in the hero */
.mock { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .28); overflow: hidden; transform: perspective(1600px) rotateY(-6deg) rotateX(2deg); }
.mock-bar { display: flex; gap: 6px; padding: .7rem .9rem; border-bottom: 1px solid var(--sg-border); background: var(--sg-surface-2); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #d0d7e2; }
.mock-body { padding: 1.1rem; display: grid; gap: .8rem; }
.mock-scan { border-radius: 12px; background: linear-gradient(135deg, #0c1524, #1d3b70); padding: 1rem; color: #fff; }
.mock-scan .mock-input { background: #fff; color: #172033; border-radius: 9px; padding: .6rem .8rem; font-family: ui-monospace, Menlo, monospace; font-weight: 600; display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.mock-verdict { border-radius: 12px; overflow: hidden; border: 1px solid var(--sg-border); }
.mock-verdict .mv-banner { background: linear-gradient(90deg, #0f9447, #12a150); color: #fff; padding: .6rem .9rem; font-weight: 700; font-size: .9rem; display: flex; gap: .5rem; align-items: center; }
.mock-verdict .mv-body { display: flex; gap: .8rem; padding: .8rem .9rem; align-items: center; }
.mock-verdict .mv-photo { width: 44px; height: 52px; border-radius: 8px; background: linear-gradient(160deg, #cbd5e1, #94a3b8); }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mock-stats div { border: 1px solid var(--sg-border); border-radius: 10px; padding: .6rem .7rem; font-size: .7rem; color: var(--sg-muted); }
.mock-stats strong { display: block; font-size: 1.15rem; color: var(--sg-text); }

.section { padding: 5rem 0; }
.section-alt { background: var(--sg-surface); border-top: 1px solid var(--sg-border); border-bottom: 1px solid var(--sg-border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-head .kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--sg-primary); }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.025em; margin: .5rem 0 .75rem; }
.section-head p { color: var(--sg-muted); font-size: 1.02rem; }
.feature { height: 100%; padding: 1.5rem; border: 1px solid var(--sg-border); border-radius: 16px; background: var(--sg-surface); transition: border-color .15s, transform .15s; }
.feature:hover { border-color: rgba(var(--sg-primary-rgb), .35); transform: translateY(-2px); }
.feature h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.feature p, .feature .feature-text { color: var(--sg-muted); font-size: .92rem; margin: 0; }
.feature .feature-text p { margin: 0; }
.step { position: relative; padding-left: 3.5rem; }
.step .step-num { position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--sg-primary); color: #fff; }
.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step .step-text, .step .step-text p { color: var(--sg-muted); font-size: .92rem; margin: 0; }
.quote { height: 100%; padding: 1.5rem; border-radius: 16px; background: var(--sg-surface); border: 1px solid var(--sg-border); display: flex; flex-direction: column; }
.quote .stars { color: #f5a524; letter-spacing: .1em; margin-bottom: .75rem; }
.quote blockquote { font-size: .95rem; color: var(--sg-text); flex: 1; margin: 0 0 1.25rem; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.faq .accordion-item { border: 1px solid var(--sg-border); border-radius: 12px !important; overflow: hidden; margin-bottom: .75rem; background: var(--sg-surface); }
.faq .accordion-button { font-weight: 600; background: var(--sg-surface); color: var(--sg-text); box-shadow: none; }
.faq .accordion-button:not(.collapsed) { color: var(--sg-primary); }
.faq .accordion-body { color: var(--sg-muted); }
.cta { border-radius: 24px; padding: 3.5rem 2rem; text-align: center; color: #dbe5f5; background: radial-gradient(800px 300px at 50% -20%, rgba(59, 130, 246, .45), transparent 70%), linear-gradient(160deg, #0a1220, #183463); }
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.cta p { color: #9fb2d1; max-width: 520px; margin: .75rem auto 1.75rem; }
.site-footer { padding: 3rem 0 2rem; border-top: 1px solid var(--sg-border); font-size: .875rem; color: var(--sg-muted); }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sg-text); margin-bottom: .9rem; }
.site-footer a { color: var(--sg-muted); }
.site-footer a:hover { color: var(--sg-text); }
.page-hero { padding: 4rem 0 2.5rem; text-align: center; background: radial-gradient(700px 300px at 50% -30%, rgba(59, 130, 246, .16), transparent 70%); }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.03em; }
.page-hero p { color: var(--sg-muted); max-width: 600px; margin: .75rem auto 0; font-size: 1.05rem; }
.prose p { color: var(--sg-muted); }
.prose strong { color: var(--sg-text); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.min-w-0 { min-width: 0; }
.gap-2-5 { gap: .75rem; }
.text-success-strong { color: var(--sg-success) !important; }
.text-danger-strong { color: var(--sg-danger) !important; }
.bg-surface { background: var(--sg-surface) !important; }
.border-dashed { border-style: dashed !important; }
.list-clean { list-style: none; padding: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Print: only the pass card (or .print-area) is printed
   -------------------------------------------------------------------------- */
@media print {
    @page { margin: 12mm; }
    body { background: #fff !important; }
    .sidebar, .topbar, .app-footer, .page-header, .no-print, .flash-stack, .site-nav, .site-footer { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
    .print-area { display: block !important; }
    .print-hide { display: none !important; }
    .pass-card { box-shadow: none; border: 1px solid #999; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .card { box-shadow: none; }
}

.flash-stack:empty { display: none; }
.topbar-btn.ring { animation: sg-ring .6s ease-in-out 2; }
@keyframes sg-ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.table-danger-subtle > * { --bs-table-bg: rgba(217, 45, 32, .04); }
[data-bs-theme="dark"] .table-danger-subtle > * { --bs-table-bg: rgba(255, 107, 94, .06); }
