/* Crescent Royal BYM LTD — NIMC Agent Enrollment Report System
   Dependency-free stylesheet (no CDN, works offline on any host). */

:root {
    --navy-900: #0a1e3d;
    --navy-800: #0d2a52;
    --navy-700: #123566;
    --blue-500: #2e9fe0;
    --blue-600: #1f8bcb;
    --blue-100: #e7f4fc;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1a2433;
    --text-muted: #64748b;
    --success: #1a9e63;
    --success-bg: #e8f8f0;
    --danger: #d13b3b;
    --danger-bg: #fdeaea;
    --warning: #b7791f;
    --warning-bg: #fdf4e3;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(10, 30, 61, 0.08), 0 1px 2px rgba(10, 30, 61, 0.06);
    --shadow-md: 0 4px 16px rgba(10, 30, 61, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; color: var(--navy-900); }
p { margin: 0 0 1em; }
.text-muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* ── Layout shells ─────────────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 45%, var(--blue-600) 130%);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 32px 28px;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-name { font-size: 18px; font-weight: 800; color: var(--navy-900); letter-spacing: .3px; }
.auth-brand .brand-sub { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.auth-logo { width: 56px; height: 56px; margin: 0 auto 10px; display: block; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--navy-900);
    color: #cdd9ec;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    transform: translateX(0);
    transition: transform .2s ease;
    z-index: 40;
}
.sidebar-brand { padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { width: 34px; height: 34px; }
.sidebar-brand .name { color: #fff; font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.sidebar-brand .sub { font-size: 10.5px; color: #9db3d6; text-transform: uppercase; letter-spacing: .8px; }
.sidebar-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; color: #b9c8e3;
    font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar-nav a.active { background: var(--blue-600); color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: #8fa2c2; }

.main { margin-left: 240px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; color: var(--navy-900); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.topbar .user-chip .avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--blue-500); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }

.content { padding: 20px; max-width: 1180px; width: 100%; margin: 0 auto; }

@media (max-width: 880px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
}

/* ── Cards / stat grid ─────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-tile .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-tile .stat-value { font-size: 26px; font-weight: 800; color: var(--navy-900); margin-top: 4px; }
.stat-tile.accent-blue .stat-value { color: var(--blue-600); }
.stat-tile.accent-green .stat-value { color: var(--success); }
.stat-tile.accent-amber .stat-value { color: var(--warning); }
.stat-tile.accent-red .stat-value { color: var(--danger); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 8px; font-size: 14.5px; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; line-height: 1.2;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--navy-700); text-decoration: none; }
.btn-outline { background: #fff; color: var(--navy-800); border-color: var(--border); }
.btn-outline:hover { border-color: var(--blue-500); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b52d2d; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--navy-800); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--navy-800); margin-bottom: 6px; }
.form-control, select.form-control, textarea.form-control {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; background: #fff; color: var(--text); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.checkbox-row input { width: 16px; height: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

/* ── Alerts / flash ────────────────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: #0f6b45; border-color: #bfe8d3; }
.alert-error   { background: var(--danger-bg); color: #9c2626; border-color: #f3bcbc; }
.alert-warning { background: var(--warning-bg); color: #8a5a10; border-color: #f0d99b; }
.alert-info    { background: var(--blue-100); color: var(--navy-700); border-color: #bfe0f6; }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: #0f6b45; }
.badge-danger  { background: var(--danger-bg); color: #9c2626; }
.badge-warning { background: var(--warning-bg); color: #8a5a10; }
.badge-neutral { background: #eef1f6; color: var(--text-muted); }
.badge-blue    { background: var(--blue-100); color: var(--navy-700); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.8px; min-width: 560px; }
table.data-table th {
    text-align: left; background: #f8fafc; color: var(--text-muted); font-weight: 700;
    text-transform: uppercase; font-size: 11.5px; letter-spacing: .4px; padding: 11px 14px; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fafcff; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ── NIN search box ────────────────────────────────────────────────────── */
.search-box { display: flex; gap: 10px; }
.search-box .form-control { font-size: 18px; letter-spacing: 1px; font-weight: 600; }
@media (max-width: 560px) { .search-box { flex-direction: column; } }

.result-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.result-head { padding: 16px 20px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.result-head.found { background: var(--success-bg); color: #0f6b45; }
.result-head.notfound { background: #f3f4f6; color: var(--text-muted); }
.result-body { padding: 4px 20px 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-top: 12px; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
.field-row .field-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); font-weight: 700; }
.field-row .field-value { font-size: 15px; color: var(--text); margin-top: 2px; font-weight: 600; word-break: break-word; }

/* ── Bar chart (CSS only, no JS library) ──────────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart .bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--blue-500), var(--navy-700)); border-radius: 5px 5px 0 0; min-height: 3px; }
.bar-chart .bar-value { font-size: 11px; font-weight: 700; color: var(--navy-800); margin-bottom: 4px; }
.bar-chart .bar-label { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; text-align: center; }

/* ── Misc ──────────────────────────────────────────────────────────────── */
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filters-bar .form-group { margin-bottom: 0; min-width: 160px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,20,40,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; padding: 24px; box-shadow: var(--shadow-md); }
.progress-track { height: 10px; border-radius: 100px; background: #e6ecf5; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--navy-700)); width: 0%; transition: width .25s ease; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.kv-list { font-size: 13.8px; }
.kv-list div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.kv-list div:last-child { border-bottom: none; }
.no-select-warn { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
