/* ===========================================================
   Vivid MF SaaS — Modern Professional UI Stylesheet
   Design system: Glassmorphism + Navy/Gold/Pink color palette
   Fully responsive: Desktop / Tablet / Mobile
   =========================================================== */

:root {
    --color-navy: #081C3A;
    --color-navy-2: #0F2C59;
    --color-navy-3: #1A3C75;
    --color-gold: #F2B828;
    --color-gold-2: #FFD166;
    --color-pink: #FF2E79;
    --color-pink-2: #FF66A1;
    --color-blue: #2563EB;
    --color-cyan: #06B6D4;
    --color-green: #10B981;
    --color-red: #EF4444;
    --color-orange: #F97316;
    --color-text: #0F172A;
    --color-muted: #64748B;
    --color-border: rgba(15, 23, 42, 0.08);
    --color-border-strong: rgba(15, 23, 42, 0.14);
    --color-bg: linear-gradient(135deg, #F5F7FB 0%, #EAF0FB 100%);
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
    --shadow-glow-gold: 0 0 0 4px rgba(242, 184, 40, 0.15);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 72px;
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    font-family: var(--font-sans);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    font-size: 14.5px;
    line-height: 1.55;
}

body {
    background: var(--color-bg);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ============ TEXT / TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.01em; color: #0B1736; }
h1 { font-size: 2.0rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.08rem; }
h5 { font-size: 1rem; }
.text-muted { color: var(--color-muted) !important; }
.lead { font-size: 1.02rem; font-weight: 500; }

/* ============ APP WRAPPER & LAYOUT ============ */
.app-wrap { display: flex; min-height: 100vh; }

/* ============ SIDEBAR NAV (Professional SaaS — clean deep navy + premium gold accent) ============ */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 50;
    padding: 18px 12px 20px;
    color: #fff;
    transition: all 0.28s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.14) transparent;
    /* Solid deep navy (SaaS standard) + VERY subtle top gold premium highlight */
    background:
        radial-gradient(700px 220px at 50% -10%, rgba(242,184,40,0.10), transparent 65%),
        linear-gradient(180deg, #081B3E 0%, #0A204A 100%);
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: 4px 0 22px rgba(3, 12, 36, 0.14);
}
.sidebar::after {
    /* Very thin gold highlight line on the inside-left — Figma-style subtle premium feel */
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 1px; background: linear-gradient(180deg, rgba(242,184,40,0.25) 0%, rgba(217,24,103,0.15) 100%);
    pointer-events: none;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative;
}
.sidebar-brand::after {
    content: '';
    position: absolute; left: 20px; right: 20px; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(242,184,40,0.45), transparent);
}
.sidebar-brand img.brand-logo,
.sidebar-brand svg.brand-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 10px 20px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.sidebar-brand-text {
    display: flex; flex-direction: column; line-height: 1.05; min-width: 0;
}
.sidebar-brand-text .brand-big {
    font-weight: 800;
    font-size: 1.12rem;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    display: inline-flex; align-items: baseline; gap: 6px;
}
.sidebar-brand-text .brand-big .brand-erp {
    font-weight: 900;
    background: linear-gradient(90deg, #FFD463 0%, #F2B828 55%, #FFA63D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-brand-text .brand-tag {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.48);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 5px;
    font-weight: 700;
}

.sidebar-label {
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.40);
    padding: 16px 14px 8px;
}
.nav-list { list-style: none; padding: 0 4px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-list li.nav-item { }
.nav-list a.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 13px;
    border-radius: 10px;
    color: rgba(255,255,255,0.68);
    font-weight: 500;
    font-size: 0.94rem;
    text-decoration: none;
    transition: all 0.22s ease;
    border: 1px solid transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}
.nav-list a.nav-link i.nav-icon {
    width: 22px; height: 22px; line-height: 22px; text-align: center;
    font-size: 0.98rem;
    opacity: 0.88;
    flex-shrink: 0;
    color: rgba(255,255,255,0.72);
    transition: color 0.2s ease;
}
.nav-list a.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    transform: translateX(1px);
}
.nav-list a.nav-link:hover i.nav-icon { color: #FFD463; }

/* === Professional active state (NOT cheap AI blob gradient) === */
.nav-list a.nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.06);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.nav-list a.nav-link.active i.nav-icon {
    color: #F2B828;
}
.nav-list a.nav-link.active::before {
    /* Premium thin gold left-indicator bar — design system staple */
    content: '';
    position: absolute; left: -12px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #FFD463 0%, #F2B828 50%, #FF8FB8 100%);
    box-shadow: 0 0 0 3px rgba(242,184,40,0.10), 0 0 10px rgba(242,184,40,0.35);
}
.nav-list a.nav-link.active::after {
    /* Very subtle gold glow overlay */
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(242,184,40,0.08), transparent 75%);
    border-radius: inherit;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); padding: 18px 10px 20px; }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .nav-link span.nav-text { display: none !important; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 10px 0 18px; }
body.sidebar-collapsed .nav-list a.nav-link { justify-content: center; padding: 12px 0; }
body.sidebar-collapsed .nav-list a.nav-link.active::before { left: -10px; }
body.sidebar-collapsed ~ * .main { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.main {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    transition: margin-left 0.28s cubic-bezier(.2,.8,.2,1);
    display: flex;
    flex-direction: column;
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    padding: 0 26px;
    display: flex; align-items: center; gap: 16px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
}
.topbar .sidebar-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: #0B1736;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}
.topbar .sidebar-toggle-btn:hover {
    border-color: var(--color-navy-3);
    color: var(--color-navy);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.company-pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px; border-radius: 99px;
    background: rgba(242, 184, 40, 0.1);
    border: 1px solid rgba(242, 184, 40, 0.3);
    font-weight: 600;
}
.company-pill .company-code {
    background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-navy-3) 100%);
    color: #fff;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.branch-pill {
    display: inline-flex; align-items: center; gap: 6px;
    color: #0B1736;
    font-weight: 500;
    opacity: 0.92;
}
.branch-pill strong { color: var(--color-navy-2); font-weight: 700; }
.topbar-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 12px;
}
.topbar .form-select, .topbar .form-control {
    border-radius: 10px;
    border-color: var(--color-border-strong);
    background: #fff;
    padding-top: 0.45rem; padding-bottom: 0.45rem;
    font-weight: 500;
    box-shadow: var(--shadow-xs);
}
.user-menu {
    position: relative;
}
.user-menu .btn-user {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 8px 7px 14px;
    border-radius: 99px;
    border: 1px solid var(--color-border-strong);
    background: #fff;
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: var(--shadow-xs);
    color: #0B1736;
    font-weight: 600;
    font-size: 0.92rem;
}
.user-menu .btn-user:hover {
    border-color: var(--color-navy-3);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-navy-3) 0%, var(--color-pink) 100%);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    flex-shrink: 0;
}
.user-menu .dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 200px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 50;
    display: none;
}
.user-menu.open .dropdown-menu { display: block; animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: translateY(0);} }
.user-menu .dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #0B1736;
    text-decoration: none;
    font-weight: 500;
}
.user-menu .dropdown-menu a:hover { background: #F1F5FB; }
.user-menu .dropdown-menu a.logout { color: #B91C1C; }
.user-menu .dropdown-menu .divider {
    height: 1px; background: var(--color-border); margin: 6px 4px;
}

/* ============ PAGE CONTENT ============ */
.page-content {
    padding: 26px 28px 60px;
    flex: 1;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}
.page-title-row {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 14px;
    margin-bottom: 22px;
}
.page-title-row h4 {
    margin: 0;
    font-size: 1.38rem;
    font-weight: 800;
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(90deg, #0B1736 0%, #1e4490 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-title-row h4 i {
    background: linear-gradient(135deg, #eff4ff, #ffe8cc);
    -webkit-text-fill-color: initial;
    padding: 10px;
    border-radius: 12px;
    color: var(--color-navy-3);
    box-shadow: var(--shadow-xs);
    font-size: 1.05rem;
}
.page-title-row .subtitle {
    font-weight: 500;
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ============ BUTTONS (modern glass/gradient overrides) ============ */
.btn {
    border-radius: 11px !important;
    font-weight: 600 !important;
    padding: 0.55rem 1rem !important;
    box-shadow: var(--shadow-xs) !important;
    transition: all 0.22s ease !important;
    letter-spacing: 0.01em;
    font-size: 0.9rem !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md) !important; }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 0.35rem 0.75rem !important; border-radius: 9px !important; font-size: 0.8rem !important; }
.btn-lg { padding: 0.75rem 1.4rem !important; border-radius: 14px !important; font-size: 1rem !important; }

.btn-primary {
    background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 55%, #3B82F6 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32) !important;
    color: #fff !important;
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(37, 99, 235, 0.42) !important; }

.btn-success {
    background: linear-gradient(135deg, #047857 0%, #10B981 100%) !important;
    border-color: transparent !important;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28) !important;
    color: #fff !important;
}
.btn-danger {
    background: linear-gradient(135deg, #991B1B 0%, #EF4444 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.btn-warning {
    background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.btn-info {
    background: linear-gradient(135deg, #0E7490 0%, #06B6D4 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-info, .btn-outline-warning {
    background: #fff !important;
    -webkit-text-fill-color: initial !important;
}
.btn-outline-primary {
    color: var(--color-navy-3) !important;
    border-color: rgba(37, 99, 235, 0.28) !important;
}

/* ============ STAT CARDS (Glassmorphism KPIs) ============ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.stat-card {
    position: relative;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    overflow: hidden;
    transition: all 0.28s cubic-bezier(.2,.8,.2,1);
}
.stat-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 6px;
}
.stat-card.card-blue::before   { background: linear-gradient(180deg, #2563EB 0%, #60A5FA 100%); }
.stat-card.card-purple::before { background: linear-gradient(180deg, #7C3AED 0%, #C084FC 100%); }
.stat-card.card-green::before  { background: linear-gradient(180deg, #10B981 0%, #6EE7B7 100%); }
.stat-card.card-gold::before   { background: linear-gradient(180deg, #F59E0B 0%, #FCD34D 100%); }
.stat-card.card-pink::before   { background: linear-gradient(180deg, #DB2777 0%, #F472B6 100%); }
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 50px rgba(15, 23, 42, 0.14);
}
.stat-card .stat-icon {
    position: absolute; right: 16px; top: 18px;
    width: 52px; height: 52px;
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    opacity: 0.92;
}
.stat-card.card-blue .stat-icon   { background: rgba(37, 99, 235, 0.13); color: #1E40AF; }
.stat-card.card-purple .stat-icon { background: rgba(124, 58, 237, 0.13); color: #6D28D9; }
.stat-card.card-green .stat-icon  { background: rgba(16, 185, 129, 0.13); color: #047857; }
.stat-card.card-gold .stat-icon   { background: rgba(245, 158, 11, 0.13); color: #B45309; }
.stat-card.card-pink .stat-icon   { background: rgba(219, 39, 119, 0.13); color: #9D174D; }

.stat-card .stat-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 10px;
}
.stat-card .stat-value {
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0B1736;
    margin-bottom: 8px;
}
.stat-card.card-green .stat-value  { color: #047857; }
.stat-card.card-blue .stat-value   { color: #1E40AF; }
.stat-card.card-gold .stat-value   { color: #B45309; }
.stat-card.card-pink .stat-value   { color: #9D174D; }
.stat-card .stat-meta {
    font-size: 0.86rem;
    color: var(--color-muted);
    font-weight: 500;
}
.stat-card .stat-meta .success { color: #047857; font-weight: 700; }
.stat-card .stat-meta .warning { color: #B45309; font-weight: 700; }
.stat-card .stat-meta .danger  { color: #B91C1C; font-weight: 700; }

/* ============ CARDS / PANELS ============ */
.card {
    border: 1px solid var(--color-border) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
}
.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border) !important;
    padding: 16px 20px;
    font-weight: 700;
    color: #0B1736;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
    font-size: 1rem;
}
.card .card-header i { opacity: 0.9; }
.card .card-body { padding: 20px; }

/* ============ FORMS ============ */
.form-label {
    font-weight: 600;
    color: #0B1736;
    margin-bottom: 0.38rem;
    font-size: 0.88rem;
}
.form-control, .form-select, .input-group-text {
    border-radius: 10px !important;
    border-color: var(--color-border-strong) !important;
    padding: 0.6rem 0.85rem !important;
    background: #fff !important;
    font-weight: 500;
    box-shadow: var(--shadow-xs) !important;
    transition: all 0.2s ease !important;
}
.form-control:focus, .form-select:focus {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), var(--shadow-sm) !important;
    background: #fff !important;
}
.form-check-input {
    width: 1.05rem; height: 1.05rem;
    border-radius: 6px !important;
    border-color: var(--color-border-strong) !important;
    box-shadow: var(--shadow-xs);
}
.form-check-input:checked {
    background: linear-gradient(135deg, #1E3A8A, #2563EB);
    border-color: transparent !important;
}
.form-check.form-switch .form-check-input {
    height: 1.4rem;
    width: 2.5rem;
    border-radius: 999px !important;
}

/* ============ TABLES ============ */
.table {
    margin: 0 !important;
    --bs-table-bg: transparent !important;
}
.table thead th {
    background: linear-gradient(180deg, #F7F9FD 0%, #EEF3FC 100%) !important;
    color: #0B1736 !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--color-border) !important;
    border-top: none !important;
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 16px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--color-border);
    font-weight: 500;
    color: #0F172A;
    font-size: 0.92rem;
}
.table tbody tr:hover { background: rgba(37, 99, 235, 0.035); }
.table .text-end { text-align: right !important; }
.badge {
    border-radius: 99px !important;
    padding: 0.35rem 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
    font-size: 0.75rem !important;
}
.badge.bg-success { background: linear-gradient(135deg, #047857, #10B981) !important; }
.badge.bg-warning { background: linear-gradient(135deg, #B45309, #F59E0B) !important; color: #fff !important; }
.badge.bg-danger  { background: linear-gradient(135deg, #991B1B, #EF4444) !important; }
.badge.bg-info    { background: linear-gradient(135deg, #0E7490, #06B6D4) !important; }
.badge.bg-primary { background: linear-gradient(135deg, #1E3A8A, #2563EB) !important; }
.badge.bg-secondary{ background: linear-gradient(135deg, #334155, #64748B) !important; }

/* ============ BADGE-ACCENT (Status pills) ============ */
.badge-accent {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-accent::before {
    content: ''; display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
}
.badge-accent.green  { background: rgba(16,185,129,0.14);  color: #047857; }
.badge-accent.green::before  { background: #10B981; box-shadow: 0 0 0 4px rgba(16,185,129,0.18); }
.badge-accent.blue   { background: rgba(37,99,235,0.12);  color: #1E3A8A; }
.badge-accent.blue::before   { background: #2563EB; box-shadow: 0 0 0 4px rgba(37,99,235,0.16); }
.badge-accent.gold   { background: rgba(245,158,11,0.14); color: #B45309; }
.badge-accent.gold::before   { background: #F59E0B; box-shadow: 0 0 0 4px rgba(245,158,11,0.18); }
.badge-accent.red    { background: rgba(239,68,68,0.12);  color: #B91C1C; }
.badge-accent.red::before    { background: #EF4444; box-shadow: 0 0 0 4px rgba(239,68,68,0.16); }
.badge-accent.pink   { background: rgba(219,39,119,0.12); color: #9D174D; }
.badge-accent.pink::before   { background: #DB2777; box-shadow: 0 0 0 4px rgba(219,39,119,0.16); }
.badge-accent.gray   { background: rgba(100,116,139,0.14); color: #334155; }
.badge-accent.gray::before   { background: #64748B; box-shadow: 0 0 0 4px rgba(100,116,139,0.18); }

/* ============ PAGE-LEVEL PANEL GRID ============ */
.panel-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}
.panel-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* ============ LOGIN / AUTH PAGE (Landing) ============ */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 30px 20px;
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(255, 46, 121, 0.18) 0%, transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(37, 99, 235, 0.22) 0%, transparent 60%),
        linear-gradient(135deg, #081C3A 0%, #0E2E65 50%, #061A38 100%);
    position: relative;
    overflow: hidden;
}
.auth-wrap::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 40%);
    pointer-events: none;
}
.auth-card {
    position: relative;
    width: 100%;
    max-width: 980px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 30px;
    box-shadow: 0 50px 120px rgba(3, 12, 36, 0.55), 0 0 0 1px rgba(255,255,255,0.15);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 620px;
}
.auth-hero {
    background: linear-gradient(150deg, #081C3A 0%, #0E2C63 45%, #0A2254 100%);
    color: #fff;
    padding: 40px 38px;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-hero::before {
    content: '';
    position: absolute; right: -60px; top: -60px;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 46, 121, 0.35) 0%, transparent 70%);
}
.auth-hero::after {
    content: '';
    position: absolute; left: -80px; bottom: -80px;
    width: 360px; height: 360px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 184, 40, 0.22) 0%, transparent 70%);
}
.auth-hero-brand {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 14px;
}
.auth-hero-brand img { width: 54px; height: 54px; border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); object-fit: cover;}
.auth-hero-brand .brand-name {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff 30%, var(--color-gold-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.05;
}
.auth-hero-brand .brand-tag {
    font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    font-weight: 700;
    margin-top: 4px;
}
.auth-hero-copy { position: relative; z-index: 1; margin: 0 6px; }
.auth-hero-copy h1 {
    color: #fff;
    font-size: 2.1rem;
    line-height: 1.18;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    font-weight: 800;
}
.auth-hero-copy h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--color-gold-2) 0%, var(--color-pink-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-hero-copy p {
    color: rgba(255,255,255,0.78);
    line-height: 1.7;
    font-size: 1rem;
    font-weight: 400;
    max-width: 92%;
}
.auth-hero-features { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px;}
.auth-hero-features li {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    font-size: 0.95rem;
}
.auth-hero-features li .feat-ic {
    width: 32px; height: 32px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--color-gold-2);
    border-radius: 10px;
    font-size: 0.82rem;
}
.auth-hero-footer {
    position: relative; z-index: 1;
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    font-weight: 500;
}
.auth-hero-footer a { color: var(--color-gold-2); text-decoration: none; }

.auth-form {
    padding: 48px 44px;
    display: flex; flex-direction: column;
    justify-content: center;
}
.auth-form h2 {
    font-size: 1.85rem;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.auth-form .auth-sub {
    color: var(--color-muted);
    font-weight: 500;
    margin-bottom: 24px;
}
.auth-form .alert-flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
}
.auth-form .alert-flash.success {
    background: rgba(16,185,129,0.1);
    color: #047857;
    border: 1px solid rgba(16,185,129,0.25);
}
.auth-form .alert-flash.error {
    background: rgba(239,68,68,0.1);
    color: #B91C1C;
    border: 1px solid rgba(239,68,68,0.25);
}
.auth-form .alert-bag {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239,68,68,0.1);
    color: #B91C1C;
    border: 1px solid rgba(239,68,68,0.22);
    margin-bottom: 18px;
    font-size: 0.85rem;
    font-weight: 500;
}
.auth-form .alert-bag ul { margin: 4px 0 0 16px; padding: 0; }
.auth-form .auth-tip {
    margin-top: 10px; padding: 10px 12px;
    background: linear-gradient(90deg, rgba(242,184,40,0.11), rgba(255,46,121,0.08));
    border-radius: 10px;
    border: 1px dashed rgba(242,184,40,0.35);
    color: #643;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

/* ============ MOBILE MENU OVERLAY ============ */
.mobile-menu-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(3, 12, 36, 0.55);
    backdrop-filter: blur(3px);
    z-index: 45;
}
body.mobile-menu-open .mobile-menu-backdrop { display: block; }

/* ============ RESPONSIVE BREAKPOINTS ============ */
/* XL: >= 1400 default */
@media (max-width: 1399.98px) {
    .stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* LG LAPTOP: 992-1199 */
@media (max-width: 1199.98px) {
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-grid-2 { grid-template-columns: 1fr; }
    .panel-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-card { grid-template-columns: 1fr 1fr; min-height: 580px; }
    .auth-hero-copy h1 { font-size: 1.7rem; }
}
/* MD TABLET: 768-991 */
@media (max-width: 991.98px) {
    :root { --sidebar-w: 250px; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .page-content { padding: 20px 18px 40px; }
    .topbar { height: 66px; padding: 0 16px; }
    .topbar .company-pill .company-pill-text { display: none; }
    .auth-card { grid-template-columns: 1fr; max-width: 520px; border-radius: 24px; }
    .auth-hero { padding: 32px 28px; min-height: 320px; }
    .auth-form { padding: 36px 28px 44px; }
    .stat-card .stat-value { font-size: 1.7rem; }
    .panel-grid-3 { grid-template-columns: 1fr; }

    /* Sidebar becomes mobile drawer */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 18px 0 32px rgba(3, 12, 36, 0.35);
    }
    body.mobile-menu-open .sidebar { transform: translateX(0); }
    .main { margin-left: 0 !important; width: 100% !important; }
}
/* SM MOBILE: 576-767 */
@media (max-width: 767.98px) {
    .stats-row { grid-template-columns: 1fr; gap: 12px; }
    .page-title-row h4 { font-size: 1.2rem; }
    .page-title-row h4 i { padding: 8px; border-radius: 10px; font-size: 0.95rem; }
    .page-content { padding: 16px 14px 36px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar .branch-pill { display: none; }
    .user-menu .btn-user { padding: 6px 6px 6px 10px; }
    .user-menu .btn-user .user-name-text { display: none; }
    .card .card-body { padding: 16px 14px; }
    .card .card-header { padding: 14px 16px; }
    .table thead th { padding: 10px 12px !important; font-size: 0.74rem;}
    .table tbody td { padding: 12px 12px !important; font-size: 0.86rem;}
    .stat-card { padding: 16px 18px; border-radius: 18px; }
    .stat-card .stat-value { font-size: 1.55rem; }
    .auth-hero-copy h1 { font-size: 1.45rem; }
    .auth-hero { padding: 26px 22px; }
    .auth-form { padding: 28px 22px 36px; }
    .auth-form h2 { font-size: 1.55rem; }
}
/* XS PHONE: < 576 */
@media (max-width: 575.98px) {
    .stats-row { grid-template-columns: 1fr; }
    .page-title-row .btn { flex: 1 0 auto; width: 100%; }
    .topbar { gap: 6px; }
    .company-pill { padding: 5px 10px; }
    .company-pill .company-code { font-size: 0.68rem; }
    .stat-card .stat-icon { width: 42px; height: 42px; font-size: 1.05rem; border-radius: 12px; }
    .btn { width: 100%; }
    .auth-card { min-height: auto; }
}

/* ============ UTILITIES ============ */
.d-print-none { }
@media print {
    .sidebar, .topbar, .mobile-menu-backdrop, .no-print { display: none !important; }
    .main { margin-left: 0 !important; width: 100% !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
    body { background: #fff !important; }
}

/* ============ ANIMATIONS ============ */
.fade-in { animation: fade 0.28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

/* Pagination */
.pagination { gap: 6px; margin: 0; flex-wrap: wrap; }
.pagination .page-link {
    border-radius: 9px !important;
    border-color: var(--color-border-strong);
    color: #0B1736;
    background: #fff;
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}
