:root {
    --blue: #0f3f86;
    --blue-dark: #0a2d60;
    --gold: #f3b61f;
    --red: #b91c1c;
    --green: #15803d;
    --ink: #1f2937;
    --muted: #64748b;
    --line: #dbe3ef;
    --paper: #ffffff;
    --soft: #f5f7fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: var(--blue);
    color: #fff;
    border-bottom: 5px solid var(--gold);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
}

.agency {
    font-size: 12px;
    opacity: .9;
}

.brand {
    display: block;
    font-size: 24px;
    font-weight: 800;
}

.subbrand {
    font-size: 13px;
    opacity: .9;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    font-size: 14px;
}

.nav a {
    padding: 8px 10px;
    border-radius: 6px;
}

.nav a:hover {
    background: rgba(255, 255, 255, .14);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.nav-dropdown-toggle:hover,
.nav-dropdown:focus-within .nav-dropdown-toggle,
.nav-dropdown:hover .nav-dropdown-toggle {
    background: rgba(255, 255, 255, .14);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    z-index: 20;
    width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, .18);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
    gap: 4px;
}

.nav-dropdown-menu a {
    color: var(--ink);
    padding: 9px 10px;
}

.nav-dropdown-menu a:hover {
    background: #f1f5f9;
}

.hero {
    background: linear-gradient(120deg, var(--blue-dark), var(--blue));
    color: #fff;
    padding: 56px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr .7fr;
    gap: 32px;
    align-items: center;
}

.hero h1 {
    max-width: 780px;
    margin: 14px 0 12px;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05;
}

.hero p {
    max-width: 710px;
    color: #dbeafe;
    font-size: 18px;
}

.hero-panel {
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

.hero-panel h2 {
    margin-top: 0;
}

.flow {
    padding-left: 20px;
}

.flow li {
    margin: 12px 0;
}

.section {
    padding: 34px 0;
}

.split {
    background: #fff;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.card,
.form-card,
.table-wrap,
.list-item {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.card {
    display: block;
    padding: 20px;
}

.card span,
.badge,
.list-item span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    background: #eaf2ff;
    border: 1px solid #bcd2f3;
    border-radius: 999px;
    padding: 5px 10px;
}

.card strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.card p,
.muted,
.page-head p,
.list-item p {
    color: var(--muted);
}

.auth-link {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
}

.auth-link a {
    color: var(--blue);
    font-weight: 800;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary {
    background: var(--gold);
    color: #1f2937;
}

.btn.secondary {
    background: #fff;
    color: var(--blue-dark);
    border: 1px solid var(--line);
}

.btn.danger {
    background: #fee2e2;
    color: var(--red);
}

.btn.light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .55);
}

.btn.full {
    width: 100%;
    margin-top: 18px;
}

.actions.compact {
    margin-top: 0;
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}

.dll-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 24px;
    align-items: start;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.tab-btn {
    border: 1px solid var(--line);
    border-bottom: none;
    background: #e2e8f0;
    color: var(--muted);
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: var(--ink);
}

.tab-btn.active {
    background: var(--paper);
    color: var(--blue);
    padding-bottom: 13px;
    margin-bottom: -1px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-content-card {
    border: 1px solid var(--line);
    border-radius: 0 8px 8px 8px;
    background: var(--paper);
    padding: 24px;
}

.tab-content-card .form-card {
    margin-bottom: 0;
}

.pdf-preview {
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdf-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
}

.review-banner {
    width: 100%;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.pdf-preview:has(.review-banner) {
    display: block;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.section-head,
.page-head,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.section-head h2,
.page-head h1 {
    margin: 0;
}

.section-head a {
    color: var(--blue);
    font-weight: 700;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    padding: 18px;
}

.list-item h3 {
    margin: 6px 0;
}

.empty,
.notice {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.notice {
    margin-top: 18px;
}

.notice.success {
    border-color: #86efac;
    background: #f0fdf4;
}

.notice.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.narrow {
    max-width: 620px;
}

.form-card {
    padding: 26px;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.stats div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stats strong {
    display: block;
    font-size: 30px;
    color: var(--blue);
}

.stats span {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    padding: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: var(--blue-dark);
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    background: #e2e8f0;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status.approved {
    background: #dcfce7;
    color: var(--green);
}

.status.pending {
    background: #fef3c7;
    color: #92400e;
}

.status.returned {
    background: #fee2e2;
    color: var(--red);
}

.status.disapproved {
    background: #fee2e2;
    color: var(--red);
}

.status.inactive,
.status.suspended {
    background: #fee2e2;
    color: var(--red);
}

.status.active {
    background: #dcfce7;
    color: var(--green);
}

.inline {
    display: inline;
}

.mini {
    border: 0;
    border-radius: 5px;
    padding: 7px 9px;
    font-weight: 700;
    cursor: pointer;
}

.mini.approve {
    background: #dcfce7;
    color: var(--green);
}

.mini.return {
    background: #fee2e2;
    color: var(--red);
}

.footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 24px 0;
    margin-top: 30px;
}

@media (max-width: 860px) {
    .topbar-inner,
    .hero-grid,
    .two-col,
    .dll-grid,
    .page-head,
    .footer-inner {
        display: block;
    }

    .nav {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .nav-dropdown-menu {
        left: 0;
        right: auto;
    }

    .tab-content-card {
        padding: 16px;
    }

    .tab-btn {
        flex: 1 1 220px;
        border-bottom: 1px solid var(--line);
        border-radius: 8px;
    }

    .tab-btn.active {
        margin-bottom: 0;
        padding-bottom: 12px;
    }

    .cards,
    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .hero-panel {
        margin-top: 24px;
    }
}

@media (max-width: 560px) {
    .cards,
    .stats {
        grid-template-columns: 1fr;
    }
}

/* ── Category grouping ── */
.category-group { margin-bottom: 2rem; }
.category-heading {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--blue);
    border-bottom: 2px solid var(--line);
    padding-bottom: .4rem;
    margin-bottom: .75rem;
}
.section-block { margin-bottom: 2rem; }

/* ── Preview Modal ── */
.modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-box { position: relative; background: var(--paper); border-radius: 10px; padding: 1.25rem; width: 90vw; max-width: 960px; }
.modal-box.wide { width: 92vw; max-width: 1100px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.modal-head h3 { margin: 0; }

/* ── Alert ── */
.alert { padding: .65rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; }
.alert.success { background: #d1fae5; color: #065f46; }
.alert.error   { background: #fee2e2; color: #991b1b; }