:root {
    --primary: #16305c;
    --primary-dark: #101f3d;
    --accent-blue: #2f6fed;
    --accent-red: #d6394a;
    --navy: #16305c;
    --muted: #6b7280;
    --bg: #f4f5f8;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    color: #2b2b2b;
}

/* Top header */
.top-header {
    background: var(--primary);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
}
.top-header .brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.12);
    border-radius: 9px;
    margin-right: 10px;
    color: #fff;
}
.top-header .user-badge {
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: capitalize;
}
.top-header .btn-logout {
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}
.top-header .btn-logout:hover { background: #c22c3d; color: #fff; }

/* Layout */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 62px);
}

.sidebar {
    width: 230px;
    background: var(--primary);
    flex-shrink: 0;
    padding: 18px 12px;
}
.sidebar .nav-link {
    color: #cfd9ec;
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.94rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 0.95rem;
}
.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar .nav-link.active {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 600;
}

.main-content {
    flex-grow: 1;
    padding: 26px 28px;
}

/* Page header block (icon + title + subtitle) */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.page-header .page-icon {
    width: 42px;
    height: 42px;
    background: var(--navy);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.page-header h4 {
    margin: 0;
    color: var(--navy);
    font-weight: 700;
}
.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.auth-card {
    background: #fff;
    border-radius: 10px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.auth-card h3 { color: var(--primary-dark); font-weight: 700; }

/* Dashboard stat cards */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-card h3 { margin: 0; font-size: 1.6rem; color: var(--navy); font-weight: 700; }
.stat-card p { margin: 0; color: var(--muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; font-weight: 600; }

.stat-card.stat-blue   { border-left-color: #2f80ed; }
.stat-card.stat-blue   .icon-badge { background: rgba(47,128,237,0.12); color: #2f80ed; }
.stat-card.stat-purple { border-left-color: #8b5cf6; }
.stat-card.stat-purple .icon-badge { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-card.stat-orange { border-left-color: #f2a93c; }
.stat-card.stat-orange .icon-badge { background: rgba(242,169,60,0.15); color: #ce8623; }
.stat-card.stat-teal   { border-left-color: #14b8a6; }
.stat-card.stat-teal   .icon-badge { background: rgba(20,184,166,0.12); color: #0f9488; }
.stat-card.stat-green  { border-left-color: #22c55e; }
.stat-card.stat-green  .icon-badge { background: rgba(34,197,94,0.12); color: #22c55e; }
.stat-card.stat-red    { border-left-color: #e6435a; }
.stat-card.stat-red    .icon-badge { background: rgba(230,67,90,0.12); color: #e6435a; }

.card-panel {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.panel-header .panel-icon {
    width: 30px;
    height: 30px;
    background: var(--navy);
    color: #fff;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.panel-header h6 {
    margin: 0;
    color: var(--navy);
    font-weight: 700;
}

.highlight-box {
    background: linear-gradient(135deg, var(--navy), var(--accent-blue));
    color: #fff;
    border-radius: 14px;
    padding: 22px;
}
.highlight-box h2 { margin: 8px 0 4px; font-weight: 700; }
.highlight-box p { margin: 0; opacity: 0.85; font-size: 0.85rem; }
.highlight-box .icon-badge { background: rgba(255,255,255,0.18); color: #fff; }

table.table thead { background: #f8f9fb; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
table.table thead th { border-bottom: 1px solid #eee; font-weight: 600; }

.badge-status-active, .badge-submitted { background: #22c55e !important; }
.badge-status-inactive, .badge-late { background: #b3413b !important; }
.badge-checked { background: #2f80ed !important; }
.badge-pending { background: #f5a623 !important; color: #333 !important; }

@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: -230px;
        top: 62px;
        bottom: 0;
        transition: left 0.2s ease;
        z-index: 99;
        overflow-y: auto;
    }
    .sidebar.show { left: 0; }
    .stat-card { flex-wrap: wrap; }
}
