:root {
    --brand-navy: #021088;        /* primary */
    --brand-navy-2: #010b5c;      /* darker primary (gradients / hovers) */
    --brand-blue: #021088;        /* primary (buttons, links) */
    --brand-blue-light: #3a46c0;  /* soft primary accent */
    --brand-gold: #fe5302;        /* secondary */
    --brand-gold-light: #ff7a3d;  /* soft secondary */
    --brand-light: #F5F7FA;
    --brand-gray: #6B7280;
    --brand-border: #E5E9F0;
    --sidebar-width: 256px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--brand-light);
    color: #1f2937;
    font-size: 0.925rem;
}

/* ---------------------------------------------------------------- Admin shell */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    color: #cdd7e6;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.app-sidebar .brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.15rem 1.25rem;
    color: #fff; font-weight: 700; font-size: 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-sidebar .brand .logo-badge {
    width: 38px; height: 38px; border-radius: 9px;
    background: var(--brand-gold);
    color: var(--brand-navy);
    display: grid; place-items: center;
    font-weight: 800;
}
.app-sidebar .nav-section {
    padding: 1rem 1.25rem .35rem;
    font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
    color: #7d8ba6;
}
.app-sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #cdd7e6; padding: .6rem 1.25rem;
    font-weight: 500; border-left: 3px solid transparent;
}
.app-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active {
    background: rgba(254,83,2,.16);
    color: #fff; border-left-color: var(--brand-gold);
}
.app-sidebar .brand .brand-logo-box {
    background: #fff; border-radius: 8px; padding: 5px 9px;
    display: inline-flex; align-items: center;
}
.app-sidebar .brand .brand-logo-box img { height: 42px; display: block; }

.app-main { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .25s ease; }
.app-topbar {
    background: #fff; border-bottom: 1px solid var(--brand-border);
    padding: .7rem 1.5rem; position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 1rem;
}
.app-content { padding: 1.5rem; }

/* Desktop: allow collapsing the sidebar with the topbar button */
@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .app-main { margin-left: 0; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

/* ---------------------------------------------------------------- Cards */
.card {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card-header {
    background: #fff; border-bottom: 1px solid var(--brand-border);
    font-weight: 600; padding: .85rem 1.15rem;
}
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon {
    width: 46px; height: 46px; border-radius: 11px;
    display: grid; place-items: center; font-size: 1.35rem;
}
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; color: var(--brand-navy); line-height: 1.1; }
.stat-card .stat-label { color: var(--brand-gray); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.text-navy { color: var(--brand-navy) !important; }
.text-gold { color: var(--brand-gold) !important; }
.bg-navy { background: var(--brand-navy) !important; }
.bg-gold { background: var(--brand-gold) !important; }
.bg-soft-blue { background: rgba(2,16,136,.10); color: var(--brand-blue); }
.bg-soft-gold { background: rgba(254,83,2,.12); color: #c2410c; }
.bg-soft-green { background: rgba(22,163,74,.12); color: #15803d; }
.bg-soft-red { background: rgba(220,38,38,.1); color: #dc2626; }

.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); }
.btn-primary:hover { background: var(--brand-navy-2); border-color: var(--brand-navy-2); }
.btn-gold { background: var(--brand-gold); border-color: var(--brand-gold); color: #fff; font-weight: 600; }
.btn-gold:hover { background: var(--brand-gold-light); border-color: var(--brand-gold-light); color: #fff; }
.btn-outline-navy { color: var(--brand-navy); border-color: var(--brand-navy); }
.btn-outline-navy:hover { background: var(--brand-navy); color:#fff; }
.btn-navy { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; font-weight: 600; }
.btn-navy:hover { background: var(--brand-navy-2); border-color: var(--brand-navy-2); color: #fff; }

.table { --bs-table-hover-bg: #f8fafc; }
.table thead th {
    background: #f8fafc; color: var(--brand-gray);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--brand-border); font-weight: 600;
}
.table td, .table th { vertical-align: middle; }

.badge-status { font-weight: 600; padding: .35em .65em; border-radius: 6px; }

.progress { background: #eef1f6; border-radius: 20px; height: 8px; }
.progress-bar { background: var(--brand-blue); }

.avatar-initials {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-blue); color: #fff;
    display: grid; place-items: center; font-size: .78rem; font-weight: 600;
}

.tab-pill .nav-link { color: var(--brand-gray); font-weight: 500; border-radius: 8px; }
.tab-pill .nav-link.active { background: var(--brand-navy); color: #fff; }

/* variance highlights */
.var-within { color: #15803d; }
.var-approaching { color: #b45309; }
.var-over { color: #dc2626; }
.row-over td { background: rgba(220,38,38,.05); }

/* ---------------------------------------------------------------- Public site */
.public-nav { background: rgba(11,37,69,.96); backdrop-filter: blur(6px); }
.public-nav .navbar-brand, .public-nav .nav-link { color: #fff !important; }
.public-nav .nav-link:hover { color: var(--brand-gold-light) !important; }
.hero {
    background:
      linear-gradient(120deg, rgba(11,37,69,.92), rgba(29,78,137,.82)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 39h40M39 0v40' stroke='%23ffffff10'/%3E%3C/svg%3E");
    color: #fff; padding: 7rem 0 6rem;
}
.hero h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 3.25rem); }
.section { padding: 5rem 0; }
.section-title { font-weight: 700; color: var(--brand-navy); }
.service-card { transition: transform .2s, box-shadow .2s; height: 100%; }
.service-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(11,37,69,.12); }
.service-icon {
    width: 60px; height: 60px; border-radius: 14px;
    background: rgba(201,162,39,.15); color: var(--brand-gold);
    display: grid; place-items: center; font-size: 1.7rem; margin-bottom: 1rem;
}
.stat-strip { background: var(--brand-navy); color: #fff; }
.stat-strip .num { font-size: 2.4rem; font-weight: 800; color: var(--brand-gold); }
.public-footer { background: var(--brand-navy); color: #aebbcf; padding: 3.5rem 0 1.5rem; }
.public-footer a { color: #aebbcf; text-decoration: none; }
.public-footer a:hover { color: #fff; }
