/* =====================================================================
   Starr Vantage™ portal — design tokens & components
   ===================================================================== */
:root {
    --red: #c8212f;
    --red-600: #b41c29;
    --red-bright: #e0313c;
    --red-tint: #fdf2f3;
    --red-border: #f3c5c9;
    --navy: #1c2b4a;
    --navy-700: #24365a;
    --navy-900: #141d31;
    --navy-tint: #eef1f6;
    --navy-border: #d5dce7;
    --teal: #0b7a6b;
    --teal-bright: #2bb39a;
    --teal-tint: #e6f3f0;
    --teal-border: #b9ddd6;
    --green: #2e7d32;
    --green-tint: #e8f5e9;
    --slate: #546e7a;
    --slate-tint: #eef1f3;
    --slate-border: #d3dadf;
    --amber: #e9a012;
    --amber-text: #b45309;
    --amber-tint: #fff8e7;
    --amber-border: #f4d58c;
    --orange: #ea8a0b;
    --orange-tint: #fef6ea;
    --orange-border: #f6d7a7;
    --blue: #1565c0;
    --blue-tint: #e8f0fb;
    --purple: #6d28d9;
    --purple-tint: #f1eafd;
    --starr-dot: #5e7ce2;

    --ink: #1e293b;
    --text: #334155;
    --muted: #64748b;
    --muted-2: #8492a6;
    --line: #e2e8f0;
    --line-2: #d4dae2;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #f8fafc;

    --font-display: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
    --font-ui: 'Roboto', 'Segoe UI', system-ui, sans-serif;

    --radius: 6px;
    --radius-lg: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }

.icon { flex: none; display: inline-block; vertical-align: middle; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Top call bar ---------- */
.topbar {
    background: var(--red);
    color: #fff;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    padding: 0 16px;
}
.topbar .icon { opacity: .95; }
.topbar a { font-weight: 800; margin-left: 12px; }
.topbar--public { height: 42px; font-size: 15px; }
.topbar--public a { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; margin-left: 16px; }

/* ---------- Brand ---------- */
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 21px;
    letter-spacing: .085em;
    color: var(--navy);
}
.brand-sub {
    font-size: 11.5px;
    letter-spacing: .19em;
    font-weight: 600;
    color: var(--muted);
    margin-top: 6px;
    text-transform: uppercase;
}
.brand--light .brand-title { color: #fff; }
.brand--light .brand-sub { color: #8d9ab0; }

/* ---------- Public site header / footer ---------- */
.site-header {
    height: 81px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.site-links { display: flex; align-items: center; font-size: 15px; color: #475569; }
.site-links > * + * { border-left: 1px solid var(--line-2); margin-left: 24px; padding-left: 24px; }
.site-links a:hover { color: var(--navy); }
.site-links .back { color: var(--navy); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.site-links .site-link-public { color: var(--red); font-weight: 800; display: inline-flex; align-items: center; gap: 7px; }
.site-links .site-link-public:hover { color: var(--red-600); }

/* Public Portal entry points on the sign-in page: hero button and panel card. */
.public-cta {
    display: flex; align-items: center; gap: 16px; margin-top: 30px; padding: 16px 20px;
    background: #fff; color: var(--navy); border-radius: var(--radius-lg); border-left: 5px solid var(--red);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22); transition: transform .12s ease, box-shadow .12s ease;
}
.public-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.public-cta-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: grid; place-items: center; flex: none; }
.public-cta-title { display: block; font-weight: 900; font-size: 18px; }
.public-cta-sub { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.public-card {
    display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px 20px;
    background: var(--red); color: #fff; border-radius: var(--radius-lg);
}
.public-card:hover { background: var(--red-600); }
.public-card-title { display: block; font-weight: 800; font-size: 16.5px; }
.public-card-sub { display: block; font-size: 13.5px; opacity: .85; margin-top: 2px; }
.public-card .grow, .public-cta .grow { flex: 1; min-width: 0; }

.site-footer {
    background: var(--navy-900);
    color: #8a94a6;
    height: 58px;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14.5px;
}
.site-footer nav { display: flex; gap: 24px; }
.site-footer a:hover { color: #fff; }

/* ---------- Sign-in / request split layout ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.auth { flex: 1; display: flex; }
.hero-pattern {
    background-color: var(--navy);
    background-image:
        linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
    background-size: 36px 36px;
}
.auth-hero {
    flex: 1;
    border-left: 5px solid var(--red);
    padding: 72px 62px 64px;
    color: #fff;
}
.auth-hero-inner { max-width: 520px; }
.auth-panel { width: 552px; flex: none; background: #fff; padding: 78px 58px 56px; }
.auth-panel--wide { width: 624px; padding-top: 66px; }

.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 13px;
    border: 1px solid rgba(224, 49, 60, .6);
    background: rgba(200, 33, 47, .15);
    color: #f35a67;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .12em;
    border-radius: 4px;
    text-transform: uppercase;
    line-height: 20px;
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 46px;
    line-height: 1.1;
    margin: 34px 0 22px;
    letter-spacing: -.005em;
}
.hero-title--sm { font-size: 38px; margin: 30px 0 22px; line-height: 1.12; }
.hero-title .accent { color: var(--red-bright); }
.hero-lead { font-size: 18px; line-height: 1.68; color: rgba(255, 255, 255, .72); font-weight: 400; }
.hero-lead--sm { font-size: 17px; line-height: 1.6; }

.feature-list { list-style: none; margin: 50px 0 0; padding: 0; display: grid; gap: 22px; }
.feature-list li { display: flex; gap: 14px; }
.feature-check {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(200, 33, 47, .22);
    color: var(--red-bright);
    display: grid; place-items: center;
    flex: none; margin-top: 1px;
}
.feature-title { font-size: 16.5px; font-weight: 600; color: #fff; }
.feature-desc { font-size: 16px; color: rgba(255, 255, 255, .74); margin-top: 2px; }

.iso-card {
    margin-top: 56px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px 12px 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .05);
    border-radius: var(--radius);
}
.iso-card .icon { color: rgba(255, 255, 255, .7); }
.iso-title { font-weight: 800; font-size: 15.5px; letter-spacing: .02em; }
.iso-sub { font-size: 13.5px; color: rgba(255, 255, 255, .6); }

.hero-note {
    margin-top: 52px;
    max-width: 480px;
    min-height: 144px;
    display: flex;
    gap: 12px;
    padding: 22px 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .06);
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .66);
}
.hero-note .icon { margin-top: 4px; color: rgba(255, 255, 255, .6); }

.panel-title { font-family: var(--font-display); font-weight: 900; font-size: 32px; color: var(--navy); line-height: 1.2; }
.panel-sub { font-size: 16px; color: var(--muted-2); margin-top: 10px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { margin-bottom: 24px; display: flex; flex-direction: column; min-width: 0; }
.field-label {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 9px;
    display: flex;
    align-items: baseline;
}
.field-label .req { color: var(--red); margin-left: 6px; }
.field-label a { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--red); font-weight: 500; font-size: 15px; }
.field-label--muted { color: var(--muted); font-size: 12.5px; letter-spacing: .08em; }
.input, .select, .textarea {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--radius);
    background: #fff;
    padding: 0 15px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #a3adbb; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(28, 43, 74, .12); }
.input:disabled, .input[readonly] { background: #f1f5f9; color: var(--muted-2); }
.input--sm { height: 44px; font-size: 15.5px; }
.select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.select:invalid, .select option[value=""] { color: #475569; }
.textarea { height: 120px; padding: 12px 15px; resize: vertical; line-height: 1.5; }
.field-help { font-size: 14px; color: var(--muted); margin-top: 8px; }
.validation-message, .field-error { color: var(--red); font-size: 13.5px; margin-top: 6px; }
.invalid { border-color: #e7959c !important; }
.validation-errors { margin: 0 0 18px; padding: 12px 16px 12px 34px; background: var(--red-tint); border: 1px solid var(--red-border); border-radius: var(--radius); color: var(--red-600); font-size: 14.5px; }

.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14.5px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.5;
}
.alert .icon { margin-top: 2px; }
.alert--error { background: var(--red-tint); border: 1px solid var(--red-border); color: var(--red-600); }
.alert--success { background: var(--green-tint); border: 1px solid #b9dcbc; color: var(--green); }
.alert--info { background: var(--navy-tint); border: 1px solid var(--navy-border); color: var(--navy); }
.alert-link { word-break: break-all; font-family: Consolas, monospace; font-size: 12.5px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; margin-top: 8px; color: var(--ink); user-select: all; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 46px;
    padding: 0 26px;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { height: 51px; font-size: 17px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: var(--red-600); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy-700); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: #276b2b; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: #eef1f6; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover:not(:disabled) { border-color: #9aa6b6; }
.btn-outline-navy { background: #fff; color: var(--navy); border: 2px solid var(--navy); font-family: var(--font-body); font-weight: 800; height: 43px; font-size: 15.5px; padding: 0 30px; }
.btn-outline-navy:hover { background: var(--navy); color: #fff; }
.btn-outline-red { background: #fff; color: var(--red); border-color: #efa9af; }
.btn-outline-red:hover:not(:disabled) { background: var(--red-tint); }

/* Row action buttons ("View PDF", "Open Link" …) */
.doc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 35px; min-width: 97px; padding: 0 19px;
    border-radius: 5px;
    font-family: var(--font-ui); font-weight: 700; font-size: 14.5px;
    color: #fff; background: var(--red); white-space: nowrap;
    transition: filter .15s;
}
.doc-btn:hover { filter: brightness(.92); }
.doc-btn--image { background: var(--blue); }
.doc-btn--sheet { background: var(--green); }
.doc-btn--ai { background: var(--purple); }
.doc-btn--link { background: var(--navy); }
.doc-btn--file { background: var(--slate); }

.icon-btn {
    width: 34px; height: 34px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
    border-radius: var(--radius);
    color: #475569;
}
.icon-btn:hover { background: #fff; color: var(--navy); border-color: #a8b3c2; }

/* ---------- App navigation bar ---------- */
.appnav {
    background: var(--navy);
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 38px;
    gap: 22px;
    border-bottom: 3px solid var(--red);
    position: relative;
    z-index: 5;
}
.appnav-divider { width: 1px; height: 40px; background: rgba(255, 255, 255, .18); }
.appnav-links { display: flex; gap: 6px; }
.appnav-link { color: rgba(255, 255, 255, .75); font-size: 15.5px; padding: 7px 14px; border-radius: var(--radius); }
.appnav-link:hover { color: #fff; }
.appnav-link.active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 800; }
.appnav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.portalnav {
    background: var(--navy);
    height: 67px;
    display: flex;
    align-items: center;
    padding: 0 36px 0 48px;
    gap: 22px;
    position: relative;
    z-index: 5;
}
.portalnav-back { color: rgba(255, 255, 255, .72); font-size: 15.5px; display: inline-flex; align-items: center; gap: 8px; }
.portalnav-back:hover { color: #fff; }
.portalnav-signin { height: 38px; padding: 0 18px; font-size: 15px; gap: 7px; white-space: nowrap; }
.portalnav-title { color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.nav-badge {
    font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    padding: 2px 10px; border-radius: 4px; line-height: 20px;
    background: rgba(255, 255, 255, .14); color: #c9d2df;
}
.nav-badge--red { background: rgba(224, 49, 60, .28); color: #f7a3aa; }
.nav-badge--teal { background: rgba(43, 179, 154, .22); color: #6fd8c3; }
.nav-badge--amber { background: rgba(245, 166, 35, .28); color: #f7c24f; }

.nav-search { position: relative; width: 240px; }
.nav-search input {
    width: 100%; height: 37px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius);
    color: #fff; padding: 0 12px 0 38px; font: inherit; font-size: 15px;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, .5); }
.nav-search input:focus { outline: none; border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1); }
.nav-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .55); pointer-events: none; }

/* Avatar + menu */
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 900; font-size: 15px;
    flex: none; letter-spacing: .01em;
}
.avatar--navy { background: var(--navy); }
.avatar--teal { background: var(--teal); }
.avatar--lg { width: 53px; height: 53px; font-size: 19px; }
.avatar--xl { width: 80px; height: 80px; font-size: 27px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line-2); }
.avatar-menu { position: relative; }
.avatar-menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.avatar-menu summary::-webkit-details-marker { display: none; }
.avatar-menu[open] summary .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.avatar-dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    width: 250px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    padding: 6px; z-index: 50;
}
.avatar-dropdown .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar-dropdown .who strong { display: block; color: var(--ink); font-size: 15px; }
.avatar-dropdown .who span { color: var(--muted); font-size: 13px; word-break: break-all; }
.avatar-dropdown a, .avatar-dropdown button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border-radius: 5px; border: 0; background: none;
    font-size: 14.5px; color: var(--text); text-align: left;
}
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: var(--surface-2); color: var(--navy); }
.avatar-dropdown form { margin: 0; }
.avatar-dropdown .danger { color: var(--red); }

/* ---------- Hub ---------- */
.hub-hero { height: 158px; padding: 38px 48px 0; color: #fff; }
.hub-hero .kicker { font-size: 14px; letter-spacing: .12em; font-weight: 800; color: rgba(255, 255, 255, .55); text-transform: uppercase; }
.hub-hero h1 { font-family: var(--font-display); font-weight: 900; font-size: 34px; margin-top: 8px; line-height: 1.2; }
.hub-hero p { font-size: 16.5px; color: rgba(255, 255, 255, .6); margin-top: 6px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hub-body { padding-top: 46px; padding-bottom: 64px; }

.label-caps { font-size: 13.5px; font-weight: 800; letter-spacing: .1em; color: #7b8ba3; text-transform: uppercase; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.muted { color: var(--muted-2); }

.resource-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 18px 0 50px; }
.resource-tile {
    display: flex; align-items: center; gap: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; min-height: 83px; box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
.resource-tile:hover { border-color: #b8c2d0; box-shadow: var(--shadow); }
.resource-icon { width: 42px; height: 42px; border-radius: var(--radius); background: #f0f3f7; color: var(--navy); display: grid; place-items: center; flex: none; }
.resource-title { font-weight: 800; font-size: 16px; color: var(--ink); line-height: 1.3; }
.resource-sub { font-size: 13.5px; color: var(--muted-2); }

.resource-grid--compact { grid-template-columns: 1fr 1fr; gap: 11px; margin: 16px 0 0; }
.resource-grid--compact .resource-tile { background: var(--surface-2); border-color: var(--line); box-shadow: none; padding: 16px 16px 16px 26px; min-height: 78px; gap: 18px; }
.resource-grid--compact .resource-tile > .icon { color: var(--navy); }
.resource-grid--compact .resource-title { font-size: 14.5px; }
.resource-grid--compact .resource-sub { font-size: 12.5px; margin-top: 3px; }

.portal-cards { display: grid; gap: 21px; margin-top: 20px; }
.portal-card {
    background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--accent);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.portal-card-body { padding: 24px 24px 36px; }
.portal-card-head { display: flex; gap: 16px; align-items: center; }
.portal-icon { width: 45px; height: 45px; border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--tint); color: var(--accent); flex: none; }
.portal-kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; }
.portal-name { font-family: var(--font-display); font-weight: 900; font-size: 21px; color: var(--navy); line-height: 1.2; margin-top: 2px; }
.portal-desc { font-size: 14.5px; color: #475569; margin-top: 22px; }
.portal-card-foot { border-top: 1px solid var(--line); background: #f6f8fa; height: 47px; display: flex; align-items: center; padding: 0 24px; }
.portal-card-foot a, .portal-card-foot button {
    color: var(--red); font-weight: 800; font-size: 15.5px; display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 0; padding: 0;
}
.portal-card-foot a:hover { gap: 9px; }
.portal-card-foot .muted-action { color: var(--muted-2); }
.portal-card-foot .muted-action:hover:not(:disabled) { color: var(--navy); }
.portal-card-foot .requested { color: var(--amber-text); cursor: default; }
.portal-card--locked { --accent: var(--slate); --tint: var(--slate-tint); }
.portal-card--locked .portal-icon { color: var(--slate); }

/* Role / portal accents: Customer = navy, Distributor = orange, Employee = teal, Admin = red */
.accent-customer { --accent: var(--navy); --tint: var(--navy-tint); }
.accent-distributor { --accent: var(--orange); --tint: var(--orange-tint); }
.accent-employee { --accent: var(--teal); --tint: var(--teal-tint); }
.accent-admin { --accent: var(--red); --tint: var(--red-tint); }

/* ---------- Page header (white band under the nav) ---------- */
.page-head {
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-left: 6px solid var(--stripe, transparent);
    padding: 30px 44px 28px 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.page-head--plain { border-left: 0; padding-left: 43px; }
.page-head h1 { font-family: var(--font-display); font-weight: 900; font-size: 27px; color: var(--navy); line-height: 1.25; margin-top: 8px; }
.page-head .sub { font-size: 15.5px; color: var(--muted-2); margin-top: 6px; }
.crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; color: var(--muted-2); }
.crumbs a:hover { color: var(--navy); }
.crumbs .icon { color: #a5b0bf; }

.stat-cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.stat-card {
    display: flex; align-items: center; gap: 14px;
    min-width: 135px; min-height: 60px; padding: 10px 20px;
    border: 1px solid var(--line-2); background: var(--surface-2);
    border-radius: var(--radius);
}
.stat-card .icon { color: var(--num, var(--navy)); }
.stat-num { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--num, var(--navy)); line-height: 1.05; }
.stat-label { font-size: 13.5px; color: var(--muted); }
.stat-card--red { --num: var(--red); background: var(--red-tint); border-color: var(--red-border); }
.stat-card--orange { --num: var(--orange); background: var(--orange-tint); border-color: var(--orange-border); }
.stat-card--slate { --num: var(--slate); }
.stat-card--amber { --num: var(--amber); background: #fef9e8; border-color: var(--amber-border); }
.stat-card--stack { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 110px; padding: 10px 20px; }

.user-chip { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 18px; border-radius: var(--radius); background: var(--teal-tint); border: 1px solid var(--teal-border); }
.user-chip strong { color: var(--teal); display: block; font-size: 15px; }
.user-chip span { color: var(--muted-2); font-size: 13.5px; }

/* ---------- Document groups ---------- */
.doc-page { padding: 36px 24px 64px; }
.doc-container { max-width: 944px; margin: 0 auto; }
.doc-container--wide { max-width: 1066px; }

.section-heading {
    display: flex; align-items: center; gap: 16px;
    font-size: 13px; font-weight: 800; letter-spacing: .1em; color: #7b8ba3; text-transform: uppercase;
    margin: 30px 0 16px;
}
.section-heading::after { content: ""; flex: 1; height: 1px; background: #dfe4ea; }
.section-heading:first-child { margin-top: 0; }

.doc-group { background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 14px; }
.doc-group > summary {
    list-style: none; cursor: pointer; user-select: none;
    height: 52px; padding: 0 24px; display: flex; align-items: center; gap: 13px;
    background: var(--gh, var(--navy)); color: #fff;
}
.doc-group > summary::-webkit-details-marker { display: none; }
.doc-group-title { font-family: var(--font-ui); font-weight: 500; font-size: 16.5px; flex: 1; }
.doc-group-count { font-size: 13.5px; color: rgba(255, 255, 255, .62); display: flex; align-items: center; gap: 12px; }
.doc-group-count .icon { transition: transform .2s; }
.doc-group:not([open]) .doc-group-count .icon { transform: rotate(-90deg); }
.gh-red { --gh: var(--red); }
.gh-navy { --gh: var(--navy); }
.gh-teal { --gh: var(--teal); }
.gh-green { --gh: var(--green); }
.gh-slate { --gh: var(--slate); }

.doc-group--light > summary { background: #e3e8ef; color: var(--ink); height: 54px; padding: 0 28px 0 26px; }
.doc-group--light .doc-group-title { font-size: 17px; }
.doc-group--light .doc-group-count { color: var(--muted-2); font-size: 14.5px; }
.doc-group--light > summary > .icon { color: #475569; }

.doc-row {
    display: flex; align-items: center; gap: 14px;
    min-height: 66px; padding: 12px 24px 12px 22px;
    border-top: 1px solid #edf0f4;
}
.doc-group > .doc-row:first-of-type { border-top: 0; }
.doc-row-main { flex: 1; min-width: 0; }
.doc-row-title { font-size: 15.5px; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-row-sub { font-size: 13.5px; color: var(--muted-2); margin-top: 1px; }
.doc-group--light .doc-row { min-height: 68px; padding-left: 22px; padding-right: 28px; }

.new-tag { background: var(--red); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .06em; padding: 1px 7px; border-radius: 3px; line-height: 17px; }

.file-badge {
    width: 38px; height: 38px; flex: none; border-radius: var(--radius);
    display: grid; place-items: center;
    font-family: var(--font-ui); font-weight: 900; font-size: 11.5px; letter-spacing: .02em;
    background: #fdeced; color: var(--red);
}
.file-badge--lg { width: 40px; height: 40px; font-size: 12.5px; }
.file-badge--jpg { background: var(--blue-tint); color: var(--blue); }
.file-badge--jpg-green { background: #e8f5e9; color: #2e7d32; }
.file-badge--xls { background: #e8f5e9; color: var(--green); }
.file-badge--ai { background: var(--purple-tint); color: var(--purple); }
.file-badge--url { background: #eef1f5; color: var(--navy); font-size: 10.5px; }
.file-badge--file { background: #eef1f5; color: var(--slate); font-size: 10px; }

.info-banner {
    display: flex; gap: 14px; align-items: center;
    padding: 16px 24px; margin-bottom: 30px;
    border: 1px solid var(--teal-border); border-left: 5px solid var(--teal);
    background: var(--teal-tint); border-radius: var(--radius);
    font-size: 15px; color: var(--text); line-height: 1.6;
}
.info-banner .icon { color: var(--teal); }
.info-banner strong { color: var(--teal); }

.empty-state { background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; color: var(--muted); }
.empty-state .icon { color: #a5b0bf; margin-bottom: 10px; }

/* ---------- Starr portal (sidebar layout) ---------- */
.with-sidebar { display: flex; min-height: calc(100vh - 38px - 67px); }
.sidebar { width: 288px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 30px 12px; }
.sidebar-label { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: #7b8ba3; text-transform: uppercase; padding: 0 12px; margin: 0 0 10px; }
.sidebar-label:not(:first-child) { margin-top: 30px; }
.side-link { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 12px; border-radius: var(--radius); color: var(--text); font-size: 15.5px; }
.side-link:hover { background: var(--surface-2); color: var(--navy); }
.side-link.active { background: #eef2f7; color: var(--navy); font-weight: 800; }
.side-link .icon { color: #64748b; }
.side-link.active .icon { color: var(--navy); }
.side-link .grow { flex: 1; }
.side-link .ext { color: #9aa6b6; }
.pill-new { background: var(--red); color: #fff; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 1px 8px; line-height: 18px; }
.pill-count { background: #e5e9ef; color: var(--muted); font-size: 12px; font-weight: 800; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-content { padding: 34px 43px 60px; flex: 1; }

.incident-alert {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 22px 14px 26px; border: 1px solid var(--red-border); border-left: 5px solid var(--red);
    background: #fdf4f4; border-radius: var(--radius); font-size: 15.5px; color: var(--ink);
}
.incident-alert > .icon { color: var(--red); }
.incident-alert strong { color: var(--red); font-weight: 800; }
.incident-alert .text { flex: 1; }
.incident-alert .btn { height: 42px; padding: 0 20px; font-size: 16px; }

.main-content .section-heading { margin-top: 44px; margin-bottom: 22px; }
.main-content .section-heading:first-child { margin-top: 0; }

.quick-grid { display: flex; flex-wrap: wrap; gap: 18px; }
.quick-tile { width: 208px; min-height: 130px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.quick-tile:hover { border-color: #b8c2d0; box-shadow: var(--shadow); }
.quick-icon { width: 42px; height: 42px; border-radius: var(--radius); display: grid; place-items: center; background: var(--tint, #eef2f7); color: var(--accent, var(--navy)); }
.quick-tile--red { --tint: #fdeeee; --accent: var(--red); }
.quick-title { font-weight: 800; color: var(--ink); font-size: 15.5px; margin-top: auto; padding-top: 22px; }
.quick-sub { font-size: 14px; color: var(--muted-2); }


.lms-banner {
    display: flex; align-items: center; gap: 24px;
    border-top: 5px solid var(--red); border-radius: var(--radius-lg);
    background: var(--navy); color: #fff; padding: 30px 38px 30px 38px;
}
.lms-icon { width: 59px; height: 59px; border-radius: var(--radius-lg); border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); display: grid; place-items: center; flex: none; }
.lms-banner h3 { font-family: var(--font-display); font-weight: 900; font-size: 20px; }
.lms-banner p { color: rgba(255, 255, 255, .6); font-size: 15.5px; margin-top: 2px; }
.lms-banner .grow { flex: 1; }

/* ---------- Catalog ---------- */
.filter-bar { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 43px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-label { font-size: 13.5px; color: var(--muted); font-weight: 700; margin-right: 4px; }
.chip {
    height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
    background: #fff; color: var(--ink); font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body);
}
.chip:hover { border-color: #9aa6b6; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-search { margin-left: auto; position: relative; width: 288px; }
.filter-search input { width: 100%; height: 37px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 12px 0 38px; font: inherit; font-size: 15px; color: var(--ink); }
.filter-search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(28, 43, 74, .1); }
.filter-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.result-line { font-size: 13.5px; color: var(--muted-2); padding: 12px 43px; border-bottom: 1px solid var(--line); background: var(--bg); }
.result-line strong { color: var(--ink); }

.catalog { max-width: 1200px; margin: 0 auto; padding: 30px 24px 64px; }
.line-heading { font-size: 14px; font-weight: 900; letter-spacing: .08em; color: var(--navy); text-transform: uppercase; margin: 36px 0 6px; display: flex; gap: 10px; align-items: baseline; }
.line-heading:first-child { margin-top: 0; }
.line-heading span { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted-2); }
.series-heading { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; margin: 18px 0 12px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.product-card:hover { border-color: #b8c2d0; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.product-img { height: 214px; display: grid; place-items: center; background: #fff; border-bottom: 1px solid #eef1f5; padding: 16px; }
.product-img img { max-height: 182px; width: auto; object-fit: contain; }
.product-info { padding: 16px 20px 14px; flex: 1; }
.product-title { font-weight: 800; font-size: 15px; color: var(--ink); line-height: 1.35; }
.product-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.size-chip { font-size: 11.5px; font-weight: 700; color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 7px; background: var(--surface-2); }
.product-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid #eef1f5; }
.product-foot .kind { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted-2); text-transform: uppercase; }
.btn-xs { height: 30px; padding: 0 12px; border-radius: 5px; background: var(--navy); color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.btn-xs:hover { background: var(--navy-700); }

/* ---------- Product detail ---------- */
.crumb-bar { background: #fff; border-bottom: 1px solid var(--line); height: 58px; display: flex; align-items: center; padding: 0 45px; }
.product-head { background: #fff; border-bottom: 1px solid var(--line); padding: 38px 24px; }
.product-head-inner { max-width: 1066px; margin: 0 auto; display: flex; gap: 44px; align-items: flex-start; }
.product-thumb { width: 168px; height: 144px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); display: grid; place-items: center; background: #fff; flex: none; padding: 12px; }
.product-thumb img { max-height: 118px; width: auto; }
.product-eyebrow { color: var(--red); font-weight: 800; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin-top: 10px; }
.product-head h1 { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--navy); margin-top: 12px; line-height: 1.2; }
.product-body { padding-top: 60px; }
.product-body .section-heading { margin: 36px 0 16px; }
.product-body .section-heading:first-child { margin-top: 0; }
.product-body .doc-group { margin-bottom: 13px; border-radius: var(--radius-lg); }

/* ---------- Profile & admin cards ---------- */
.page-wrap { padding: 35px 24px 64px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 382px; gap: 26px; max-width: 1114px; margin: 0 auto; align-items: start; }
.two-col--admin { grid-template-columns: minmax(0, 1fr) 408px; max-width: 1210px; }
.stack { display: grid; gap: 26px; align-content: start; }
.stack-sm { display: grid; gap: 12px; align-content: start; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head {
    height: 54px; padding: 0 27px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 15px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.card-head .icon { color: #8492a6; }
.card-head .right { margin-left: auto; font-size: 14.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted-2); }
.card-body { padding: 27px; }
.card-body--roomy { padding: 30px 30px 32px; }
.card--danger { border-color: var(--red-border); }
.card--danger .card-head { background: var(--red-tint); color: var(--red); border-bottom-color: var(--red-border); }
.card--danger .card-head .icon { color: var(--red); }
.card-text { font-size: 15.5px; color: #475569; line-height: 1.7; }

.person-head { background: #eef2f7; padding: 22px 30px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); }
.person-name { font-family: var(--font-display); font-weight: 900; font-size: 19px; color: var(--navy); display: flex; align-items: center; gap: 14px; }
.person-email { font-size: 14.5px; color: var(--muted-2); }
.dot-status { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-body); font-size: 13px; font-weight: 800; color: var(--green); background: var(--green-tint); padding: 1px 8px; border-radius: 999px; }
.dot-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot-status--muted { color: var(--muted); background: #eef1f5; }
.dot-status--red { color: var(--red); background: var(--red-tint); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; row-gap: 22px; }
.info-label { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.info-value { font-size: 16.5px; color: var(--ink); margin-top: 4px; word-break: break-word; }
.message-box { margin-top: 28px; background: #f1f5f9; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; }
.message-box .info-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.message-box .info-label .req { color: var(--red); }
.message-box p { font-size: 16px; line-height: 1.95; color: var(--ink); white-space: pre-wrap; }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 16px; }
.pw-meter span { height: 3px; border-radius: 2px; background: #e2e8f0; transition: background .2s; }
.pw-meter[data-score="1"] span:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--amber); }
.pw-meter[data-score="3"] span:nth-child(-n+3) { background: #5fae4f; }
.pw-meter[data-score="4"] span { background: var(--green); }

.access-item { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px 0 20px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); font-size: 16.5px; color: var(--ink); }
.access-item .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: none; }
.access-item .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 2px 10px; line-height: 18px; white-space: nowrap; }
.pill-green { background: var(--green-tint); color: var(--green); }
.pill-gray { background: #fff; color: var(--muted-2); border: 1px solid var(--line-2); font-weight: 700; }
.pill-amber { background: var(--amber-tint); color: var(--amber-text); border: 1px solid var(--amber-border); }
.pill-red { background: var(--red-tint); color: var(--red); border: 1px solid var(--red-border); }
.pill-lg { font-size: 16px; padding: 6px 16px; }
.pill-md { font-size: 15px; padding: 4px 14px; }
.note { font-size: 14.5px; color: var(--muted-2); margin-top: 20px; line-height: 1.7; }
.note a { color: var(--navy); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

.detail-list .info-label { font-size: 12.5px; }
.detail-list .info-value { font-size: 16.5px; margin: 4px 0 18px; }
.detail-list > :last-child { margin-bottom: 0; }

/* ---------- Toggles ---------- */
.toggle-list { display: grid; gap: 12px; }
.toggle-row {
    display: flex; align-items: center; gap: 14px;
    min-height: 67px; padding: 12px 20px 12px 22px;
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
    transition: background .15s, border-color .15s;
}
.toggle-row .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: none; }
.toggle-row .grow { flex: 1; min-width: 0; }
.toggle-row .name { font-size: 16.5px; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toggle-row .desc { font-size: 14px; color: var(--muted-2); }
.toggle-row.on { background: var(--tint); border-color: var(--tint-border, var(--line-2)); }
.toggle-group { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.toggle-group .toggle-row { border: 0; border-radius: 0; }
.toggle-group.on { background: var(--tint); border-color: var(--tint-border, var(--line-2)); }
.toggle-sub { display: flex; align-items: center; min-height: 46px; padding: 8px 20px 8px 52px; background: #e6ebf1; border-top: 1px solid var(--line-2); font-size: 15px; font-weight: 700; color: #3b4a5f; }
.toggle-sub .grow { flex: 1; }
.toggle-sub.disabled { color: #94a3b8; }
.accent-customer.toggle-row { --tint-border: #cfd6e2; }
.accent-distributor.toggle-row { --tint-border: var(--orange-border); }
.accent-employee.toggle-row { --tint-border: var(--teal-border); }
.accent-admin.toggle-row { --tint-border: var(--red-border); }
.requested-tag { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--amber-text); background: var(--amber-tint); border: 1px dashed #e9b44c; border-radius: 4px; padding: 0 6px; line-height: 17px; text-transform: uppercase; }

.switch { position: relative; display: inline-block; width: 43px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #e2e8f0; transition: background .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .slider { background: var(--accent, var(--navy)); }
.switch input:checked + .slider::before { transform: translateX(19px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled + .slider { cursor: not-allowed; opacity: .5; }

.link-back { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted-2); font-size: 15.5px; margin-top: 4px; }
.link-back:hover { color: var(--navy); }

.meta-lines { text-align: right; font-size: 15.5px; color: var(--muted-2); display: grid; gap: 4px; }
.meta-lines div { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.head-right { display: flex; align-items: center; gap: 18px; }

/* ---------- Admin: manage users ---------- */
.admin-filter { background: #fff; border-bottom: 1px solid var(--line); min-height: 67px; padding: 12px 48px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-filter .filter-label { font-size: 15px; color: var(--muted); margin-right: 8px; }
.admin-filter .chip { height: 31px; padding: 0 18px; font-size: 15px; }
.legend { background: #fff; border-bottom: 1px solid var(--line); min-height: 48px; padding: 8px 48px; display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 16px; height: 16px; border-radius: 3px; display: inline-block; }
.legend i.has { background: var(--navy); }
.legend i.req { border: 2px dashed var(--navy); }
.legend i.none { border: 1px solid var(--line-2); background: var(--surface-2); }
.legend i.sq { width: 13px; height: 13px; }
.legend .sep { width: 1px; height: 18px; background: var(--line-2); }

.admin-table-wrap { padding: 38px; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th { text-align: left; background: var(--surface-2); height: 44px; padding: 0 22px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.admin-table td { height: 70px; padding: 8px 22px; border-top: 1px solid #edf0f4; vertical-align: middle; }
.admin-table tbody tr:first-child td { border-top: 0; }
.admin-table tr.pending td { background: #fdfbef; }
.admin-table .u-name { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.admin-table .u-email { font-size: 13px; color: var(--muted-2); }
.admin-table .u-company { font-size: 15.5px; color: var(--text); }
.admin-table .u-date { font-size: 15px; color: var(--muted-2); white-space: nowrap; }
.admin-table .role-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--orange); border: 1px solid var(--orange-border); background: var(--orange-tint); border-radius: 3px; padding: 0 5px; margin-left: 8px; vertical-align: 2px; }
.admin-table .empty { text-align: center; color: var(--muted); height: 120px; }
.access-badges { display: flex; gap: 7px; }
.access-badge { width: 34px; height: 34px; border-radius: var(--radius); display: grid; place-items: center; font-family: var(--font-ui); font-weight: 900; font-size: 10.5px; letter-spacing: .01em; border: 1px solid var(--line); background: var(--surface-2); color: #cfd6df; }
.access-badge.has { background: var(--accent); border-color: var(--accent); color: #fff; }
.access-badge.req { background: #fff; border: 2px dashed var(--accent); color: var(--accent); }
.btn-action { height: 37px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 700; font-size: 15.5px; display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-body); }
.btn-action:hover { border-color: #9aa6b6; }
.btn-action--review { background: var(--amber-tint); border-color: var(--amber-border); color: var(--amber-text); }
.btn-action--review:hover { border-color: var(--amber); }

/* ---------- Misc ---------- */
.search-results .doc-row-sub em { font-style: normal; color: var(--navy); font-weight: 700; }
.centered-card { max-width: 520px; margin: 64px auto; }
.support-list { display: grid; gap: 16px; }

#blazor-error-ui {
    background: #fff8e1; border-top: 1px solid var(--amber-border);
    bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; font-size: 14px;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .auth-panel, .auth-panel--wide { width: 500px; padding-left: 40px; padding-right: 40px; }
    .resource-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col, .two-col--admin { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .auth { flex-direction: column; }
    .auth-hero { padding: 44px 28px; border-left-width: 4px; }
    .auth-panel, .auth-panel--wide { width: 100%; padding: 40px 24px 48px; }
    .with-sidebar { flex-direction: column; }
    .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 12px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-search { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; padding: 24px 20px; }
    .stat-cards { justify-content: flex-start; }
    .admin-table-wrap { padding: 16px; overflow-x: auto; }
    .admin-table { min-width: 900px; }
    .admin-filter, .legend, .filter-bar, .result-line { padding-left: 20px; padding-right: 20px; }
    .main-content { padding: 24px 20px 48px; }
    .incident-alert { flex-wrap: wrap; }
    .lms-banner { flex-wrap: wrap; padding: 24px; }
    .product-head-inner { gap: 20px; }
}

@media (max-width: 720px) {
    .site-header { padding: 0 16px; height: 68px; }
    .site-links > * + * { margin-left: 12px; padding-left: 12px; }
    .site-links { font-size: 13.5px; }
    .site-footer { flex-direction: column; height: auto; padding: 16px; gap: 8px; text-align: center; }
    .site-footer nav { flex-wrap: wrap; justify-content: center; gap: 14px; }
    .hero-title { font-size: 34px; }
    .hero-title--sm { font-size: 30px; }
    .form-grid { grid-template-columns: 1fr; }
    .resource-grid, .resource-grid--compact { grid-template-columns: 1fr; }
    .appnav, .portalnav { padding: 0 16px; gap: 12px; }
    .appnav .brand-sub, .appnav-divider { display: none; }
    .brand-title { font-size: 16px; }
    .portalnav-back span { display: none; }
    .portalnav-title { font-size: 16px; }
    .hub-hero { padding: 28px 16px 0; height: auto; padding-bottom: 28px; }
    .hub-hero h1 { font-size: 27px; }
    .container { padding: 0 16px; }
    .product-grid { grid-template-columns: 1fr; }
    .filter-search { width: 100%; margin-left: 0; }
    .doc-row { flex-wrap: wrap; padding: 12px 16px; }
    .doc-row .doc-btn { margin-left: 52px; }
    .info-grid { grid-template-columns: 1fr; }
    .product-head-inner { flex-direction: column; }
    .crumb-bar { padding: 0 16px; }
    .topbar { font-size: 13px; }
    .topbar a { margin-left: 4px; }
    .quick-tile { width: 100%; }
    .page-wrap { padding: 20px 16px 48px; }
    .card-body, .card-body--roomy { padding: 20px; }
    .card-head { padding: 0 20px; }
    .person-head { padding: 18px 20px; }
}

.page-head-main { display: flex; align-items: center; gap: 28px; min-width: 0; }


/* ---------- SharePoint folder viewer ---------- */
.file-badge--folder { background: #fff4d6; color: #b7791f; }
.folder-row { color: inherit; transition: background .15s; }
.folder-row:hover { background: var(--surface-2); }
.folder-row:hover .doc-btn { filter: brightness(.92); }
.doc-group-link { color: inherit; }
.doc-group-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.doc-thumb { width: 56px; height: 42px; flex: none; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; position: relative; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb .file-badge { display: none; }
.doc-thumb--none img { display: none; }
.doc-thumb--none { border: 0; width: 38px; height: 38px; }
.doc-thumb--none .file-badge { display: grid; }
/* Portal sidebar: sub-folders of the current top-level folder */
.side-sub { margin: 2px 0 6px 30px; border-left: 1px solid var(--line); padding-left: 6px; }
.side-link--sub { height: 34px; font-size: 14.5px; padding: 0 10px; }
.side-link--sub.active { background: #eef2f7; }
.with-sidebar .main-col .doc-page { padding-left: 32px; padding-right: 32px; }
/* Add User: sign-in method choice */
.choice-list { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: #fff; }
.choice.on { border-color: var(--navy-border); background: var(--navy-tint); }
.choice input { margin-top: 4px; accent-color: var(--navy); }
.choice strong { display: block; color: var(--ink); font-size: 15.5px; }
.choice .muted { font-size: 14px; }
/* Long folder names wrap instead of overlapping the next sidebar item */
.side-link { height: auto; min-height: 42px; padding-top: 8px; padding-bottom: 8px; line-height: 1.3; }
.side-link--sub { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
.brand-title { white-space: nowrap; }
/* Customer sidebar item whose resource isn't configured yet */
.side-link--disabled { color: var(--muted-2); cursor: default; }
.side-link--disabled:hover { background: transparent; color: var(--muted-2); }/* Product catalog: picture placeholder while Image_URL is empty or can't be loaded */
.product-img-link { display: block; color: inherit; }
.product-img, .product-thumb { position: relative; }
.product-ph { display: none; flex-direction: column; align-items: center; gap: 8px; color: #a5b0bf; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.img-missing img { display: none; }
.img-missing .product-ph { display: flex; }
.img-missing { background: var(--surface-2); }
.product-thumb img { max-width: 100%; object-fit: contain; }
.product-grid--spaced { margin-top: 14px; }
.product-grid + .series-heading { margin-top: 24px; }

/* ---------- Portal switcher (top right, next to the avatar) ---------- */
.ps-customer { --ps: var(--starr-dot); }
.ps-distributor { --ps: var(--orange); }
.ps-employee { --ps: var(--teal-bright); }
.ps-admin { --ps: var(--red-bright); }
.ps-none { --ps: rgba(255, 255, 255, .22); }

.portal-switcher { position: relative; }
.portal-switcher > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 12px 0 6px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06);
    color: #fff; transition: background .15s, border-color .15s;
}
.portal-switcher > summary::-webkit-details-marker { display: none; }
.portal-switcher > summary:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .24); }
.portal-switcher[open] > summary { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .3); }
.portal-switcher > summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ps-tile { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--ps); color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ps-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ps-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.ps-name { font-size: 14.5px; font-weight: 800; white-space: nowrap; }
.ps-chevron { color: rgba(255, 255, 255, .6); transition: transform .2s; }
.portal-switcher[open] .ps-chevron { transform: rotate(180deg); }

.ps-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
    width: 340px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .2), 0 2px 6px rgba(15, 23, 42, .06);
    padding: 8px; animation: ps-in .14s ease-out;
}
@keyframes ps-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ps-head { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 8px 10px 6px; }
.ps-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.ps-item { display: flex; align-items: center; gap: 13px; padding: 10px; border-radius: 9px; color: var(--ink); transition: background .12s; }
.ps-item:hover { background: var(--surface-2); }
.ps-item.active { background: color-mix(in srgb, var(--ps) 9%, #fff); }
.ps-icon { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--ps); background: color-mix(in srgb, var(--ps) 14%, #fff); }
.ps-item.active .ps-icon { background: var(--ps); color: #fff; }
.ps-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-text strong { font-size: 15px; font-weight: 800; }
.ps-text span { font-size: 12.5px; color: var(--muted); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.ps-check { color: var(--ps); flex: none; }

@media (max-width: 720px) {
    .ps-label { display: none; }
    .portal-switcher > summary { padding: 0 8px 0 6px; gap: 6px; }
    .ps-menu { right: -52px; }
}

/* ---------- Sidebar: Recent Documents (this browser session) ---------- */
.side-empty { font-size: 13.5px; color: var(--muted-2); padding: 0 12px; margin: 0; line-height: 1.45; }
.side-link--doc { gap: 11px; min-height: 38px; font-size: 14.5px; }
.side-doc-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.file-badge--xs { width: 28px; height: 28px; border-radius: 5px; font-size: 9px; }
/* Product cards are narrower beside the sidebar: keep the footer on one line */
.product-foot { gap: 12px; }
.product-foot .kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-xs { flex: none; white-space: nowrap; }
.file-badge--product { background: var(--navy-tint); color: var(--navy); }
.portalnav-back { white-space: nowrap; }
/* All Products: a product line's own documents (files in the product-line folder) */
.product-img--doc { background: var(--surface-2); }
.product-img--doc img { max-height: 182px; width: auto; object-fit: contain; }
.file-badge--xl { width: 84px; height: 84px; border-radius: 14px; font-size: 21px; }
.product-title .new-tag { margin-left: 6px; vertical-align: 2px; }
/* All Products: document count badge on each product card's picture */
.product-img-link { position: relative; }
.doc-count-badge {
    position: absolute; top: 12px; right: 12px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px 3px 8px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
    font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap;
}
.doc-count-badge .icon { color: var(--navy); }
.doc-count-badge--empty, .doc-count-badge--empty .icon { color: var(--muted-2); font-weight: 600; }

/* ---------- Admin: account details, request message in the user list ---------- */
.account-details { display: grid; gap: 16px; }
.account-details .field { margin: 0; }
.expiry-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.expiry-quick .chip { height: 28px; font-size: 13px; padding: 0 12px; }
.expiry-past { color: var(--red-600); font-weight: 700; }
.admin-table .u-request {
    margin-top: 6px; font-size: 13px; color: var(--text); max-width: 340px;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.admin-table .u-request .icon { color: var(--amber-text); vertical-align: -2px; }
.admin-table .u-relationship { font-size: 13px; color: var(--muted-2); margin-top: 2px; }

/* ---------- All Products: series filter (second row) ---------- */
.filter-bar--sub { padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); }
.chip--sm { height: 27px; padding: 0 12px; font-size: 13px; }

/* ---------- Admin: Import Users ---------- */
.import-wrap { max-width: 1000px; margin: 0 auto; display: grid; gap: 22px; }
.input--file { padding: 7px 10px; height: auto; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check-line input { margin-top: 4px; accent-color: var(--navy); }
.import-table td { vertical-align: top; }

/* Public_Subname on folders: product cards, product page header, folder cards */
.product-subname { color: var(--text); margin-top: 3px; }
.product-head-sub { font-size: 16px; color: var(--muted); margin-top: 6px; }
.doc-group-sub { font-size: 13.5px; font-weight: 400; color: rgba(255, 255, 255, .62); margin-left: 12px; }
.doc-group--light .doc-group-sub { color: var(--muted-2); }

/* ---------- Searchable dropdown (CountrySelect) ---------- */
.combo { position: relative; }
.combo-input { padding-right: 42px; cursor: text; }
.combo-chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; display: grid; transition: transform .15s; }
.combo:has(.combo-input[aria-expanded="true"]) .combo-chevron { transform: translateY(-50%) rotate(180deg); }
.combo-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.combo-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
    max-height: 264px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
}
.combo-list[hidden] { display: none; }
.combo-list li { padding: 9px 12px; border-radius: 6px; font-size: 15px; color: var(--ink); cursor: pointer; line-height: 1.3; }
.combo-list li.active { background: var(--navy-tint); color: var(--navy); }
.combo-list li[aria-selected="true"] { font-weight: 800; color: var(--navy); }
.combo-list li[aria-selected="true"]::after { content: "✓"; float: right; color: var(--navy); }
.combo-list .combo-empty { color: var(--muted-2); cursor: default; }
.combo--invalid .combo-input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 33, 47, .12); }
