:root {
    --ink: #15231f;
    --muted: #66766f;
    --line: #dce6e1;
    --surface: #ffffff;
    --canvas: #f4f7f5;
    --primary: #0b6a57;
    --primary-dark: #084c40;
    --primary-soft: #e8f4f0;
    --accent: #d8a643;
    --danger: #b83b43;
    --danger-soft: #fbecee;
    --success: #177b55;
    --success-soft: #e9f6ef;
    --shadow: 0 18px 45px rgba(15, 48, 39, .08);
    --shadow-soft: 0 8px 24px rgba(15, 48, 39, .06);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
.ltr { direction: ltr; text-align: left; }
.muted { color: var(--muted); }
.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; }

.skip-link {
    position: fixed;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 276px minmax(0, 1fr); }
.sidebar {
    position: sticky;
    inset-block-start: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    padding: 26px 18px 20px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 20% 5%, rgba(39, 151, 124, .25), transparent 26%),
        linear-gradient(165deg, #0c493e 0%, #07382f 62%, #052d27 100%);
    color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 25px; }
.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
}
.brand-mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { font-size: 1.12rem; }
.brand-copy small { color: rgba(255, 255, 255, .66); font-size: .78rem; }
.primary-nav { display: grid; gap: 5px; }
.nav-heading { padding: 0 14px 7px; color: rgba(255, 255, 255, .48); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 49px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: rgba(255, 255, 255, .77);
    font-weight: 600;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(-2px); }
.nav-link.is-active { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .09); color: #fff; box-shadow: inset -3px 0 var(--accent); }
.nav-glyph { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, .08); font-size: 1.05rem; }
.nav-link.is-active .nav-glyph { background: rgba(216, 166, 67, .18); color: #f1c96f; }
.sidebar-footer { margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.sidebar-user-copy { display: grid; min-width: 0; }
.sidebar-user-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.sidebar-user-copy small { color: rgba(255, 255, 255, .58); }
.avatar { display: inline-grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; }
.sidebar .avatar { background: rgba(255, 255, 255, .13); color: #fff; }
.logout-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .78); cursor: pointer; }
.logout-button:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.portal-main { min-width: 0; }
.topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    min-height: 82px;
    padding: 14px clamp(20px, 3vw, 42px);
    border-bottom: 1px solid rgba(210, 223, 217, .85);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
}
.page-identity { display: grid; }
.page-identity small { color: var(--muted); font-size: .76rem; }
.page-identity strong { font-size: 1.08rem; }
.topbar-user { display: flex; align-items: center; gap: 9px; margin-inline-start: auto; }
.topbar-user > span:last-child { display: grid; }
.topbar-user strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.topbar-user small { color: var(--muted); font-size: .72rem; }
.avatar-small { width: 36px; height: 36px; flex-basis: 36px; border-radius: 50%; }
.menu-button { display: none; width: 42px; height: 42px; margin-inline-end: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.menu-button span { display: block; width: 100%; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--ink); }
.nav-overlay { display: none; }

.page-content { width: min(1500px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.page-header h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.page-header p { margin-bottom: 0; color: var(--muted); }
.eyebrow { display: inline-block; margin-bottom: 7px; color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .02em; }
.count-chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); white-space: nowrap; box-shadow: var(--shadow-soft); }
.count-chip strong { color: var(--primary-dark); }

.panel { border: 1px solid rgba(214, 226, 220, .9); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel-narrow { max-width: 650px; margin: 35px auto; padding: clamp(24px, 5vw, 42px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 25px 19px; border-bottom: 1px solid #e8efeb; }
.panel-heading h1, .panel-heading h2 { margin-bottom: 0; font-size: 1.22rem; }
.panel-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); font-size: 1.35rem; }
.users-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); align-items: start; gap: 24px; }
.create-user-panel { position: sticky; inset-block-start: 105px; }
.create-user-panel .form-stack { padding: 24px; }
.users-panel { min-width: 0; }

.form-stack { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label, .label-row label { font-size: .86rem; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.input, .select {
    width: 100%;
    min-height: 47px;
    padding: 10px 13px;
    border: 1px solid #cedbd5;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder { color: #9aa9a2; }
.input:hover, .select:hover { border-color: #a8bdb4; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(11, 106, 87, .11); }
.input.input-validation-error, .select.input-validation-error { border-color: var(--danger); }
.input-shell { position: relative; }
.input-shell .input { padding-inline-start: 42px; }
.input-shell .input-with-action { padding-inline-end: 67px; }
.input-icon { position: absolute; inset-inline-start: 14px; inset-block-start: 50%; z-index: 1; color: #81928a; transform: translateY(-50%); font-size: .82rem; }
.input-action { position: absolute; inset-inline-end: 8px; inset-block-start: 50%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--primary); font-size: .76rem; font-weight: 700; cursor: pointer; transform: translateY(-50%); }
.input-action:hover { background: var(--primary-soft); }
.field-hint { color: var(--muted); font-size: .73rem; }
.field-validation { min-height: 1em; color: var(--danger); font-size: .76rem; }
.field-validation:empty { display: none; }
.validation-summary { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #f0c7cb; border-radius: 11px; background: var(--danger-soft); color: #912e36; font-size: .86rem; }
.validation-summary:empty, .validation-summary.validation-summary-valid { display: none; }
.validation-summary ul { margin: 0; padding-inline-start: 20px; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; cursor: pointer; }
.check-field input { width: 17px; height: 17px; accent-color: var(--primary); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 45px; padding: 9px 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--primary), #075546); color: #fff; box-shadow: 0 9px 20px rgba(11, 106, 87, .2); }
.button-primary:hover { background: linear-gradient(135deg, #08725d, var(--primary-dark)); box-shadow: 0 12px 24px rgba(11, 106, 87, .24); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button-secondary:hover { background: var(--canvas); }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.text-button { padding: 5px; border: 0; background: transparent; font-weight: 750; cursor: pointer; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.icon-button { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; border: 0; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer; }
.icon-button:hover { background: var(--primary-dark); }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-size: .87rem; }
.alert > span:first-child { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; }
.alert-success { border-color: #bce1cf; background: var(--success-soft); color: #0d6544; }
.alert-success > span:first-child { background: var(--success); color: #fff; }
.alert-error { border-color: #efc0c5; background: var(--danger-soft); color: #8e2932; }
.alert-error > span:first-child { background: var(--danger); color: #fff; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th { padding: 13px 16px; background: #f8faf9; color: #718079; text-align: right; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.data-table td { padding: 16px; border-top: 1px solid #e9efec; vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fbfdfc; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.person-cell > span:nth-child(2) { display: grid; min-width: 0; }
.person-cell strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell small { max-width: 200px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.you-badge { padding: 2px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .66rem; font-weight: 800; }
.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 8px; background: #f1f5f3; color: #43534c; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status-badge i { display: block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--success-soft); color: var(--success); }
.status-inactive { background: #f0f2f1; color: #6f7a75; }
.inline-form { display: flex; align-items: center; gap: 6px; }
.select-compact { min-width: 95px; min-height: 36px; padding: 5px 9px; font-size: .8rem; }
.date-text { color: var(--muted); white-space: nowrap; }

.empty-state { display: grid; justify-items: center; text-align: center; }
.empty-state.compact { padding: 65px 25px; }
.empty-state h1, .empty-state h3 { margin-bottom: 10px; }
.empty-state p { max-width: 480px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 15px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); font-size: 1.7rem; font-weight: 850; }

/* Shared page patterns */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.page-heading h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.035em; }
.page-heading p { max-width: 820px; margin-bottom: 0; color: var(--muted); }
.section-stack { display: grid; gap: 24px; }
.panel.section-stack { gap: 0; }
.panel.section-stack > .form-grid { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 24px; }
.field-span-2 { grid-column: span 2; }
.field-span-all { grid-column: 1 / -1; }
.input-compact { min-width: 100px; min-height: 39px; padding: 6px 9px; border-radius: 9px; font-size: .8rem; }
.validation-summary-errors { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #f0c7cb; border-radius: 11px; background: var(--danger-soft); color: #912e36; font-size: .86rem; scroll-margin-block-start: 90px; }
.validation-summary-errors:empty, .validation-summary-errors.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 20px; }

.button-light { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .12); color: #fff; }
.button-light:hover { background: rgba(255, 255, 255, .2); }
.button-ghost { border-color: transparent; background: #f2f6f4; color: #52625b; }
.button-ghost:hover { background: #e8efeb; color: var(--ink); }
.button-danger { background: var(--danger); color: #fff; box-shadow: 0 9px 18px rgba(184, 59, 67, .17); }
.button-danger:hover { background: #9f3038; }
.button-small { min-height: 35px; padding: 5px 11px; border-radius: 9px; font-size: .76rem; }
.text-link { color: var(--primary); font-size: .82rem; font-weight: 800; }
.text-link:hover { text-decoration: underline; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.data-table-wrap { width: 100%; overflow-x: auto; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.status-info { background: #eaf1f7; color: #315f7d; }
.status-warning { background: #fff4d9; color: #8b6415; }
.status-error { background: var(--danger-soft); color: var(--danger); }
.status-active { background: var(--success-soft); color: var(--success); }
.status-inactive { background: #f0f2f1; color: #6f7a75; }
.alert-warning { border-color: #eed697; background: #fff8e7; color: #755515; }
.alert-warning > span:first-child { background: #b8841f; color: #fff; }
.alert a { font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

.hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 36px;
    margin-bottom: 24px;
    padding: clamp(28px, 5vw, 48px);
    overflow: hidden;
    border-radius: 26px;
    background:
        radial-gradient(circle at 2% 15%, rgba(255, 255, 255, .13), transparent 25%),
        linear-gradient(135deg, #0a5c4c, #073b32);
    color: #fff;
    box-shadow: 0 24px 55px rgba(8, 71, 58, .17);
}
.hero-panel::after { content: ""; position: absolute; width: 260px; height: 260px; inset: auto -90px -135px auto; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255, 255, 255, .025), 0 0 0 84px rgba(255, 255, 255, .018); }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel .eyebrow { color: #efca72; }
.hero-panel h1 { max-width: 720px; margin-bottom: 14px; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
.hero-panel p { max-width: 780px; margin-bottom: 0; color: rgba(255, 255, 255, .73); }
.connection-card { display: flex; align-items: center; gap: 11px; min-width: 190px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 15px; background: rgba(255, 255, 255, .09); backdrop-filter: blur(8px); }
.connection-card > div { display: grid; }
.connection-card small { color: rgba(255, 255, 255, .6); }
.connection-dot { position: relative; display: block; width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: #e0a139; box-shadow: 0 0 0 5px rgba(224, 161, 57, .13); }
.connection-dot.online { background: #55d69d; box-shadow: 0 0 0 5px rgba(85, 214, 157, .13); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 24px; }
.metric-card { position: relative; display: grid; align-content: start; min-height: 135px; padding: 21px; overflow: hidden; border: 1px solid rgba(214, 226, 220, .9); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.metric-card > span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-card > strong { margin-block: 11px 3px; overflow: hidden; color: var(--primary-dark); font-size: clamp(1.35rem, 2.5vw, 2rem); text-overflow: ellipsis; white-space: nowrap; }
.metric-card > small { overflow: hidden; color: #84928c; text-overflow: ellipsis; white-space: nowrap; }
.metric-accent { border-color: transparent; background: linear-gradient(145deg, #0e745f, #095344); color: #fff; }
.metric-accent::after { content: ""; position: absolute; width: 105px; height: 105px; inset: auto -35px -47px auto; border: 1px solid rgba(255, 255, 255, .12); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255, 255, 255, .03); }
.metric-accent > span, .metric-accent > small { color: rgba(255, 255, 255, .68); }
.metric-accent > strong { color: #fff; }

.compact-panel { margin-bottom: 24px; padding: 19px 22px; }
.seller-strip { display: grid; grid-template-columns: minmax(160px, 1.4fr) repeat(2, minmax(120px, .8fr)) auto; align-items: center; gap: 22px; }
.seller-strip > div { display: grid; min-width: 0; }
.seller-strip small { color: var(--muted); font-size: .74rem; }
.seller-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-strip .eyebrow { margin-bottom: 2px; }

.document-list { display: grid; }
.document-row { display: grid; grid-template-columns: 42px minmax(150px, 1fr) minmax(110px, auto) auto; align-items: center; gap: 14px; padding: 15px 22px; border-top: 1px solid #e8efeb; transition: background .15s ease; }
.document-row:hover { background: #f8fbf9; }
.document-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 850; }
.document-copy { display: grid; min-width: 0; }
.document-copy strong, .document-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-copy small { color: var(--muted); }
.document-total { direction: ltr; white-space: nowrap; }

.money { direction: ltr; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.separator { margin-inline: 10px; color: #a0ada7; }
.code-box { padding: 15px; overflow: auto; border: 1px solid #dce6e1; border-radius: 11px; background: #f5f8f6; color: #32423b; direction: ltr; text-align: left; font-family: Consolas, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }

.attempt-list { display: grid; gap: 12px; padding: 0 24px 24px; }
.attempt-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
.attempt-card summary { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 15px; padding: 14px 16px; cursor: pointer; list-style-position: inside; }
.attempt-card summary:hover { background: #f3f8f5; }
.attempt-card summary span { padding: 4px 8px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: .73rem; font-weight: 800; }
.attempt-card summary small { color: var(--muted); white-space: nowrap; }
.attempt-card[open] summary { border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); }
.detail-grid > div { min-width: 0; padding: 13px 15px; background: #fff; }
.detail-grid dt { color: var(--muted); font-size: .7rem; font-weight: 750; }
.detail-grid dd { margin: 4px 0 0; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.diagnostic-box { max-height: 270px; margin: 13px; padding: 14px; overflow: auto; border: 1px solid #d9e3df; border-radius: 10px; background: #17221e; color: #dce9e3; font-family: Consolas, monospace; font-size: .72rem; white-space: pre-wrap; word-break: break-word; }

.danger-zone { margin-top: 24px; border-color: #edc3c7; background: linear-gradient(180deg, #fff, #fffafb); }
.danger-zone .panel-heading { border-color: #f3dadd; }
.danger-zone .eyebrow { color: var(--danger); }
.danger-zone > p, .danger-zone > .inline-form { margin-inline: 24px; }
.danger-zone > p { margin-block: 20px 0; color: var(--muted); }
.danger-zone > .inline-form { align-items: end; margin-block: 20px 24px; }
.inline-form .grow, .grow { flex: 1 1 280px; }

.invoice-lines-table { min-width: 850px; }
.invoice-lines-table th:first-child, .invoice-lines-table td:first-child { width: 38px; text-align: center; }
.invoice-lines-table td { padding: 9px 7px; }
.invoice-lines-table td:nth-child(2) { min-width: 120px; }
.invoice-lines-table td:nth-child(3) { min-width: 230px; }

/* Login */
.account-body { background: #edf3f0; }
.account-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .95fr) minmax(440px, 1.05fr); }
.account-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(34px, 6vw, 76px); overflow: hidden; background: linear-gradient(145deg, #0b5d4d, #073c33 68%, #052e27); color: #fff; }
.account-aside::before, .account-aside::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; pointer-events: none; }
.account-aside::before { width: 520px; height: 520px; inset: -160px -240px auto auto; }
.account-aside::after { width: 360px; height: 360px; inset: auto auto -190px -120px; box-shadow: 0 0 0 65px rgba(255, 255, 255, .025), 0 0 0 130px rgba(255, 255, 255, .018); }
.account-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.account-brand > span:last-child { display: grid; }
.account-brand strong { font-size: 1.18rem; }
.account-brand small { color: rgba(255, 255, 255, .64); }
.brand-mark-light { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.account-promise { position: relative; z-index: 1; max-width: 580px; margin-block: 70px; }
.eyebrow-light { color: #eac66f; }
.account-promise h1 { margin-bottom: 22px; font-size: clamp(2.35rem, 5vw, 4.25rem); line-height: 1.12; letter-spacing: -.045em; }
.account-promise p { max-width: 490px; margin-bottom: 0; color: rgba(255, 255, 255, .72); font-size: 1.02rem; }
.trust-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: rgba(255, 255, 255, .68); font-size: .82rem; }
.trust-note span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; color: #f0cc77; }
.account-content { display: grid; place-items: center; align-content: center; min-height: 100vh; padding: 35px clamp(24px, 7vw, 100px); }
.account-card { width: min(460px, 100%); padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(210, 225, 218, .9); border-radius: 26px; background: #fff; box-shadow: 0 25px 70px rgba(15, 52, 42, .11); }
.account-heading { margin-bottom: 28px; }
.account-heading h2 { margin-bottom: 9px; font-size: 2rem; letter-spacing: -.035em; }
.account-heading p { margin-bottom: 0; color: var(--muted); }
.account-help { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: .8rem; }
.account-copyright { margin: 22px 0 0; color: #7d8d86; text-align: center; font-size: .75rem; }

@media (max-width: 1120px) {
    .portal-shell { grid-template-columns: 240px minmax(0, 1fr); }
    .sidebar { padding-inline: 13px; }
    .users-layout { grid-template-columns: 320px minmax(0, 1fr); }
    .account-shell { grid-template-columns: minmax(340px, .85fr) minmax(410px, 1.15fr); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seller-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .seller-strip .button { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 900px) {
    body.nav-open { overflow: hidden; }
    .portal-shell { display: block; }
    .sidebar { position: fixed; inset: 0 0 0 auto; width: min(300px, 86vw); transform: translateX(105%); transition: transform .22s ease; box-shadow: -20px 0 50px rgba(0, 0, 0, .22); }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-overlay { position: fixed; inset: 0; z-index: 25; display: block; border: 0; background: rgba(4, 27, 23, .48); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
    body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
    .menu-button { display: block; }
    .users-layout { grid-template-columns: 1fr; }
    .create-user-panel { position: static; }
    .account-shell { grid-template-columns: 1fr; }
    .account-aside { min-height: auto; padding: 30px clamp(24px, 7vw, 60px) 45px; }
    .account-promise { margin: 60px 0 0; }
    .account-promise h1 { font-size: clamp(2rem, 8vw, 3.4rem); }
    .trust-note { display: none; }
    .account-content { min-height: auto; padding-block: 45px; }
    .hero-panel { grid-template-columns: 1fr; align-items: start; }
    .connection-card { justify-self: start; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .topbar { min-height: 70px; padding: 10px 16px; }
    .topbar-user > span:last-child { display: none; }
    .page-identity small { display: none; }
    .page-content { padding: 24px 16px 38px; }
    .page-header { align-items: flex-start; margin-bottom: 20px; }
    .page-header h1 { font-size: 1.65rem; }
    .page-header p { font-size: .88rem; }
    .count-chip { padding: 7px 10px; font-size: .78rem; }
    .panel { border-radius: 17px; }
    .panel-heading { padding: 20px 18px 15px; }
    .create-user-panel .form-stack { padding: 20px 18px; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table thead { display: none; }
    .responsive-table tr { padding: 17px; border-top: 1px solid var(--line); }
    .responsive-table tr:first-child { border-top: 0; }
    .responsive-table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border: 0; text-align: left; }
    .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 750; text-align: right; }
    .responsive-table td:first-child { display: block; padding-bottom: 13px; }
    .responsive-table td:first-child::before { display: none; }
    .person-cell strong, .person-cell small { max-width: 210px; }
    .inline-form { max-width: 210px; }
    .account-aside { padding-block: 24px 36px; }
    .account-promise { margin-top: 44px; }
    .account-promise p { font-size: .9rem; }
    .account-content { padding: 28px 14px; }
    .account-card { padding: 27px 20px; border-radius: 20px; }
    .account-heading h2 { font-size: 1.7rem; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 1.65rem; }
    .page-heading p { font-size: .88rem; }
    .page-heading > .button, .page-heading > .status-pill { flex: 0 0 auto; }
    .hero-panel { padding: 27px 20px; border-radius: 19px; }
    .hero-panel h1 { font-size: 1.8rem; }
    .hero-panel .button-row { margin-top: 18px; }
    .metric-grid { gap: 11px; }
    .metric-card { min-height: 116px; padding: 16px; border-radius: 15px; }
    .seller-strip { grid-template-columns: 1fr 1fr; gap: 15px; }
    .seller-strip > div:first-child { grid-column: 1 / -1; }
    .document-row { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 14px 16px; }
    .document-total { grid-column: 2; font-size: .82rem; }
    .document-row .status-pill { grid-column: 3; grid-row: 1 / span 2; }
    .form-grid { grid-template-columns: 1fr; padding: 20px 18px; }
    .field-span-2, .field-span-all { grid-column: auto; }
    .attempt-list { padding-inline: 17px; }
    .attempt-card summary { grid-template-columns: 1fr auto; }
    .attempt-card summary small { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: 1fr; }
    .danger-zone > p, .danger-zone > .inline-form { margin-inline: 18px; }
    .danger-zone > .inline-form { align-items: stretch; flex-direction: column; }
    .danger-zone .button { width: 100%; }
}

@media (max-width: 420px) {
    .page-header { display: grid; }
    .count-chip { justify-self: start; }
    .button-row .button { width: 100%; }
    .account-promise h1 { font-size: 2rem; }
    .account-brand small { display: none; }
    .page-heading { display: grid; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 105px; }
    .seller-strip { grid-template-columns: 1fr; }
    .seller-strip > div:first-child { grid-column: auto; }
    .document-row { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
    .document-icon { width: 36px; height: 36px; }
    .document-total { grid-column: 2; }
    .document-row .status-pill { grid-column: 2; grid-row: auto; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
