/* =====================================================
 * AKA CRM - Premium Dark Theme + Full Mobile Responsive
 * ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
    --bg: #0b0f19;
    --surface: #131929;
    --surface-2: #1a2236;
    --border: #243050;
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --text: #f1f5f9;
    --muted: #64748b;
    --sidebar-w: 256px;
    --topbar-h: 56px;
    --radius: 14px;
    --radius-sm: 8px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    /* Prevent pinch-to-zoom */
    touch-action: pan-x pan-y;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ---------- LAYOUT SHELL ---------- */
.shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    z-index: 1000;
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 28px;
    padding: 0 4px;
    position: relative;
}
.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 18px; color: #fff;
    box-shadow: 0 4px 14px rgba(56,189,248,.35);
    flex-shrink: 0;
}
.brand-title {
    font-size: 19px; font-weight: 800; letter-spacing: .3px;
    background: linear-gradient(to right, #fff, var(--muted));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    white-space: nowrap;
    transition: opacity 0.2s;
}

/* Desktop Sidebar Toggle Button */
.sidebar-toggle-desktop {
    margin-left: auto;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s ease;
    flex-shrink: 0;
}
.sidebar-toggle-desktop:hover {
    background: rgba(56,189,248,.15);
    color: var(--primary);
    border-color: var(--primary);
}

/* Collapsed Sidebar State (Desktop) */
.sidebar.collapsed {
    width: 72px;
    padding: 20px 10px;
}
.sidebar.collapsed .brand-title,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-badge {
    display: none !important;
}
.sidebar.collapsed .brand {
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}
.sidebar.collapsed .brand-icon {
    margin: 0 auto;
}
.sidebar.collapsed .sidebar-toggle-desktop {
    position: absolute;
    top: -6px; right: -12px;
    width: 26px; height: 26px;
    font-size: 12px;
    background: var(--surface-2);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    z-index: 1001;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}
.sidebar.collapsed .nav-item i {
    font-size: 18px;
    margin: 0;
}
.sidebar.collapsed .user-profile {
    justify-content: center;
}

.nav-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: var(--muted);
    border-radius: 11px;
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: background .18s, color .18s;
    user-select: none;
    text-decoration: none;
    position: relative;
}
.nav-item i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: rgba(56,189,248,.1); color: var(--primary); }
.nav-item.active { background: rgba(56,189,248,.14); color: var(--primary); font-weight: 600; }

/* Task badge */
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* User profile row at sidebar bottom */
.user-profile {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
    background: rgba(239,68,68,.12); color: var(--danger);
    border: none; width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center; font-size: 15px;
    cursor: pointer; flex-shrink: 0; transition: background .18s;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

/* ============================================================
   MOBILE TOP BAR
   ============================================================ */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0; z-index: 900;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.mobile-topbar .brand { margin-bottom: 0; }
.hamburger-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border);
    color: #fff; width: 38px; height: 38px;
    border-radius: 10px; font-size: 16px;
    display: grid; place-items: center;
    cursor: pointer; flex-shrink: 0;
}

/* Sidebar backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.28s ease;
}
.main-content.expanded {
    margin-left: 72px;
}
.page-body {
    flex: 1;
    padding: 24px 24px 32px;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Page header (title + action button) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 22px; font-weight: 700; color: #fff;
    line-height: 1.2;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.card + .card { margin-top: 18px; }

/* Stat grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-val { font-size: 20px; font-weight: 700; color: #fff; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Table wrapper — enables horizontal scroll on mobile */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    /* min-width keeps table readable but allows parent to scroll */
    min-width: 560px;
}
thead th {
    background: rgba(0,0,0,.25);
    color: var(--muted); font-size: 12px; font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(36,48,80,.55);
    font-size: 13px;
    color: var(--text);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 700;
    white-space: nowrap;
}
.badge-ok  { background: rgba(16,185,129,.15); color: #34d399; }
.badge-warn { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-err  { background: rgba(239,68,68,.15); color: #f87171; }
/* legacy aliases used in JS */
.badge-approved { background: rgba(16,185,129,.15); color: #34d399; }
.badge-pending  { background: rgba(245,158,11,.15); color: #fbbf24; }
.badge-rejected { background: rgba(239,68,68,.15); color: #f87171; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    border: none; cursor: pointer;
    transition: filter .18s, transform .1s;
    white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary-dark); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover  { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }

/* Inputs */
.form-control {
    width: 100%;
    padding: 11px 13px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit; font-size: 14px;
    outline: none;
    transition: border-color .18s;
    -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); }
.form-label {
    display: block;
    color: var(--muted); font-size: 12px;
    margin-bottom: 5px;
}

/* Form group spacing */
.form-group { display: flex; flex-direction: column; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Thumbnail preview */
.thumb {
    width: 46px; height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 2000;
    padding: 12px;
}
.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90dvh;         /* dynamic viewport units for mobile browsers */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.6);
}

.modal-header {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}
.modal-title { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3; }
.btn-close {
    background: transparent; border: none;
    color: var(--muted); font-size: 22px;
    cursor: pointer; line-height: 1;
    flex-shrink: 0; padding: 2px;
}
.btn-close:hover { color: #fff; }

/* ============================================================
   CAMERA WIDGET
   ============================================================ */
.camera-box,
#flag-camera-container,
#task-camera-container,
#shift-camera-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
    aspect-ratio: 4/3;        /* scales proportionally on all devices */
    max-height: 36dvh;
    border: 2px solid var(--border);
    margin-bottom: 12px;
    /* Reset any inline height that may have been set */
    height: auto !important;
}
.camera-box video {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.live-badge {
    position: absolute; top: 9px; left: 9px;
    background: rgba(0,0,0,.65);
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; color: #4ade80;
    display: flex; align-items: center; gap: 6px;
}
.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 7px #4ade80;
}

/* Task photo thumbnails grid */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-item {
    position: relative; width: 62px; height: 62px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .rm-btn {
    position: absolute; top: 2px; right: 2px;
    background: rgba(239,68,68,.9); color: #fff;
    border: none; width: 19px; height: 19px;
    border-radius: 50%; font-size: 12px;
    display: grid; place-items: center;
    cursor: pointer;
}

/* thumbnail-preview alias used in JS */
.thumbnail-preview { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.task-photo-grid-item { position: relative; width: 62px; height: 62px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.task-photo-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.task-photo-grid-item .remove-photo-btn { position: absolute; top: 2px; right: 2px; background: rgba(239,68,68,.9); color: #fff; border: none; width: 19px; height: 19px; border-radius: 50%; font-size: 12px; display: grid; place-items: center; cursor: pointer; }

/* Info banner inside modals */
.info-banner {
    padding: 12px; border-radius: 10px;
    margin-bottom: 14px; font-size: 13px;
    line-height: 1.5;
}
.info-banner.blue  { background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.25); }
.info-banner.amber { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25); }
.info-banner-title { font-weight: 700; margin-bottom: 3px; }

/* ============================================================
   LOGIN PAGE — ULTRA MODERN GLASSMORPHISM & FULL RESPONSIVE
   ============================================================ */
.login-shell {
    position: relative;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #17223b 0%, #080c14 85%);
    padding: clamp(16px, 4vw, 32px);
    overflow: hidden;
}

/* Glowing Background Ambient Orbs */
.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.45;
}
.login-bg-glow.glow-1 {
    top: 15%; left: 20%;
    width: 320px; height: 320px;
    background: var(--primary);
    animation: glowPulse 7s ease-in-out infinite alternate;
}
.login-bg-glow.glow-2 {
    bottom: 15%; right: 20%;
    width: 380px; height: 380px;
    background: #0284c7;
    animation: glowPulse 9s ease-in-out infinite alternate-reverse;
}
@keyframes glowPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
    50% { transform: scale(1.15) translate(20px, -20px); opacity: 0.55; }
    100% { transform: scale(0.95) translate(-15px, 15px); opacity: 0.4; }
}

.login-card {
    position: relative;
    z-index: 5;
    background: rgba(19, 25, 41, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    padding: clamp(26px, 6vw, 38px) clamp(20px, 5vw, 32px);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(56, 189, 248, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-header {
    text-align: center;
    margin-bottom: 26px;
}
.login-brand-icon {
    width: 58px; height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: grid; place-items: center;
    font-size: 26px; color: #fff;
    margin: 0 auto 12px;
    box-shadow: 0 10px 26px rgba(56,189,248,0.4);
    animation: iconFloat 4s ease-in-out infinite;
}
@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.login-title {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
}
.login-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.4;
}

.login-input {
    height: 48px;
    font-size: 15px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border);
    color: #fff;
    padding: 0 14px;
    transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(56,189,248,0.25);
}
.login-btn {
    width: 100%;
    height: 50px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    justify-content: center;
    margin-top: 14px;
    box-shadow: 0 8px 20px rgba(56,189,248,0.3);
    transition: transform .18s, box-shadow .18s;
}
.login-btn:active {
    transform: scale(0.98);
}

/* Remember Me Row */
.login-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 12px;
}
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.remember-me-label input[type="checkbox"] {
    display: none;
}
.remember-me-box {
    width: 20px; height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.6);
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: all .2s ease;
    color: #10b981;
    font-size: 11px;
}
.remember-me-label input[type="checkbox"]:checked + .remember-me-box {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.remember-me-label input[type="checkbox"]:checked + .remember-me-box i {
    opacity: 1;
}
.remember-me-label input[type="checkbox"]:not(:checked) + .remember-me-box i {
    opacity: 0;
}
.remember-me-text {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    transition: color .2s;
}
.remember-me-label:hover .remember-me-text {
    color: var(--text);
}
.remember-me-label:hover .remember-me-box {
    border-color: rgba(56, 189, 248, 0.5);
}

/* Settings section grids */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================================================
   RESPONSIVE — LARGE/MEDIUM SCREENS (≤ 1360px)
   ============================================================ */
@media (max-width: 1360px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Slide sidebar off screen; open via .open class */
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.active { display: block; }

    /* Show mobile top bar */
    .mobile-topbar { display: flex; }

    /* Remove desktop left margin */
    .main-content { margin-left: 0; }

    /* Page body padding */
    .page-body { padding: 16px 12px 24px; }

    /* Page header: stack vertically */
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header .btn { width: 100%; justify-content: center; }

    /* Stats: 1 column on small screens */
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }

    /* 2-col rows inside modals → 1 column */
    .row-2 { grid-template-columns: 1fr; }

    /* Settings grids → 1 column */
    .settings-grid { grid-template-columns: 1fr; }

    /* Modal sizing */
    .modal-card {
        padding: 18px 14px;
        border-radius: 16px;
        max-width: 100%;
        max-height: 92dvh;
    }

    /* Camera box max height constraint */
    .camera-box { max-height: 30dvh; }

    /* Table card padding */
    .card { padding: 14px 10px; }

    /* Buttons full-width inside card actions */
    .btn { font-size: 13px; }
}

/* ============================================================
   RESPONSIVE — SMALL PHONES (≤ 420px)
   ============================================================ */
@media (max-width: 420px) {
    .page-title { font-size: 18px; }
    .stat-val { font-size: 18px; }
    .modal-title { font-size: 14px; }
    .brand-title { font-size: 16px; }
    thead th, tbody td { padding: 9px 10px; font-size: 12px; }

    /* Login responsiveness for small screens */
    .login-card { padding: 22px 16px; border-radius: 20px; }
    .login-brand-icon { width: 48px; height: 48px; font-size: 22px; margin-bottom: 8px; }
    .login-title { font-size: 20px; }
    .login-subtitle { font-size: 12px; }
    .login-input { height: 44px; font-size: 14px; }
    .login-btn { height: 46px; font-size: 15px; }
    .security-verify-box { padding: 10px; flex-wrap: wrap; }
    .verify-label { font-size: 12px; }
}

/* ============================================================
   SYSTEM SPLASH LOADER (AKA CRM)
   ============================================================ */
#splash-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #080c14;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#splash-loader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.splash-logo {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: grid; place-items: center;
    font-size: 32px;
    box-shadow: 0 10px 30px rgba(56,189,248,.4);
    animation: splashPulse 1.8s infinite ease-in-out;
    margin-bottom: 14px;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(56,189,248,.4); }
    50% { transform: scale(1.08); box-shadow: 0 14px 40px rgba(56,189,248,.7); }
}
.splash-title {
    font-size: 26px; font-weight: 800; color: #fff;
    letter-spacing: 1px; margin-bottom: 14px;
}
.splash-spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(56,189,248,.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.splash-subtitle {
    font-size: 13px; color: var(--muted); letter-spacing: .5px;
}

/* ============================================================
   FULLSCREEN GLASSMORPHISM SYSTEM LOCK OVERLAYS (BLOCKED & OFFLINE)
   ============================================================ */
.system-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(8, 12, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.system-lock-card {
    background: rgba(19, 25, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 36px 28px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    animation: lockCardPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes lockCardPop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
.system-lock-icon {
    font-size: 54px;
    margin-bottom: 16px;
}
.system-lock-title {
    font-size: 20px; font-weight: 800; color: #fff;
    margin-bottom: 10px; line-height: 1.3;
}
.system-lock-desc {
    font-size: 14px; color: var(--muted);
    line-height: 1.6; margin-bottom: 18px;
}
.system-lock-info {
    font-size: 12px; color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 10px 14px; border-radius: 10px;
}
.system-lock-spinner {
    font-size: 13px; color: var(--danger);
    font-weight: 600;
}

/* ============================================================
   CLOUDFLARE TURNSTILE STYLE SECURITY VERIFICATION WIDGET
   ============================================================ */
/* ============================================================
   CLOUDFLARE TURNSTILE STYLE SECURITY VERIFICATION WIDGET
   ============================================================ */
.security-verify-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.security-verify-box:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
.verify-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.verify-checkbox-wrapper {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    position: relative;
    flex-shrink: 0;
}
.verify-custom-box {
    width: 24px; height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    display: grid; place-items: center;
    color: #10b981;
    font-size: 14px;
    transition: all .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.security-verify-box.verified .verify-custom-box {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
.verify-text-group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.verify-label {
    font-size: 13.5px;
    color: #f1f5f9;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.verify-sublabel {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.verify-spinner {
    width: 22px; height: 22px;
    border: 2.5px solid rgba(56, 189, 248, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.verify-right {
    text-align: right;
    flex-shrink: 0;
}
.verify-shield-badge {
    font-size: 12px; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: 5px; justify-content: flex-end;
}
.verify-links {
    font-size: 10px; color: var(--muted); margin-top: 2px;
}

/* ============================================================
   PRINT / PDF EXPORT STYLES
   ============================================================ */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .sidebar, .mobile-topbar, .btn, .btn-close, .hamburger-btn, #splash-loader, .system-lock-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }
    .card { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; box-shadow: none !important; margin-bottom: 20px !important; }
    table { min-width: 100% !important; }
    th { background: #f1f5f9 !important; color: #000 !important; }
    td { color: #000 !important; border-bottom: 1px solid #ddd !important; }
    .badge-approved { background: #d1fae5 !important; color: #065f46 !important; }
    .badge-rejected { background: #fee2e2 !important; color: #991b1b !important; }
    .page-title { color: #000 !important; }
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

/* Shake animation for verify box when user skips verification */
@keyframes verifyShake {
    0%   { transform: translateX(0); }
    12%  { transform: translateX(-8px) rotate(-1deg); }
    24%  { transform: translateX(8px) rotate(1deg); }
    36%  { transform: translateX(-7px); }
    48%  { transform: translateX(7px); }
    60%  { transform: translateX(-4px); }
    72%  { transform: translateX(4px); }
    84%  { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}
