:root {
    --navy: #0b2a4a;
    --navy-deep: #071e36;
    --blue: #1769aa;
    --gold: #d69d28;
    --bg: #f4f7fa;
    --ink: #17212b;
    --muted: #667085;
    --line: #d9e1e8;
    --success: #147a42;
    --danger: #b42318;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(230px, 440px) minmax(300px, 1fr);
    align-items: center;
    gap: 20px;
    min-height: 68px;
    padding: 10px 24px;
    color: #fff;
    background: linear-gradient(110deg, var(--navy-deep), var(--navy));
    box-shadow: 0 2px 7px rgba(11, 42, 74, .18);
}

.topbar-start, .topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-actions { justify-content: flex-end; }

.sidebar-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: #fff;
    font-size: 18px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 7px;
}

.sidebar-toggle:hover, .sidebar-toggle:focus-visible {
    background: rgba(255, 255, 255, .22);
    outline: 2px solid #b8dcf8;
    outline-offset: 2px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 130px;
    height: 41px;
    padding: 4px 6px;
    object-fit: contain;
    object-position: left center;
    background: #fff;
    border-radius: 4px;
}

.brand-copy {
    display: grid;
    color: #fff;
    font-size: 12px;
    line-height: 1.15;
}

.brand-copy strong {
    font-size: 17px;
    letter-spacing: .5px;
}

.brand-copy span { opacity: .75; }

.brand-tagline {
    max-width: 440px;
    margin: 0 auto;
    color: #dbe8f4;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}

.locale-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 7px;
}

.locale-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 3px 7px;
    color: #dce8f4;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: .04em;
    border-radius: 5px;
}

.locale-option:hover, .locale-option:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    outline: 0;
}

.locale-option.active {
    color: var(--navy);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
}

.user-menu { position: relative; }

.user-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 4px 5px;
    list-style: none;
    cursor: pointer;
    border-radius: 8px;
}

.user-trigger::-webkit-details-marker { display: none; }
.user-trigger:hover, .user-menu[open] .user-trigger { background: rgba(255, 255, 255, .11); }

.user-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
    background: #edf5fb;
    border: 2px solid rgba(255, 255, 255, .42);
    border-radius: 50%;
}

.user-copy {
    display: grid;
    min-width: 0;
    color: #fff;
    line-height: 1.2;
}

.user-copy strong, .user-copy small {
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong { font-size: 13px; }
.user-copy small { color: #c9dcec; font-size: 11px; }
.chevron { margin-left: 1px; color: #c9dcec; font-size: 16px; }

.user-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 9px);
    right: 0;
    width: 250px;
    padding: 8px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, .18);
}

.user-dropdown-heading {
    display: grid;
    gap: 2px;
    padding: 9px 10px 11px;
    border-bottom: 1px solid var(--line);
}

.user-dropdown-heading strong { font-size: 13px; }
.user-dropdown-heading span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown a, .user-signout { display: block; width: 100%; padding: 9px 10px; color: #344054; text-align: left; text-decoration: none; background: transparent; border-radius: 6px; }
.user-dropdown a:hover, .user-signout:hover { color: var(--navy); background: #edf5fb; }
.user-dropdown form { margin: 0; }
.user-signout { font-weight: 650; cursor: pointer; border: 0; }

.shell {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    min-height: calc(100vh - 68px);
    transition: grid-template-columns .18s ease;
}

.sidebar {
    padding: 16px;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid var(--line);
}

.sidebar nav { display: grid; gap: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    color: #344054;
    text-decoration: none;
    border-radius: 7px;
}

.nav-link:hover, .nav-link:focus-visible {
    color: var(--navy);
    background: #eaf2f8;
    outline: 0;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav-icon {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: #4d6b83;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar .section {
    margin: 20px 10px 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.main {
    width: 100%;
    max-width: 1450px;
    padding: 28px;
    margin: 0 auto;
}

.auth {
    width: min(calc(100% - 32px), 510px);
    min-height: 100vh;
    padding: 22px 0 36px;
    margin: 0 auto;
}

.auth-page { display: grid; gap: 22px; }
.auth > .notice { margin: 0 0 2px; border: 1px solid transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.notice.success { border-color: #ccebd7; }
.notice.error { border-color: #f3c5c1; }

.auth-utility { display: flex; align-items: center; justify-content: flex-end; min-height: 34px; }
.auth-utility .auth-back-link { margin-right: auto; }
.auth-locale-switch { display: flex; gap: 3px; padding: 3px; background: #e8eff5; border: 1px solid #d4e0e9; border-radius: 8px; }
.auth-locale-switch a { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 3px 7px; color: #4a6378; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-decoration: none; border-radius: 5px; }
.auth-locale-switch a:hover, .auth-locale-switch a:focus-visible { color: var(--navy); background: #f6f9fb; outline: 0; }
.auth-locale-switch a.active { color: #fff; background: var(--navy); box-shadow: 0 1px 2px rgba(11, 42, 74, .16); }
.auth-back-link { display: inline-flex; align-items: center; gap: 6px; color: #4a6378; font-size: 13px; font-weight: 650; text-decoration: none; }
.auth-back-link:hover, .auth-back-link:focus-visible { color: var(--blue); text-decoration: underline; outline: 0; }

.auth-brand { text-align: center; }
.auth-brand img { display: block; width: min(100%, 270px); height: auto; margin: 0 auto 12px; }
.auth-brand p { max-width: 400px; margin: 0 auto; color: var(--navy); font-size: 14px; font-weight: 720; line-height: 1.45; }
.auth-brand-compact { margin: 2px 0 -2px; }
.auth-brand-compact img { width: 214px; margin-bottom: 0; }

.auth-card { padding: 30px; margin: 0; border-color: #d5e0e8; border-radius: 15px; box-shadow: 0 8px 24px rgba(11, 42, 74, .07); }
.auth-card-heading { margin-bottom: 24px; }
.auth-eyebrow { margin: 0 0 7px; color: #44718e; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.auth-card h1 { margin-bottom: 9px; color: var(--navy-deep); font-size: clamp(25px, 4.7vw, 31px); line-height: 1.16; }
.auth-card-heading > p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.auth-field { margin-top: 17px; }
.auth-field label { margin: 0 0 6px; color: #263746; font-size: 14px; }
.auth-field input { min-height: 45px; padding: 10px 12px; border-color: #b6c7d5; border-radius: 8px; }
.auth-field input:focus { border-color: #1769aa; outline: 3px solid rgba(23, 105, 170, .16); }
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 32px; height: 32px; padding: 0; place-items: center; color: #46647d; font-size: 0; line-height: 1; background: transparent; border-radius: 6px; transform: translateY(-50%); }
.password-toggle::before { width: 16px; height: 10px; content: ''; border: 1.8px solid currentColor; border-radius: 50%; }
.password-toggle::after { position: absolute; width: 4px; height: 4px; content: ''; background: currentColor; border-radius: 50%; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--blue); background: #edf5fb; outline: 0; }
.auth-actions { display: grid; gap: 13px; margin-top: 25px; }
.auth-primary-action { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 47px; padding: 10px 16px; font-size: 16px; border-radius: 8px; }
.auth-primary-action:hover, .auth-primary-action:focus-visible { background: #105a96; outline: 3px solid rgba(23, 105, 170, .17); outline-offset: 2px; }
.auth-text-link { justify-self: center; color: #24567b; font-size: 14px; font-weight: 700; text-decoration: none; }
.auth-text-link:hover, .auth-text-link:focus-visible { color: var(--blue); text-decoration: underline; outline: 0; }
.auth-help-text { display: flex; gap: 7px; margin: 21px 0 0; padding-top: 17px; color: #526a7d; font-size: 13px; line-height: 1.45; border-top: 1px solid #e2e9ee; }
.auth-help-text span { color: #39719a; font-size: 15px; }
.auth-footnote { display: flex; justify-content: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.auth-footnote > span { color: #416d8d; font-size: 15px; }

.card {
    padding: 22px;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { color: var(--navy); font-size: 30px; font-weight: 750; }
h1 { margin: 0 0 18px; font-size: 27px; }
h2 { margin: 0 0 12px; font-size: 19px; }
h3 { margin: 0 0 8px; font-size: 16px; }
label { display: block; margin: 12px 0 5px; font-weight: 650; }
input, select, textarea { width: 100%; padding: 9px; font: inherit; background: #fff; border: 1px solid #bcc8d4; border-radius: 6px; }
textarea { min-height: 100px; }
.catalog-picker { position: relative; }
.catalog-picker-input { padding-right: 32px; background-image: linear-gradient(45deg, transparent 48%, #5f7182 49%, #5f7182 52%, transparent 53%), linear-gradient(-45deg, transparent 48%, #5f7182 49%, #5f7182 52%, transparent 53%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 7px 7px; background-repeat: no-repeat; }
.catalog-picker-results { position: absolute; z-index: 15; top: calc(100% - 22px); right: 0; left: 0; max-height: 275px; padding: 5px; overflow: auto; background: #fff; border: 1px solid #9eb2c3; border-radius: 6px; box-shadow: 0 10px 20px rgba(16, 24, 40, .15); }
.catalog-picker-option { display: block; width: 100%; padding: 8px 9px; color: #223849; font-weight: 500; text-align: left; white-space: normal; background: transparent; border-radius: 5px; }
.catalog-picker-option:hover, .catalog-picker-option:focus-visible { color: var(--navy); background: #eaf2f8; outline: 0; }
.catalog-picker-empty { padding: 7px 9px; margin: 0; color: var(--muted); font-size: 13px; }
.field-help { display: block; min-height: 18px; margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
button, .button { display: inline-block; padding: 9px 13px; color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; background: var(--blue); border: 0; border-radius: 6px; }
.button.secondary, button.secondary { color: #164263; background: #eef3f7; }
.button.danger, button.danger { background: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.notice { padding: 12px 14px; margin-bottom: 15px; border-radius: 7px; }
.notice.success { color: #126437; background: #e8f7ed; }
.notice.error { color: #962018; background: #ffebe9; }
table { width: 100%; background: #fff; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.table-wrap { overflow: auto; }
.badge { display: inline-block; padding: 2px 9px; color: #344054; font-size: 12px; font-weight: 700; background: #eef2f6; border-radius: 999px; }
.badge.active, .badge.approved, .badge.published, .badge.paid, .badge.clean, .badge.processed { color: var(--success); background: #e7f6eb; }
.badge.pending, .badge.pending_review, .badge.under_review, .badge.partial, .badge.scheduled, .badge.uploaded, .badge.validated, .badge.new, .badge.in_progress, .badge.suspended { color: #946200; background: #fff4d6; }
.badge.returned, .badge.rejected, .badge.cancelled, .badge.failed, .badge.infected, .badge.error { color: var(--danger); background: #ffebe9; }
.badge.draft, .badge.archived, .badge.inactive, .badge.passive, .badge.resigned, .badge.deceased, .badge.terminated, .badge.closed, .badge.skip { color: #475467; background: #eef2f6; }
.badge.overpaid, .badge.insert, .badge.update { color: #175cd3; background: #eff8ff; }
.muted { color: var(--muted); }
.inline { display: inline; }
.split { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.small { font-size: 13px; }
.filter { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; align-items: start; }
.filter > div { min-width: 0; }
.filter .filter-submit { padding-top: 38px; }
.about-card { border-left: 4px solid var(--gold); }
.about-card p { max-width: 780px; margin: 0; }
.eyebrow { margin: 0 0 4px !important; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.clean-list { padding: 0; margin: 0; list-style: none; }
.clean-list li { display: flex; gap: 4px; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--line); }
.clean-list li:last-child { border-bottom: 0; }
.dashboard-lists { align-items: start; }
.company-heading, .company-list-name { display: flex; gap: 14px; align-items: center; }
.company-logo { width: 112px; height: 82px; padding: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.company-list-logo { flex: 0 0 auto; width: 48px; height: 48px; padding: 3px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.company-list-brand-logos { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.company-list-brand-logos img { width: 34px; height: 24px; padding: 2px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.company-brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.company-brand-card { display: flex; gap: 12px; align-items: center; min-height: 82px; padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.company-brand-card img { flex: 0 0 auto; width: 76px; height: 56px; padding: 4px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.company-brand-card p { margin: 5px 0 0; }
.company-brand-manager > summary { display: flex; gap: 9px; align-items: center; }
.company-brand-summary-logo { width: 42px; height: 30px; padding: 2px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.company-brand-manager-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 18px; padding: 8px 0 4px; align-items: start; }
.company-brand-logo-form { padding: 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.company-brand-logo-preview { display: grid; min-height: 92px; place-items: center; background: #fff; border: 1px dashed #b8c7d3; border-radius: 6px; }
.company-brand-logo-preview img { display: block; width: 100%; height: 88px; padding: 5px; object-fit: contain; }
.media-grid, .offering-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.media-card, .offering-card { padding: 12px; margin: 0; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.media-card img { display: block; width: 100%; height: 180px; object-fit: contain; background: #fff; border-radius: 5px; }
.media-card figcaption { padding-top: 8px; color: var(--muted); font-size: 13px; }
.offering-card h3 { margin-top: 4px; }
.offering-media-manager { padding: 18px 0 6px; margin-top: 18px; border-top: 1px solid var(--line); }
.offering-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 14px; }
.offering-gallery figure { margin: 0; }
.offering-gallery img { display: block; width: 100%; height: 140px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.offering-gallery figcaption { padding-top: 5px; color: var(--muted); font-size: 12px; }
.company-tabs { position: sticky; z-index: 10; top: 0; display: flex; gap: 5px; padding: 8px; margin: 0 0 18px; overflow-x: auto; background: rgba(244, 247, 250, .96); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 10px rgba(16, 24, 40, .06); backdrop-filter: blur(8px); }
.company-tab { flex: 1 0 auto; min-width: 130px; padding: 10px 14px; color: #38556c; background: transparent; border: 1px solid transparent; }
.company-tab:hover, .company-tab:focus-visible { color: var(--navy); background: #e8f1f7; outline: 2px solid #b8dcf8; outline-offset: 1px; }
.company-tab[aria-selected="true"] { color: #fff; background: var(--navy); box-shadow: 0 2px 5px rgba(11, 42, 74, .18); }
.company-tab-panel { scroll-margin-top: 78px; }
.wizard-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.wizard-step { display: block; padding: 11px 12px; color: var(--navy); font-weight: 700; text-align: center; background: #eef3f7; border: 1px solid var(--line); border-radius: 8px; }
.wizard-step.current { color: #fff; background: var(--navy); border-color: var(--navy); }
.wizard-step[aria-disabled="true"]:not(.current) { color: #66788a; opacity: .68; }
a.wizard-step:hover, a.wizard-step:focus-visible { outline: 2px solid #b8dcf8; outline-offset: 2px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
details { padding: 10px 0; border-bottom: 1px solid var(--line); }
details > summary { font-weight: 700; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 801px) {
    body.sidebar-collapsed .shell { grid-template-columns: 68px minmax(0, 1fr); }
    body.sidebar-collapsed .sidebar { padding: 16px 10px; }
    body.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding-right: 6px; padding-left: 6px; }
    body.sidebar-collapsed .sidebar .nav-label,
    body.sidebar-collapsed .sidebar .section { display: none; }
}

@media (max-width: 1080px) {
    .topbar { grid-template-columns: minmax(235px, 1fr) minmax(270px, 1fr); }
    .brand-tagline { display: none; }
}

@media (max-width: 800px) {
    .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; min-height: 60px; padding: 10px 14px; }
    .sidebar-toggle { display: grid; }
    .brand-logo { width: 108px; height: 35px; }
    .brand-copy { display: none; }
    .topbar-actions { gap: 7px; }
    .locale-option { min-height: 27px; padding: 3px 5px; }
    .locale-option > span:last-child { display: none; }
    .user-copy, .chevron { display: none; }
    .user-trigger { padding: 1px; }
    .user-dropdown { right: -4px; }
    .shell { display: block; min-height: auto; }
    .sidebar { display: none; padding: 9px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    body.mobile-nav-open .sidebar { display: block; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; }
    .sidebar .section { display: none; }
    .nav-link { min-height: 34px; padding: 6px 8px; }
    .nav-icon { display: none; }
    .nav-label { font-size: 13px; }
    .main { padding: 18px; }
    .split { flex-wrap: wrap; }
    .split > .button { margin-left: auto; }
    .row, .row.three, .filter { grid-template-columns: 1fr; }
    .company-brand-manager-grid { grid-template-columns: 1fr; }
    .filter .filter-submit { padding-top: 0; }
    .auth { width: min(calc(100% - 28px), 510px); padding-top: 14px; }
    .auth-page { gap: 18px; }
    .auth-card { padding: 24px 20px; }
    .auth-brand img { width: 235px; }
}

.company-record-dialog { box-sizing: border-box; width: min(760px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #071e364d; }
.company-record-dialog::backdrop { background: #071e36a6; }
.company-record-dialog h2 { margin: 0; }
.company-record-dialog .split { margin-bottom: 20px; }
