/* ============================================================
   Form-16A Download Portal — Stylesheet
   Font: Bricolage Grotesque (with graceful system-font fallback)
   ============================================================ */

/* Google Fonts Import for quick setup */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300..800&display=swap');

/* Local self-hosted font declaration fallbacks */
/*
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/BricolageGrotesque-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/BricolageGrotesque-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/BricolageGrotesque-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

:root {
    --font-main: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Palette — professional, insurance/finance oriented */
    --navy-900: #0b2545;
    --navy-900: #0b2545;
    --navy-800: #10315c;
    --navy-700: #16407a;
    --blue-600: #1c5cb8;
    --blue-500: #2b74d6;
    --teal-500: #0f9d8f;
    --gold-500: #c8952a;

    --ink-900: #14213d;
    --ink-700: #3a4a63;
    --ink-500: #64748b;
    --ink-300: #94a3b8;

    --surface-0: #ffffff;
    --surface-50: #f7f9fc;
    --surface-100: #eef2f7;
    --border-200: #e2e8f0;

    --success-600: #0f8a54;
    --success-100: #e4f7ee;
    --danger-600: #c0362c;
    --danger-100: #fbeae8;
    --muted-100: #f1f3f5;
    --muted-500: #9aa4b2;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.06);
    --shadow-md: 0 8px 24px rgba(11, 37, 69, 0.08);
    --shadow-lg: 0 20px 48px rgba(11, 37, 69, 0.14);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--surface-50);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ---------------- Login Layout ---------------- */

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface-0);
}

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}

.login-aside {
    background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--blue-600) 100%);
    color: #fff;
    padding: 56px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-aside::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -120px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 70%);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.2px;
}
.brand-mark .logo-dot {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-500), #e8b354);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy-900); font-weight: 800; font-size: 17px;
}

.aside-content h1 {
    font-size: 34px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 18px;
    max-width: 460px;
}
.aside-content p {
    font-size: 15.5px;
    color: rgba(255,255,255,0.78);
    line-height: 1.65;
    max-width: 420px;
    margin: 0 0 28px;
}

.aside-steps { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.aside-step { display: flex; gap: 14px; align-items: flex-start; }
.aside-step .num {
    flex: 0 0 30px; height: 30px; border-radius: 8px;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}
.aside-step .txt { font-size: 14px; color: rgba(255,255,255,0.85); line-height: 1.5; padding-top: 4px; }
.aside-step .txt b { color: #fff; }

.aside-foot { font-size: 12.5px; color: rgba(255,255,255,0.55); }

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--navy-900);
}
.login-card .sub {
    font-size: 14px;
    color: var(--ink-500);
    margin: 0 0 28px;
    line-height: 1.5;
}

.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--ink-500); margin-top: 6px; }

.input, select.input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14.5px;
    font-family: var(--font-main);
    border: 1.5px solid var(--border-200);
    border-radius: var(--radius-md);
    background: var(--surface-0);
    color: var(--ink-900);
    transition: border-color .15s ease, box-shadow .15s ease;
    letter-spacing: 0.3px;
}
.input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(43, 116, 214, 0.12);
}
.input::placeholder { color: var(--ink-300); letter-spacing: normal; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12.5px 18px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--blue-600), var(--navy-700));
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-secondary {
    background: var(--surface-100);
    color: var(--ink-700);
}
.btn-danger { background: var(--danger-600); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.5;
}
.alert-error { background: var(--danger-100); color: var(--danger-600); border: 1px solid rgba(192,54,44,0.18); }
.alert-success { background: var(--success-100); color: var(--success-600); border: 1px solid rgba(15,138,84,0.18); }
.alert-info { background: #eaf2fd; color: var(--blue-600); border: 1px solid rgba(43,116,214,0.18); }

.guide-box {
    margin-top: 26px;
    padding: 14px 16px;
    background: var(--surface-50);
    border: 1px dashed var(--border-200);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.6;
}
.guide-box b { color: var(--ink-700); }

/* ---------------- App Shell (Dashboard) ---------------- */

.app-header {
    background: var(--surface-0);
    border-bottom: 1px solid var(--border-200);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    position: sticky; top: 0; z-index: 10;
}
.app-header .brand-mark { color: var(--navy-900); }
.app-header .brand-mark .logo-dot { background: linear-gradient(135deg, var(--navy-800), var(--blue-600)); color:#fff; }

.header-right { display: flex; align-items: center; gap: 18px; }
.agent-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px 7px 7px;
    background: var(--surface-50);
    border: 1px solid var(--border-200);
    border-radius: 999px;
    font-size: 13px;
}
.agent-chip .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500), var(--teal-500));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12.5px;
}
.agent-chip .name { font-weight: 600; color: var(--ink-900); }
.agent-chip .code { color: var(--ink-500); font-size: 12px; }

.container { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }

.page-title { font-size: 26px; font-weight: 700; color: var(--navy-900); margin: 0 0 6px; }
.page-sub { color: var(--ink-500); font-size: 14.5px; margin: 0 0 32px; }

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 720px) { .summary-strip { grid-template-columns: repeat(2, 1fr); } }

.summary-card {
    background: var(--surface-0);
    border: 1px solid var(--border-200);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.summary-card .lbl { font-size: 12px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.summary-card .val { font-size: 22px; font-weight: 700; color: var(--navy-900); margin-top: 6px; }

.quarter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 720px) { .quarter-grid { grid-template-columns: 1fr; } }

.quarter-card {
    background: var(--surface-0);
    border: 1px solid var(--border-200);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.quarter-card .qc-top { display: flex; align-items: center; justify-content: space-between; }
.quarter-card .qc-title { display: flex; align-items: center; gap: 12px; }
.quarter-card .qc-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--surface-100);
    display: flex; align-items: center; justify-content: center;
    color: var(--navy-800); font-weight: 700; font-size: 14px;
}
.quarter-card.available .qc-icon { background: var(--success-100); color: var(--success-600); }
.quarter-card.unavailable .qc-icon { background: var(--muted-100); color: var(--muted-500); }

.quarter-card h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink-900); }
.quarter-card .period { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

.badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-available { background: var(--success-100); color: var(--success-600); }
.badge-na { background: var(--muted-100); color: var(--muted-500); }

.qc-meta { font-size: 12.5px; color: var(--ink-500); }
.qc-actions { display: flex; gap: 10px; margin-top: auto; }
.qc-actions .btn { flex: 1; }

.qc-empty-msg {
    font-size: 13px; color: var(--ink-500);
    background: var(--surface-50);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.footer-note {
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-300);
    margin-top: 40px;
}

/* ---------------- Admin ---------------- */

.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } .admin-sidebar { display:none; } }

.admin-sidebar {
    background: var(--navy-900);
    color: #fff;
    padding: 24px 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.admin-sidebar .brand-mark { color: #fff; padding: 6px 10px 26px; }
.admin-nav a {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 2px;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,0.12); color: #fff; font-weight: 600; }
.admin-sidebar .sidebar-foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,0.4); padding: 10px; }

.admin-main { padding: 32px 36px 60px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }

.card {
    background: var(--surface-0);
    border: 1px solid var(--border-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}
.card h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy-900); }
.card .card-sub { font-size: 13px; color: var(--ink-500); margin: 0 0 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
    text-align: left; padding: 12px 14px; background: var(--surface-50);
    color: var(--ink-500); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
    border-bottom: 1px solid var(--border-200);
}
table.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-200); color: var(--ink-900); }
table.data-table tr:hover td { background: var(--surface-50); }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.status-active { background: var(--success-100); color: var(--success-600); }
.status-inactive { background: var(--muted-100); color: var(--muted-500); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border-200); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-label { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.toggle-row .t-desc { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; max-width: 480px; }

.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border-200); border-radius: 999px; transition: .2s;
}
.slider::before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider { background: var(--blue-600); }
input:checked + .slider::before { transform: translateX(20px); }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: var(--surface-100); color: var(--ink-700); font-size: 12px; padding: 5px 10px; border-radius: var(--radius-sm); font-family: monospace; }

.link-btn { background: none; border: none; color: var(--blue-600); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); }
.link-btn:hover { background: var(--surface-100); }
.link-btn.danger { color: var(--danger-600); }

.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar .input { max-width: 320px; }

.kpi-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 780px) { .kpi-strip { grid-template-columns: repeat(2,1fr); } }
.kpi-card { background: var(--surface-0); border: 1px solid var(--border-200); border-radius: var(--radius-lg); padding: 18px 20px; }
.kpi-card .lbl { font-size: 12px; color: var(--ink-500); font-weight: 600; text-transform: uppercase; }
.kpi-card .val { font-size: 26px; font-weight: 700; color: var(--navy-900); margin-top: 6px; }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(11,37,69,0.45);
    display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal-box h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state .ico { font-size: 40px; margin-bottom: 12px; }
