@font-face {
    font-family: "Space Grotesk Local";
    src: url("../space-grotesk.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 400 700;
}

:root {
    color-scheme: light;
    --left-width: 70px;
    --top-height: 65px;
    --mobile-nav-height: 68px;
    --bg: #ecebe8;
    --surface: #f8f7f4;
    --surface-strong: #ffffff;
    --surface-muted: #f1f0ec;
    --border: #d3d0d1;
    --border-soft: #e4e1da;
    --text: #151922;
    --heading: #252525;
    --muted: #6b6861;
    --muted-soft: #8a857c;
    --brand: #e53934;
    --brand-strong: #c92525;
    --success: #267145;
    --warning: #8a5e0a;
    --info: #276b9b;
    --danger: #9b1c18;
    --focus: rgba(229, 57, 52, .34);
    --shadow: 0 16px 35px rgba(21, 25, 34, .11);
    font-family: "Space Grotesk Local", "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-underline-offset: 3px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .9em; }
[hidden] { display: none !important; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    padding: 10px 14px;
    border-radius: 8px;
    background: #191919;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Estrutura: o mesmo trilho compacto e a mesma topbar do Horus do cliente. */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10010;
    width: var(--left-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    background: #191919;
    color: #fff;
}
.brand {
    width: 100%;
    height: var(--top-height);
    flex: 0 0 var(--top-height);
    display: grid;
    place-items: center;
}
.brand img { width: 38px; height: 38px; display: block; border-radius: 11px; }
.sidebar nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 8px 0 18px;
    overflow: visible;
    scrollbar-width: none;
}
.sidebar nav::-webkit-scrollbar { display: none; }
.sidebar nav a {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    text-decoration: none;
    transition: background-color .18s ease, box-shadow .18s ease;
}
.sidebar nav a:hover { background: #303030; }
.sidebar nav a[aria-current="page"] {
    background: var(--brand);
    box-shadow: 0 8px 18px rgba(229, 57, 53, .28);
}
.sidebar nav a svg { width: 20px; height: 20px; }
.sidebar nav a > span {
    position: absolute;
    left: calc(100% + 11px);
    top: 50%;
    z-index: 20;
    padding: 6px 9px;
    border-radius: 5px;
    background: #252525;
    color: #fff;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-5px, -50%);
    transition: opacity .16s ease, transform .16s ease;
}
.sidebar nav a:hover > span,
.sidebar nav a:focus-visible > span { opacity: 1; transform: translate(0, -50%); }
.sidebar-tooltip::before {
    position: absolute;
    top: 50%;
    right: 100%;
    border: 5px solid transparent;
    border-right-color: #252525;
    content: "";
    transform: translateY(-50%);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: var(--top-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 30px 0 calc(var(--left-width) + 30px);
    border-bottom: 1px solid var(--border);
    background: #f2f1ef;
}
.topbar-search {
    width: min(480px, 34vw);
    min-width: 220px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    padding: 0 11px;
    border: 1px solid #d8d5d0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .76);
    color: #8a8781;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.topbar-search:focus-within { border-color: #aaa59d; background: #fff; box-shadow: 0 0 0 3px rgba(229, 57, 52, .08); }
.topbar-search svg { width: 17px; height: 17px; flex: 0 0 auto; }
.topbar-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--heading); font: inherit; font-size: 12px; }
.topbar-search input::placeholder { color: #8d8a84; opacity: 1; }
.topbar-search kbd { min-width: 22px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; background: #f4f2ef; color: #8a8781; font: 10px/1 sans-serif; text-align: center; }
.breadcrumb {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8c8c8c;
    font-size: 10px;
    font-weight: 550;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb .breadcrumb-brand { color: var(--brand); font-weight: 700; }
.breadcrumb .breadcrumb-logo { flex: 0 0 auto; display: block; }
.breadcrumb .breadcrumb-logo img { width: 116px; height: 30px; display: block; object-fit: contain; object-position: left center; }
.breadcrumb span { color: #b3b0b1; }
.breadcrumb strong { overflow: hidden; color: #777; font-weight: 550; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.environment,
.count-chip {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-strong);
    color: #5c5a55;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .045em;
    white-space: nowrap;
}
.environment::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #55b779;
    content: "";
}
.topbar-menu { position: relative; }
.topbar-menu > summary { list-style: none; cursor: pointer; }
.topbar-menu > summary::-webkit-details-marker { display: none; }
.topbar-status {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: #595751;
    font-size: 10px;
    white-space: nowrap;
}
.topbar-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.topbar-status-warning > span { background: #d78a16; box-shadow: 0 0 0 4px rgba(215, 138, 22, .1); }
.topbar-status-danger > span { background: var(--danger); box-shadow: 0 0 0 4px rgba(229, 57, 52, .1); }
.topbar-menu[open] > summary { border-color: #aaa59d; }
.quick-actions > summary {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--heading);
    font-size: 20px;
    font-weight: 400;
}
.topbar-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}
.topbar-popover > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid var(--border-soft); }
.topbar-popover > header div { display: grid; gap: 3px; }
.topbar-popover > header small,
.quick-actions-popover > a span { color: var(--brand); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.topbar-popover > header strong { font-size: 13px; }
.topbar-popover > header a { color: var(--brand); font-size: 10px; font-weight: 750; text-decoration: none; }
.pending-list { display: grid; }
.pending-list a { min-height: 44px; display: grid; grid-template-columns: 8px 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border-soft); color: var(--heading); font-size: 11px; text-decoration: none; }
.pending-list a:last-child { border-bottom: 0; }
.pending-list a:hover,
.pending-list a:focus-visible,
.quick-actions-popover > a:hover,
.quick-actions-popover > a:focus-visible { background: #f7f5f2; }
.pending-list a b { color: #aaa59d; }
.pending-dot { width: 7px; height: 7px; border-radius: 50%; background: #d78a16; }
.pending-dot-danger { background: var(--danger); }
.popover-empty { margin: 0; padding: 18px 16px; color: var(--muted); font-size: 11px; }
.quick-actions-popover { width: min(310px, calc(100vw - 24px)); }
.quick-actions-popover > a { display: grid; gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); color: var(--heading); text-decoration: none; }
.quick-actions-popover > a:last-child { border-bottom: 0; }
.quick-actions-popover > a strong { font-size: 12px; }
.admin-profile { position: relative; }
.admin-profile summary {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: var(--surface-strong);
    color: #74716b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    list-style: none;
}
.admin-profile summary::-webkit-details-marker { display: none; }
.admin-profile[open] summary { border-color: var(--brand); color: var(--brand); }
.profile-menu {
    position: absolute;
    top: calc(100% + 11px);
    right: 0;
    width: min(280px, calc(100vw - 24px));
    display: grid;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}
.profile-menu > strong { font-size: 14px; }
.profile-menu > small { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); }
.profile-menu > span {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.profile-menu form { margin-top: 10px; }
.profile-link {
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--heading);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}
.profile-link:hover { color: var(--brand); }
.link-button {
    width: 100%;
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--heading);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}
.link-button:hover { background: #ebe9e4; color: var(--brand); }

.content {
    width: min(1540px, calc(100% - 112px));
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--top-height) + 28px) 0 46px var(--left-width);
}
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.page-header > div { min-width: 0; }
.page-header h1 {
    margin: 7px 0 0;
    color: var(--heading);
    font-size: clamp(30px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.05;
}
.page-header p:not(.eyebrow) {
    max-width: 760px;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.page-header time {
    color: var(--muted-soft);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.eyebrow {
    margin: 0 !important;
    color: var(--brand) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .14em !important;
    text-transform: uppercase;
}
.back-link {
    display: inline-flex;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.back-link:hover { color: var(--brand); }

/* Superfícies e métricas */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.metric,
.panel,
.state-card {
    border: 1px solid var(--border);
    background: var(--surface);
}
.metric {
    min-height: 110px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 18px 16px;
}
.metric > span,
.metric > small {
    color: var(--muted-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.metric > strong {
    margin: 2px 0;
    color: var(--heading);
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.04em;
    line-height: 1;
}
.metric > small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}
.metric-danger { border-color: #efb9b6; background: #fff4f3; }
.metric-danger > strong { color: var(--danger); }
.metric-warning { border-color: #e3cca0; background: #fff9ec; }
.metric-warning > strong { color: var(--warning); }
.metric-action {
    width: fit-content;
    margin-top: 7px;
    color: var(--heading);
    font-size: 11px;
    font-weight: 800;
    text-decoration-color: #aaa59d;
}
.metric-action:hover { color: var(--brand); }
.panel {
    display: grid;
    align-content: start;
    gap: 16px;
    margin-bottom: 14px;
    padding: 20px;
}
.panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
}
.panel h2 { margin: 0; color: var(--heading); font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.panel header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel header > span { color: var(--muted-soft); font-size: 11px; font-weight: 800; }
.panel > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel > p + p { padding-top: 12px; border-top: 1px solid var(--border-soft); }
.panel > header a,
.panel > a { color: var(--brand); font-size: 12px; font-weight: 800; text-decoration: none; }
.table-panel { gap: 0; padding: 0; overflow: hidden; }

.two-columns,
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
}
.mini-card > span,
.mini-card > strong,
.mini-card > small { display: block; }
.mini-card > span { color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.mini-card > strong { margin: 8px 0; color: var(--heading); font-size: 14px; }
.mini-card > p { min-height: 34px; margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.mini-card > small { color: var(--muted); font-size: 10px; font-weight: 750; }
.mini-card details { margin-top: 14px; }
.mini-card details[open] { max-height: 440px; overflow: auto; }

/* Visão geral: triagem operacional com dados reais e ações por permissão. */
.dashboard-header { margin-bottom: 18px; }
.dashboard-updated {
    display: grid;
    justify-items: end;
    gap: 4px;
    padding-bottom: 2px;
}
.dashboard-updated span {
    color: var(--success);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
    gap: 34px;
    margin-bottom: 14px;
    padding: 30px 32px;
    overflow: hidden;
    border: 1px solid #292929;
    background: #191919;
    color: #fff;
}
.dashboard-hero::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand);
    content: "";
}
.dashboard-hero-warning::before { background: #e4a82f; }
.dashboard-hero-success::before { background: #43a86c; }
.dashboard-hero-copy { min-width: 0; align-self: center; }
.dashboard-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: rgba(255, 255, 255, .7);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.dashboard-kicker span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(229, 57, 52, .13);
}
.dashboard-hero-warning .dashboard-kicker span { background: #e4a82f; box-shadow: 0 0 0 4px rgba(228, 168, 47, .14); }
.dashboard-hero-success .dashboard-kicker span { background: #43a86c; box-shadow: 0 0 0 4px rgba(67, 168, 108, .14); }
.dashboard-hero h2 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: .98;
}
.dashboard-hero-copy > p:not(.dashboard-kicker) {
    max-width: 650px;
    margin: 13px 0 0;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    line-height: 1.5;
}
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.dashboard-actions a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}
.dashboard-actions a:first-child { border-color: #fff; background: #fff; color: #191919; }
.dashboard-actions a:hover { border-color: #fff; background: rgba(255, 255, 255, .13); color: #fff; }
.dashboard-actions a:first-child:hover { background: #eceae5; color: #191919; }
.dashboard-health {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 22px;
    padding-left: 30px;
    border-left: 1px solid rgba(255, 255, 255, .13);
}
.dashboard-health > div { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; }
.dashboard-health span,
.dashboard-health small { color: rgba(255, 255, 255, .57); font-size: 10px; font-weight: 700; }
.dashboard-health strong { font-size: 18px; line-height: 1; }
.dashboard-health progress {
    width: 100%;
    height: 5px;
    grid-column: 1 / -1;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: rgba(255, 255, 255, .12);
}
.dashboard-health progress::-webkit-progress-bar { background: rgba(255, 255, 255, .12); }
.dashboard-health progress::-webkit-progress-value { background: #43a86c; }
.dashboard-health progress::-moz-progress-bar { background: #43a86c; }
.dashboard-health small { grid-column: 1 / -1; }
.dashboard-metrics .metric { min-height: 145px; align-content: start; padding: 20px; }
.dashboard-metrics .metric > strong { margin-top: 10px; font-size: 35px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 14px; }
.dashboard-grid .panel { min-width: 0; }
.dashboard-priorities,
.dashboard-focus { padding: 0; gap: 0; }
.dashboard-priorities > header,
.dashboard-focus > header { padding: 20px; border-bottom: 1px solid var(--border); }
.attention-list,
.dashboard-entity-list { display: grid; }
.attention-item,
.dashboard-entity-list > a {
    min-width: 0;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-soft);
    text-decoration: none;
}
.attention-item:last-child,
.dashboard-entity-list > a:last-child { border-bottom: 0; }
.attention-item:hover,
.dashboard-entity-list > a:hover { background: var(--surface-muted); }
.attention-item > span,
.entity-status { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-soft); }
.attention-danger > span,
.entity-status-danger { background: var(--brand); box-shadow: 0 0 0 4px rgba(229, 57, 52, .09); }
.attention-warning > span,
.entity-status-warning { background: #d89818; box-shadow: 0 0 0 4px rgba(216, 152, 24, .1); }
.attention-item div,
.dashboard-entity-list a div { min-width: 0; }
.attention-item strong,
.attention-item small,
.dashboard-entity-list a strong,
.dashboard-entity-list a small { display: block; }
.attention-item strong,
.dashboard-entity-list a strong { color: var(--heading); font-size: 13px; }
.attention-item small,
.dashboard-entity-list a small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.attention-item b,
.dashboard-entity-list a b { color: var(--brand); font-size: 10px; font-weight: 850; text-align: right; text-transform: uppercase; }
.dashboard-entity-list a b { max-width: 110px; overflow-wrap: anywhere; color: var(--muted); }
.dashboard-empty {
    min-height: 136px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: left;
}
.dashboard-empty > span { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; border-radius: 50%; background: #e4f5ec; color: var(--success); font-weight: 900; }
.dashboard-empty strong,
.dashboard-empty small { display: block; }
.dashboard-empty strong { color: var(--heading); font-size: 13px; }
.dashboard-empty small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.panel-footer-link {
    display: block;
    padding: 13px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}
.dashboard-payments { gap: 0; padding: 0; overflow: hidden; }
.dashboard-payments > header { padding: 20px; border-bottom: 1px solid var(--border); }

/* Financeiro: reembolso tratado no contexto do pagamento. */
.finance-payments { scroll-margin-top: calc(var(--top-height) + 16px); }
.finance-payments > header { padding: 20px; border-bottom: 1px solid var(--border); }
.muted-value { color: var(--muted-soft); font-size: 12px; }
.payment-header { margin-bottom: 18px; }
.payment-overview {
    grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.payment-amount {
    min-height: 190px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 28px;
    background: #191919;
    color: #fff;
}
.payment-amount > span { color: rgba(255, 255, 255, .6); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.payment-amount > strong { font-size: clamp(30px, 4vw, 43px); font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.payment-amount > small { color: rgba(255, 255, 255, .62); font-size: 11px; }
.payment-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}
.payment-facts > div { min-width: 0; display: grid; align-content: center; gap: 7px; padding: 22px 24px; border-bottom: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); }
.payment-facts > div:nth-last-child(-n + 2) { border-bottom: 0; }
.payment-facts dt,
.payment-facts dd { margin: 0; }
.payment-facts dt { color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.payment-facts dd { overflow-wrap: anywhere; color: var(--heading); font-size: 13px; font-weight: 750; }
.refund-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 14px; }
.refund-control { padding: 0; overflow: hidden; }
.refund-control > header { padding: 20px 20px 0; }
.refund-balance { display: grid; gap: 6px; margin-top: 2px; padding: 22px 20px; border-block: 1px solid var(--border); background: var(--surface-muted); }
.refund-balance > span { color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.refund-balance > strong { color: var(--heading); font-size: 29px; font-weight: 650; letter-spacing: -.035em; }
.refund-balance > small { color: var(--muted); font-size: 11px; }
.refund-request { margin: 0; padding: 18px 20px 20px; }
.refund-request label small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.refund-unavailable { display: grid; gap: 5px; padding: 20px; }
.refund-unavailable strong { color: var(--heading); font-size: 13px; }
.refund-unavailable span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.refund-rules ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.refund-rules li { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.refund-rules li > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #191919; color: #fff; font-size: 10px; font-weight: 850; }
.refund-rules li strong,
.refund-rules li small { display: block; }
.refund-rules li strong { color: var(--heading); font-size: 12px; }
.refund-rules li small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.refund-rules > p { padding: 12px; border-left: 3px solid #e3a12a; background: #fff8e8; }
.refund-history { gap: 0; padding: 0; overflow: hidden; }
.refund-history > header { padding: 20px; border-bottom: 1px solid var(--border); }
.refund-list { display: grid; }
.refund-item { display: grid; grid-template-columns: minmax(175px, .55fr) minmax(240px, 1.2fr) minmax(190px, .75fr); gap: 22px; align-items: start; padding: 20px; border-bottom: 1px solid var(--border); }
.refund-item:last-child { border-bottom: 0; }
.refund-item-main { display: grid; justify-items: start; gap: 8px; }
.refund-item-main > strong { color: var(--heading); font-size: 25px; font-weight: 650; letter-spacing: -.03em; }
.refund-item-main > small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.refund-reason > span { color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.refund-reason p { margin: 7px 0 0; color: var(--heading); font-size: 12px; line-height: 1.5; }
.refund-reason small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.refund-meta { display: grid; gap: 8px; margin: 0; }
.refund-meta > div { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.refund-meta dt,
.refund-meta dd { margin: 0; font-size: 10px; }
.refund-meta dt { color: var(--muted-soft); }
.refund-meta dd { max-width: 130px; color: var(--heading); font-weight: 750; text-align: right; }
.refund-item > form,
.refund-decision { grid-column: 1 / -1; }
.refund-decision { padding-top: 2px; }
.refund-decision[open] > summary { margin-bottom: 14px; }
.refund-decision-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--border); background: var(--surface-muted); }

/* Tabelas */
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th,
td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th {
    background: var(--surface-muted);
    color: #827d75;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
td { color: #343434; font-size: 13px; font-weight: 600; }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background: #f3f1ed; }
tbody tr:last-child td { border-bottom: 0; }
td strong,
td small { display: block; }
td strong { color: var(--heading); }
td small { max-width: 340px; margin-top: 4px; color: var(--muted-soft); font-size: 11px; font-weight: 550; }
td a { font-weight: 750; text-decoration-color: #b9b5ae; }
.row-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    text-decoration: none;
}
.row-link:hover { border-color: var(--brand); color: var(--brand); }
.badge {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #ecebe8;
    color: #4f4d49;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-active, .badge-online, .badge-live, .badge-approved, .badge-paid, .badge-succeeded, .badge-success { background: #e4f3e9; color: var(--success); }
.badge-offline, .badge-error, .badge-failed, .badge-rejected, .badge-disabled, .badge-denied { background: #fde4e2; color: var(--danger); }
.badge-pending, .badge-requested, .badge-processing, .badge-degraded, .badge-poor, .badge-invited, .badge-authorized { background: #fff3d7; color: var(--warning); }

/* Formulários e ações */
.filters {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.filters label { min-width: 220px; flex: 1 1 220px; }
label { display: grid; gap: 7px; color: #4b4944; font-size: 12px; font-weight: 700; }
input,
select,
textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid #d2cec5;
    border-radius: 0;
    outline: 0;
    background: #fff;
    color: var(--heading);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder,
textarea::placeholder { color: #99948b; }
input:focus,
select:focus,
textarea:focus { border-color: #252525; box-shadow: 0 0 0 1px #252525; }
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border: 1px solid #d2cec5;
    border-radius: 8px;
    background: #fff;
    color: #343434;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.button:hover { background: #f2f1ef; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.button-primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 8px 16px rgba(229, 57, 53, .2); }
.button.button-primary:hover { border-color: var(--brand-strong); background: var(--brand-strong); color: #fff; }
.button-danger { border-color: #edb2ae; background: #fff7f6; color: var(--danger); }
.button-danger:hover { background: #fde8e6; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 11px; }
.stack { display: grid; gap: 14px; }
.stack.compact,
.compact { gap: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide,
.span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; }
.check input { width: 17px; min-height: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.inline-form,
.inline-action { display: flex; align-items: center; gap: 7px; }
.inline-form input,
.inline-action input { min-width: 150px; }
fieldset { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--border); }
legend { padding: 0 7px; color: #4b4944; font-size: 11px; font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.permission-grid .check { padding: 10px; border: 1px solid var(--border); background: var(--surface-strong); }
.permission-grid .check span,
.permission-grid .check small { display: block; }
.permission-grid .check small { margin-top: 3px; color: var(--muted); font-weight: 500; }
details > summary { color: var(--heading); cursor: pointer; font-size: 12px; font-weight: 800; }
.action-panel > summary { font-size: 14px; }
.action-panel[open] > summary { margin-bottom: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.table-wrap details[open] { min-width: 280px; }

.definition-list { display: grid; margin: 0; border-top: 1px solid var(--border); }
.definition-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.definition-list dt,
.definition-list dd { margin: 0; font-size: 13px; }
.definition-list dt { color: var(--muted-soft); font-weight: 700; }
.definition-list dd { color: var(--heading); font-weight: 750; text-align: right; }
.rules { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.rules li { padding: 11px 0; border-bottom: 1px solid var(--border); color: #45433f; font-size: 13px; font-weight: 650; }
.rules li:last-child { border-bottom: 0; }
.empty {
    min-height: 138px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    padding: 26px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.empty strong { color: var(--heading); font-size: 15px; }
.notice {
    display: grid;
    gap: 4px;
    margin: 0 0 14px;
    padding: 15px 17px;
    border: 1px solid #bed7e8;
    border-left: 4px solid var(--info);
    background: #eff7fc;
}
.notice strong { color: #265d82; font-size: 13px; }
.notice p { margin: 0; color: #46677e; font-size: 12px; line-height: 1.5; }
.notice-warning { border-color: #ead3a0; border-left-color: #d78a13; background: #fff9eb; }
.notice-warning strong { color: #7e570e; }
.notice-warning p { color: #785e2e; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px; background: var(--surface); }
.pagination > span { margin-right: auto; color: var(--muted); font-size: 12px; }

/* Autenticação: mesma composição clara e editorial do login do Horus. */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f3f2ef;
}
.auth-shell::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(21, 21, 21, .04) 18% 18.1%, transparent 18.1% 76%, rgba(239, 51, 51, .12) 76% 76.1%, transparent 76.1%),
        linear-gradient(0deg, transparent 0 52%, rgba(21, 21, 21, .04) 52% 52.1%, transparent 52.1%);
    content: "";
}
.auth-content { position: relative; z-index: 1; width: min(440px, 100%); }
.auth-card {
    width: 100%;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px;
    border: 1px solid #d8d5ce;
    background: #f8f7f4;
    box-shadow: 0 24px 60px rgba(21, 21, 21, .08);
}
.auth-card-wide { width: min(680px, calc(100vw - 32px)); margin-left: 50%; transform: translateX(-50%); }
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 42px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.auth-brand > img { width: 184px; height: 48px; display: block; object-fit: contain; object-position: left center; }
.auth-brand > small { margin-left: auto; color: var(--muted-soft); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-align: right; }
.auth-card header { margin-bottom: 28px; }
.auth-card header h1 { max-width: 390px; margin: 12px 0 0; color: var(--heading); font-size: clamp(38px, 5vw, 48px); font-weight: 600; letter-spacing: -.05em; line-height: .98; }
.auth-card header > p:last-child { max-width: 390px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-card footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid #e0ddd6; color: var(--muted); font-size: 11px; line-height: 1.5; }
.auth-card .button-primary { width: 100%; min-height: 44px; }
.auth-alternative {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted-soft);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.auth-alternative::before,
.auth-alternative::after { height: 1px; flex: 1; background: var(--border-soft); content: ""; }
.button-passkey { width: 100%; min-height: 44px; gap: 9px; border-color: #252525; color: #252525; }
.button-passkey svg { width: 20px; height: 20px; fill: currentColor; }
.passkey-feedback { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.passkey-feedback:empty { min-height: 0; margin-top: 0; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 21px; letter-spacing: .22em; text-align: center; }
.mfa-enrollment { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; margin-bottom: 24px; }
.mfa-qr-card { margin: 0; padding: 12px; border: 1px solid var(--border); background: #fff; }
.mfa-qr-card img { width: 100%; height: auto; display: block; }
.mfa-qr-card figcaption { margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }
.mfa-enrollment-guide { min-width: 0; }
.mfa-steps { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; }
.mfa-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.mfa-steps li > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #191919; color: #fff; font-size: 10px; font-weight: 800; }
.mfa-steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mfa-steps strong { display: block; margin-bottom: 2px; color: var(--heading); font-size: 12px; }
.mfa-manual { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.mfa-manual .secret-box { margin: 12px 0 0; }
.secret-box { display: grid; gap: 8px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--border); background: #fff; }
.secret-box span { color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.secret-box code { overflow-wrap: anywhere; color: var(--heading); font-size: 14px; font-weight: 800; }
.secret-box button { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 12px; font-weight: 800; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 18px; padding: 15px; border: 1px solid var(--border); background: #f1f0ec; }
.recovery-grid code { padding: 8px; border: 1px solid var(--border); background: #fff; text-align: center; }
.recovery-actions { display: grid; gap: 9px; }

.passkey-stepup,
.passkey-register-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
}
.passkey-stepup h2,
.passkey-register-card h2 { margin: 4px 0 7px; color: var(--heading); font-size: 22px; }
.passkey-stepup p:not(.eyebrow),
.passkey-register-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.passkey-register-card .passkey-feedback { grid-column: 1 / -1; }
.passkey-register-actions { width: min(340px, 100%); display: grid; gap: 10px; }
.passkey-list { display: grid; }
.passkey-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-soft);
}
.passkey-item:last-child { border-bottom: 0; }
.passkey-item > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.passkey-item strong { color: var(--heading); font-size: 14px; }
.passkey-item span,
.passkey-item small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.passkey-item small { color: var(--success); font-weight: 700; }
.passkey-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #f0efeb; color: #252525; }
.passkey-icon svg { width: 24px; height: 24px; fill: currentColor; }
.passkey-note { max-width: 760px; }
.alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid; font-size: 13px; font-weight: 650; line-height: 1.45; }
.alert-error { border-color: rgba(229, 57, 52, .28); background: rgba(229, 57, 52, .08); color: var(--danger); }
.alert-success { border-color: rgba(38, 113, 69, .28); background: rgba(38, 113, 69, .08); color: var(--success); }

.state-card {
    max-width: 720px;
    min-height: 360px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 16px;
    margin: 7vh auto;
    padding: 38px;
    text-align: center;
}
.state-card h1 { margin: 0; color: var(--heading); font-size: 32px; letter-spacing: -.035em; }
.state-card p { max-width: 560px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.state-code,
.success-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--heading); font-size: 18px; font-weight: 900; }
.success-mark { border-color: #aad6b9; background: #e4f5ec; color: var(--success); font-size: 24px; }
.break-all { word-break: break-all; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 20000; }
.toast { max-width: 340px; padding: 12px 15px; border-radius: 8px; background: #242522; color: #fff; box-shadow: var(--shadow); }

.search-page-header { align-items: end; }
.search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.search-group { padding: 0; overflow: hidden; }
.search-group > header { margin: 0; padding: 17px 18px; }
.search-result-list { display: grid; border-top: 1px solid var(--border-soft); }
.search-result-list > a { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 18px; border-bottom: 1px solid var(--border-soft); color: var(--heading); text-decoration: none; }
.search-result-list > a:last-child { border-bottom: 0; }
.search-result-list > a:hover,
.search-result-list > a:focus-visible { background: #f7f5f2; }
.search-result-list > a > div { min-width: 0; display: grid; gap: 4px; }
.search-result-list > a strong { font-size: 13px; }
.search-result-list > a small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-list > a > span:not(.badge) { flex: 0 0 auto; color: var(--brand); font-size: 10px; font-weight: 750; }
.search-empty { min-height: 250px; display: grid; align-content: center; justify-items: center; gap: 7px; text-align: center; }
.search-empty strong { font-size: 18px; }
.search-empty p { margin: 0; color: var(--muted); font-size: 12px; }

/* Central de pendências: triagem compacta, atribuição e histórico no mesmo fluxo. */
.work-items-header .button { flex: 0 0 auto; }
.work-items-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.work-items-filters label { min-width: 150px; flex-basis: 150px; }
.work-items-filters label:first-child { min-width: 250px; flex-grow: 2; }
.work-items-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.work-items-list { min-width: 0; display: grid; gap: 10px; }
.work-item {
    position: relative;
    min-width: 0;
    display: grid;
    gap: 15px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}
.work-item::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #aaa69f; content: ""; }
.work-item-high::before { background: #d88b12; }
.work-item-critical::before,
.work-item-overdue::before { background: var(--danger); }
.work-item > header { display: flex; justify-content: space-between; gap: 18px; }
.work-item-heading { min-width: 0; }
.work-item-kickers { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--muted-soft); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.work-item h2 { margin: 0; color: var(--heading); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.work-item-heading > p { max-width: 760px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.work-source { display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0; text-transform: none; }
.work-source::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.work-source-active { color: var(--danger); }
.work-source-cleared { color: var(--success); }
.work-item-badges { display: flex; align-items: flex-start; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.badge-priority-critical { background: #fde4e2; color: var(--danger); }
.badge-priority-high { background: #fff3d7; color: var(--warning); }
.badge-priority-low { background: #edf1f3; color: #50616d; }
.badge-state-in_progress { background: #e8f1f8; color: #2d668f; }
.badge-state-waiting, .badge-state-new { background: #fff3d7; color: var(--warning); }
.badge-state-resolved { background: #e4f3e9; color: var(--success); }
.badge-state-dismissed { background: #ecebe8; color: #605d57; }
.work-item-facts { display: grid; grid-template-columns: 1.45fr 1fr 1fr 1fr; margin: 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.work-item-facts > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--border-soft); }
.work-item-facts > div:first-child { padding-left: 0; }
.work-item-facts > div:last-child { padding-right: 0; border-right: 0; }
.work-item-facts dt { margin: 0 0 4px; color: var(--muted-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.work-item-facts dd { margin: 0; overflow: hidden; color: var(--heading); font-size: 11px; font-weight: 750; text-overflow: ellipsis; }
.work-item-facts dd small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.work-item-facts a { color: inherit; text-decoration-color: #aaa59d; }
.work-item-facts .is-overdue { color: var(--danger); }
.work-item-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.work-item-actions > form { margin-left: auto; }
.work-item-note-count { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 750; }
.work-item-editor,
.work-item-notes { position: relative; }
.work-item-editor[open],
.work-item-notes[open] { width: 100%; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.work-item-editor > summary,
.work-item-notes > summary { min-height: 32px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.work-item-editor[open] > summary,
.work-item-notes[open] > summary { margin-bottom: 13px; }
.work-item-notes > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.work-item-notes ol { max-height: 300px; display: grid; gap: 8px; margin: 0 0 13px; padding: 0; overflow: auto; list-style: none; }
.work-item-notes li { padding: 11px 12px; border: 1px solid var(--border-soft); background: var(--surface-muted); }
.work-item-notes li p { margin: 0 0 7px; color: var(--heading); font-size: 12px; line-height: 1.5; }
.work-item-notes li small { color: var(--muted-soft); font-size: 9px; font-weight: 750; }
.work-item-notes form { display: grid; gap: 9px; }
.work-item-notes textarea { min-height: 78px; }
.work-item-notes .button { width: fit-content; }
.work-items-guide { position: sticky; top: calc(var(--top-height) + 18px); gap: 12px; }
.work-items-guide h2 { font-size: 22px; }
.work-items-guide ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.work-items-guide li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.work-items-guide li strong { color: var(--heading); font-size: 11px; }
.work-items-guide li span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.work-items-guide > p:last-child { padding-top: 2px; font-size: 11px; }
.work-items-pagination .pagination { border: 1px solid var(--border); }
.work-items-empty { min-height: 260px; margin: 0; }

@media (max-width: 1180px) {
    .environment { display: none; }
    .topbar-search { width: min(420px, 38vw); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content { width: calc(100% - 104px); }
    .dashboard-hero { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .refund-item { grid-template-columns: minmax(170px, .65fr) minmax(0, 1.35fr); }
    .refund-meta { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .sidebar {
        inset: auto 0 0;
        z-index: 50;
        width: 100%;
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        display: block;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    .sidebar::-webkit-scrollbar { display: none; }
    .brand { display: none; }
    .sidebar nav {
        width: max-content;
        min-width: 100%;
        height: 56px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 4px;
        padding: 0;
        overflow: visible;
    }
    .sidebar nav a { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; padding-bottom: 14px; }
    .sidebar nav a svg { width: 18px; height: 18px; }
    .sidebar nav a > span,
    .sidebar nav a:hover > span,
    .sidebar nav a:focus-visible > span {
        left: 50%;
        top: auto;
        bottom: 4px;
        width: 48px;
        padding: 0;
        overflow: hidden;
        background: transparent;
        color: rgba(255, 255, 255, .82);
        font-size: 7px;
        line-height: 1;
        text-align: center;
        text-overflow: ellipsis;
        opacity: 1;
        transform: translateX(-50%);
    }
    .sidebar-tooltip::before { display: none; }
    .topbar { padding: 0 12px; }
    .breadcrumb { display: none; }
    .topbar { gap: 8px; }
    .topbar-search { width: auto; min-width: 0; flex: 1 1 auto; margin-left: 0; }
    .topbar-search kbd { display: none; }
    .top-actions { width: auto; flex: 0 0 auto; justify-content: flex-end; gap: 6px; }
    .topbar-status { width: 34px; height: 34px; min-height: 34px; justify-content: center; padding: 0; }
    .topbar-status strong { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .topbar-popover { position: fixed; top: calc(var(--top-height) - 2px); right: 10px; }
    .search-results { grid-template-columns: 1fr; }
    .work-items-layout { grid-template-columns: 1fr; }
    .work-items-guide { position: static; }
    .work-item-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .work-item-facts > div:nth-child(2) { border-right: 0; }
    .work-item-facts > div:nth-child(n + 3) { border-top: 1px solid var(--border-soft); }
    .content {
        width: 100%;
        padding: calc(var(--top-height) + 20px) 14px calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom));
    }
    .page-header { display: grid; align-items: start; gap: 14px; }
    .page-header h1 { font-size: 30px; }
    .dashboard-updated { justify-items: start; }
    .dashboard-hero { grid-template-columns: 1fr; gap: 25px; padding: 24px 22px; }
    .dashboard-hero h2 { font-size: 34px; }
    .dashboard-health { padding: 22px 0 0; border-top: 1px solid rgba(255, 255, 255, .13); border-left: 0; }
    .dashboard-actions a { flex: 1 1 auto; justify-content: center; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .attention-item,
    .dashboard-entity-list > a { padding: 14px 15px; }
    .payment-overview,
    .refund-layout { grid-template-columns: 1fr; }
    .payment-facts { grid-template-columns: 1fr; }
    .payment-facts > div,
    .payment-facts > div:nth-last-child(-n + 2) { border-bottom: 1px solid var(--border-soft); border-left: 0; }
    .payment-facts > div:last-child { border-bottom: 0; }
    .refund-item { grid-template-columns: 1fr; gap: 15px; }
    .refund-meta { grid-column: auto; grid-template-columns: 1fr; }
    .refund-decision-actions { grid-template-columns: 1fr; }
    .metric-grid,
    .two-columns,
    .detail-grid,
    .form-grid,
    .card-grid,
    .permission-grid { grid-template-columns: 1fr; }
    .form-grid .wide,
    .span-2 { grid-column: auto; }
    .filters { display: grid; }
    .filters label { min-width: 0; }
    .panel { padding: 16px; }
    .table-panel { padding: 0; }
    .inline-form,
    .inline-action { align-items: stretch; flex-direction: column; }
    .inline-form input,
    .inline-action input { min-width: 0; }
    .auth-shell { display: block; padding: 20px 14px; }
    .auth-content { width: 100%; margin: 0 auto; }
    .auth-card { min-height: calc(100vh - 40px); padding: 30px 22px; }
    .auth-card-wide { width: 100%; margin-left: 0; transform: none; }
    .auth-brand { margin-bottom: 34px; }
    .auth-brand > img { width: 174px; height: 45px; }
    .auth-brand > small { display: none; }
    .mfa-enrollment { grid-template-columns: 1fr; gap: 18px; }
    .mfa-qr-card { width: min(280px, 100%); justify-self: center; }
    .auth-card header h1 { font-size: 38px; }
    .recovery-grid { grid-template-columns: 1fr; }
    .passkey-stepup,
    .passkey-register-card { grid-template-columns: 1fr; align-items: stretch; }
    .passkey-register-actions { width: 100%; }
    .passkey-item { grid-template-columns: 42px minmax(0, 1fr); }
    .passkey-item form { grid-column: 1 / -1; }
    .passkey-item form .button { width: 100%; }
    .work-items-header .button { width: 100%; }
    .work-item > header { display: grid; }
    .work-item-badges { justify-content: flex-start; }
    .work-item-facts { grid-template-columns: 1fr; }
    .work-item-facts > div,
    .work-item-facts > div:first-child,
    .work-item-facts > div:last-child { padding: 10px 0; border-top: 1px solid var(--border-soft); border-right: 0; }
    .work-item-facts > div:first-child { border-top: 0; }
    .work-item-actions { align-items: stretch; display: grid; }
    .work-item-actions > form,
    .work-item-note-count { margin-left: 0; }
    .work-item-actions .button,
    .work-item-actions .row-link { width: 100%; }
    .work-item-editor > summary,
    .work-item-notes > summary { width: 100%; justify-content: center; }
    .state-card { margin: 0; min-height: calc(100vh - var(--top-height) - var(--mobile-nav-height) - 44px); padding: 26px 18px; }
}

@media (max-width: 420px) {
    .environment { padding: 0 9px; font-size: 9px; }
    .quick-actions { display: none; }
    .topbar-search input { font-size: 11px; }
    .topbar-search input::placeholder { color: transparent; }
    .metric-grid { grid-template-columns: 1fr; }
}

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