:root {
    --clients-bg: #f7f8fb;
    --clients-surface: #ffffff;
    --clients-surface-muted: #eef3f2;
    --clients-text: #162033;
    --clients-text-soft: #5d6878;
    --clients-text-muted: #7b8492;
    --clients-primary: #073c5d;
    --clients-primary-hover: #052f49;
    --clients-accent: #0f8b8d;
    --clients-gold: #b98a32;
    --clients-border: #dfe6ea;
    --clients-border-strong: #c7d2d9;
    --clients-danger: #a33a2c;
    --clients-danger-bg: #fff4f1;
    --clients-success: #226b47;
    --clients-shadow-soft: 0 1px 2px rgba(22, 32, 51, 0.05);
    --clients-shadow: 0 18px 45px rgba(22, 32, 51, 0.12);
    --clients-radius: 8px;
    --clients-transition-fast: 150ms ease-out;
    --clients-transition-base: 200ms ease-out;
    --clients-transition-slow: 300ms ease-out;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    background: var(--clients-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--clients-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    background: linear-gradient(180deg, #ffffff 0, #f7f8fb 440px, #f7f8fb 100%);
}

button,
input,
select {
    font: inherit;
}

button:not(:disabled) {
    cursor: pointer;
}

code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
}

[hidden] {
    display: none !important;
}

.clients-shell {
    width: min(100%, 1680px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.clients-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.brand {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    border-radius: var(--clients-radius);
    color: inherit;
    text-decoration: none;
    transition: background var(--clients-transition-fast), box-shadow var(--clients-transition-fast);
}

.brand:hover {
    background: rgba(15, 139, 141, 0.06);
}

.brand:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.icon-btn:focus-visible,
.help-dot:focus-visible {
    outline: 3px solid rgba(185, 138, 50, 0.45);
    outline-offset: 3px;
}

.brand img {
    display: block;
    width: 174px;
    height: 42px;
}

.header-actions {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    text-align: right;
}

.client-switch-btn {
    min-height: 34px;
    max-width: min(360px, 42vw);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid rgba(15, 139, 141, 0.28);
    border-radius: var(--clients-radius);
    background: rgba(15, 139, 141, 0.08);
    color: var(--clients-primary);
    font-size: 0.85rem;
    font-weight: 800;
}

.client-switch-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The impersonation label exposes the client's api_key and domain. It is only
   ever shown to internal (@wealthreader.com) users, so it is permanently and
   heavily blurred: a commercial can screen-share a demo without leaking which
   client they are impersonating. It is never unblurred (not even on hover), to
   avoid accidental exposure while sharing. */
.client-switch-label {
    filter: blur(6px);
    -webkit-filter: blur(6px);
    user-select: none;
    -webkit-user-select: none;
}

.client-switch-btn:hover {
    border-color: var(--clients-accent);
    background: var(--clients-surface-muted);
}

.clients-main {
    display: grid;
    place-items: center;
    padding: 54px 0 72px;
}

.auth-card {
    width: min(100%, 520px);
    padding: 32px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--clients-shadow);
}

.api-key-card {
    width: min(100%, 560px);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--clients-accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    color: var(--clients-text);
    font-weight: 800;
    letter-spacing: 0;
}

h1 {
    font-size: 2rem;
    line-height: 1.12;
}

h2 {
    font-size: 1.2rem;
    line-height: 1.2;
}

.lead,
.section-head p,
.placeholder-panel p {
    margin: 10px 0 0;
    color: var(--clients-text-soft);
    font-size: 1rem;
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--clients-radius);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background var(--clients-transition-base),
        border-color var(--clients-transition-base),
        color var(--clients-transition-base),
        box-shadow var(--clients-transition-base);
}

.btn-small {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.85rem;
}

.btn-ic {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn:disabled {
    cursor: wait;
    opacity: 0.58;
}

.btn-primary {
    background: var(--clients-primary);
    color: #ffffff;
    box-shadow: var(--clients-shadow-soft);
}

.btn-primary:hover:not(:disabled) {
    background: var(--clients-primary-hover);
    box-shadow: 0 10px 20px rgba(7, 60, 93, 0.18);
}

.btn-secondary,
.btn-ghost {
    border-color: var(--clients-border-strong);
    background: #ffffff;
    color: var(--clients-text);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
    border-color: var(--clients-accent);
    background: var(--clients-surface-muted);
}

.btn-danger {
    border-color: rgba(163, 58, 44, 0.24);
    background: #ffffff;
    color: var(--clients-danger);
}

.btn-danger:hover:not(:disabled) {
    border-color: var(--clients-danger);
    background: var(--clients-danger-bg);
}

.auth-status {
    min-height: 22px;
    margin: 18px 0 0;
    color: var(--clients-text-muted);
    font-size: 0.92rem;
}

.auth-status.is-error {
    color: var(--clients-danger);
}

.auth-status.is-success {
    color: var(--clients-success);
}

.setup-alert {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(163, 58, 44, 0.22);
    border-radius: var(--clients-radius);
    background: var(--clients-danger-bg);
    color: var(--clients-danger);
    font-size: 0.92rem;
}

.api-key-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    margin-top: 24px;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span,
.label-row {
    color: var(--clients-text-soft);
    font-size: 0.86rem;
    font-weight: 800;
}

.label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.field input,
.field select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--clients-border-strong);
    border-radius: var(--clients-radius);
    background: #ffffff;
    color: var(--clients-text);
}

.field input:disabled {
    background: #f1f4f6;
    color: var(--clients-text-muted);
}

.field input:focus,
.field select:focus {
    outline: 3px solid rgba(185, 138, 50, 0.25);
    border-color: var(--clients-gold);
}

.field-help {
    color: var(--clients-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.field-help a {
    color: var(--clients-primary);
    font-weight: 800;
}

.field-help.warning {
    padding: 8px 10px;
    border: 1px solid rgba(185, 138, 50, 0.34);
    border-radius: var(--clients-radius);
    background: #fff9eb;
    color: #7a5518;
}

.help-dot {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--clients-border-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--clients-primary);
    cursor: help;
    font-size: 0.76rem;
    font-weight: 900;
}

.tooltip-bubble {
    position: fixed;
    z-index: 5000;
    max-width: min(340px, calc(100vw - 24px));
    padding: 10px 12px;
    border: 1px solid var(--clients-border-strong);
    border-radius: var(--clients-radius);
    background: #ffffff;
    box-shadow: var(--clients-shadow);
    color: var(--clients-text);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    pointer-events: none;
}

.tooltip-bubble[hidden] {
    display: none;
}

.app-view {
    width: 100%;
    align-self: start;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
}

.app-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: rgba(255, 255, 255, 0.82);
}

.nav-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: var(--clients-radius);
    background: transparent;
    color: var(--clients-text-soft);
    font-weight: 800;
    text-align: left;
    padding: 0 12px;
    transition:
        background var(--clients-transition-base),
        border-color var(--clients-transition-base),
        color var(--clients-transition-base);
}

.nav-ic {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

.nav-item.active .nav-ic {
    opacity: 1;
}

.nav-item:hover {
    background: var(--clients-surface-muted);
    color: var(--clients-text);
}

.nav-item.active {
    border-color: rgba(15, 139, 141, 0.24);
    background: rgba(15, 139, 141, 0.10);
    color: var(--clients-primary);
}

.app-content {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 18px;
}

.app-hero,
.panel-section,
.placeholder-panel {
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: rgba(255, 255, 255, 0.94);
}

.app-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
}

.panel-section {
    width: 100%;
    display: none;
    padding: 22px;
}

.panel-section.active {
    display: block;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1060px;
}

.data-table.compact {
    min-width: 320px;
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--clients-border);
    text-align: left;
    vertical-align: top;
    font-size: 0.9rem;
}

.data-table th {
    color: var(--clients-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.data-table th .table-heading-help {
    color: inherit;
    font-size: inherit;
}

.data-table th .help-dot {
    width: 18px;
    height: 18px;
    color: var(--clients-primary);
    font-size: 0.7rem;
    text-transform: none;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.muted-cell {
    color: var(--clients-text-muted);
    overflow-wrap: anywhere;
}

.subtle {
    color: var(--clients-text-soft);
    font-size: 0.78rem;
}

.auth-code {
    display: inline-block;
    max-width: 260px;
    padding: 5px 7px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #f7f8fb;
    overflow-wrap: anywhere;
    color: var(--clients-primary);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.icon-action {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--clients-border-strong);
    border-radius: var(--clients-radius);
    background: #ffffff;
    color: var(--clients-primary);
    transition:
        background var(--clients-transition-base),
        border-color var(--clients-transition-base),
        color var(--clients-transition-base);
}

.icon-action:hover {
    border-color: var(--clients-accent);
    background: var(--clients-surface-muted);
}

.icon-action.is-danger {
    border-color: rgba(163, 58, 44, 0.24);
    color: var(--clients-danger);
}

.icon-action.is-danger:hover {
    border-color: var(--clients-danger);
    background: var(--clients-danger-bg);
}

.icon-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-action.is-loading {
    position: relative;
    color: transparent;
}

.icon-action.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(7, 60, 93, 0.22);
    border-top-color: var(--clients-primary);
    border-radius: 999px;
    animation: wr-spin 700ms linear infinite;
}

.icon-action.is-loading.is-danger::after {
    border-top-color: var(--clients-danger);
}

@keyframes wr-spin {
    to {
        transform: rotate(360deg);
    }
}

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

.empty-state {
    margin: 0;
    padding: 18px;
    color: var(--clients-text-muted);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
}

.metric-card span {
    color: var(--clients-text-soft);
    font-size: 0.82rem;
    font-weight: 800;
}

.metric-card strong {
    color: var(--clients-primary);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.45rem;
}

.placeholder-panel {
    padding: 28px;
}

.doc-list,
.link-list {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.doc-list article {
    display: grid;
    gap: 6px;
}

.doc-list h3 {
    margin: 0;
    font-size: 1rem;
}

.doc-list p {
    margin: 0;
    color: var(--clients-text-soft);
}

.doc-list a,
.link-list a {
    color: var(--clients-primary);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.doc-list a:hover,
.link-list a:hover {
    color: var(--clients-accent);
}

.domain-dialog,
.account-dialog,
.client-picker-dialog,
.confirm-dialog {
    width: min(94vw, 620px);
    padding: 0;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    box-shadow: var(--clients-shadow);
    overflow: visible;
}

.domain-dialog::backdrop,
.result-dialog::backdrop,
.account-dialog::backdrop,
.client-picker-dialog::backdrop,
.confirm-dialog::backdrop {
    background: rgba(22, 32, 51, 0.42);
}

.domain-form {
    display: grid;
    gap: 15px;
    padding: 22px;
    background: #ffffff;
    overflow: visible;
}

.account-card,
.client-picker-card,
.confirm-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    background: #ffffff;
}

.account-card .modal-header,
.client-picker-card .modal-header {
    align-items: flex-start;
}

.account-card .modal-header p,
.client-picker-card .modal-header p,
.confirm-card p {
    margin: 6px 0 0;
    color: var(--clients-text-soft);
}

.account-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.account-summary div {
    padding: 12px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #f7f8fb;
}

.account-summary dt {
    color: var(--clients-text-soft);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-summary dd {
    margin: 5px 0 0;
    color: var(--clients-text);
    overflow-wrap: anywhere;
    font-weight: 800;
}

.account-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.product-readonly-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-chip {
    min-height: 42px;
    display: inline-grid;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
}

.product-chip strong {
    color: var(--clients-text);
    font-size: 0.84rem;
}

.product-chip code {
    color: var(--clients-text-muted);
    font-size: 0.7rem;
}

.client-list {
    max-height: min(52vh, 430px);
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
}

.client-option {
    width: 100%;
    min-height: 56px;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
    color: var(--clients-text);
    text-align: left;
}

.client-option:hover,
.client-option.active {
    border-color: var(--clients-accent);
    background: rgba(15, 139, 141, 0.08);
}

.client-option span {
    font-weight: 800;
}

.client-option small {
    color: var(--clients-text-soft);
}

.modal-header,
.modal-actions,
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.switch-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--clients-text-soft);
    font-size: 0.92rem;
    font-weight: 700;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
    color: var(--clients-text-soft);
    font-weight: 800;
    transition: background var(--clients-transition-base), border-color var(--clients-transition-base);
}

.icon-btn:hover {
    border-color: var(--clients-accent);
    background: var(--clients-surface-muted);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.product-option {
    min-height: 54px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
}

.product-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    padding: 0;
}

.product-option span {
    color: var(--clients-text);
    font-size: 0.88rem;
    font-weight: 800;
}

.product-option code {
    grid-column: 2;
    color: var(--clients-text-muted);
    font-size: 0.72rem;
}

.product-option.is-disabled {
    background: #f2f4f5;
    color: var(--clients-text-muted);
    opacity: 0.62;
}

.result-dialog {
    width: min(94vw, 560px);
    padding: 0;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    box-shadow: var(--clients-shadow);
}

.result-card {
    display: grid;
    gap: 14px;
    padding: 22px;
    background: #ffffff;
}

.result-dialog.is-success .result-card {
    border-top: 4px solid var(--clients-success);
}

.result-dialog.is-error .result-card {
    border-top: 4px solid var(--clients-danger);
}

.result-card p {
    margin: 0;
    color: var(--clients-text-soft);
}

.result-meta {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #f7f8fb;
}

.result-meta:empty {
    display: none;
}

.result-meta dt {
    color: var(--clients-text-soft);
    font-weight: 800;
}

.result-meta dd {
    margin: 0;
    color: var(--clients-text);
    overflow-wrap: anywhere;
}

/* ======================================================================
   Usage panel ("Uso")
   ====================================================================== */

.usage-head {
    flex-wrap: wrap;
}

.usage-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.usage-range {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: var(--clients-surface-muted);
}

.range-chip {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--clients-text-soft);
    font-weight: 800;
    font-size: 0.82rem;
    transition: background var(--clients-transition-base), color var(--clients-transition-base), box-shadow var(--clients-transition-base);
}

.range-chip:hover {
    color: var(--clients-text);
}

.range-chip.active {
    background: #ffffff;
    color: var(--clients-primary);
    box-shadow: var(--clients-shadow-soft);
}

.usage-refresh .usage-refresh-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
}

.usage-refresh.is-spinning .usage-refresh-icon {
    animation: wr-spin 800ms linear infinite;
}

.u-svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.usage-updated {
    margin: 0 0 16px;
    color: var(--clients-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.usage-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--clients-text-muted);
    font-weight: 700;
}

.usage-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(7, 60, 93, 0.18);
    border-top-color: var(--clients-primary);
    border-radius: 999px;
    animation: wr-spin 800ms linear infinite;
}

.usage-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 54px 24px;
    text-align: center;
}

.usage-empty-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    color: var(--clients-accent);
    border: 1px solid var(--clients-border);
    border-radius: 14px;
    background: rgba(15, 139, 141, 0.08);
}

.usage-empty-icon svg {
    width: 28px;
    height: 28px;
}

.usage-empty h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--clients-text);
}

.usage-empty p {
    margin: 0;
    max-width: 420px;
    color: var(--clients-text-soft);
}

.usage-body {
    display: grid;
    gap: 16px;
}

/* KPI cards */
.usage-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.usage-kpi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
    transition: border-color var(--clients-transition-base), box-shadow var(--clients-transition-base), transform var(--clients-transition-base);
}

.usage-kpi:hover {
    border-color: var(--clients-border-strong);
    box-shadow: var(--clients-shadow-soft);
    transform: translateY(-1px);
}

.usage-kpi-ic {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(7, 60, 93, 0.08);
    color: var(--clients-primary);
}

.usage-kpi-ic svg {
    width: 20px;
    height: 20px;
}

.usage-kpi.accent-success .usage-kpi-ic {
    background: rgba(34, 107, 71, 0.12);
    color: var(--clients-success);
}

.usage-kpi.accent-gold .usage-kpi-ic {
    background: rgba(185, 138, 50, 0.16);
    color: #8a661f;
}

.usage-kpi.accent-challenge .usage-kpi-ic {
    background: rgba(74, 165, 124, 0.16);
    color: #2c7d54;
}

.usage-kpi.accent-danger .usage-kpi-ic {
    background: rgba(163, 58, 44, 0.12);
    color: var(--clients-danger);
}

.usage-kpi.accent-muted .usage-kpi-ic {
    background: var(--clients-surface-muted);
    color: var(--clients-text-soft);
}

.usage-kpi-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.usage-kpi-label {
    color: var(--clients-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.usage-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.usage-kpi-value {
    color: var(--clients-text);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.5rem;
    line-height: 1.1;
}

.usage-kpi.accent-success .usage-kpi-value {
    color: var(--clients-success);
}

.usage-kpi.accent-gold .usage-kpi-value {
    color: #8a661f;
}

.usage-kpi.accent-challenge .usage-kpi-value {
    color: #2f8559;
}

.usage-kpi.accent-danger .usage-kpi-value {
    color: var(--clients-danger);
}

.usage-kpi-note {
    color: var(--clients-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.usage-delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
}

.usage-delta.up {
    color: var(--clients-success);
    background: rgba(34, 107, 71, 0.1);
}

.usage-delta.down {
    color: var(--clients-danger);
    background: rgba(163, 58, 44, 0.1);
}

.usage-delta.flat {
    color: var(--clients-text-muted);
    background: var(--clients-surface-muted);
}

/* Meta strip */
.usage-meta-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: rgba(255, 255, 255, 0.7);
}

.usage-meta-item {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 9px;
    row-gap: 0;
}

.usage-meta-ic {
    grid-row: 1 / span 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--clients-surface-muted);
    color: var(--clients-accent);
}

.usage-meta-ic svg {
    width: 17px;
    height: 17px;
}

.usage-meta-val {
    align-self: end;
    color: var(--clients-text);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
    font-size: 1.05rem;
}

.usage-meta-label {
    align-self: start;
    color: var(--clients-text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

/* Cards */
.usage-card {
    padding: 18px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #ffffff;
}

.usage-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.usage-card-head h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--clients-text);
}

.usage-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 16px;
}

.usage-legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--clients-text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: currentColor;
}

.dot-success {
    background: #2f8559;
}

.dot-challenge {
    background: #4aa57c;
}

.dot-warning {
    background: #c8911f;
}

.dot-error {
    background: #bd4636;
}

/* Chart (stacked bars) */
.usage-chart {
    padding-top: 4px;
}

.chart-cols {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 174px;
}

.chart-col {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.chart-stack-wrap {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: flex-end;
}

.chart-stack {
    width: 100%;
    max-width: 34px;
    min-height: 3px;
    margin: 0 auto;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 5px 5px 3px 3px;
    overflow: hidden;
    transition: filter var(--clients-transition-base);
}

.seg {
    display: block;
    width: 100%;
    flex-basis: 0;
    min-height: 2px;
}

.seg-success {
    background: #2f8559;
}

.seg-challenge {
    background: #4aa57c;
}

.seg-warning {
    background: #c8911f;
}

.seg-error {
    background: #bd4636;
}

.chart-col:hover .chart-stack {
    filter: brightness(1.06) saturate(1.05);
}

.chart-x {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--clients-text-muted);
    white-space: nowrap;
}

.chart-x.is-hidden {
    visibility: hidden;
}

/* Donut */
.usage-donut-card {
    display: flex;
    flex-direction: column;
}

.usage-donut-wrap {
    position: relative;
    width: 164px;
    height: 164px;
    margin: 4px auto 10px;
}

.usage-donut {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#e9eef1 0 100%);
    -webkit-mask: radial-gradient(circle, transparent 53%, #000 54%);
    mask: radial-gradient(circle, transparent 53%, #000 54%);
}

.usage-donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    pointer-events: none;
}

.usage-donut-center strong {
    color: var(--clients-text);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.6rem;
    line-height: 1;
}

.usage-donut-center span {
    color: var(--clients-text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.usage-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 7px;
}

.usage-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.usage-legend .legend-label {
    color: var(--clients-text);
    font-weight: 700;
}

.usage-legend .legend-val {
    margin-left: auto;
    color: var(--clients-text-soft);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

/* Two-column grid (entities + codes) */
.usage-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.usage-entities {
    display: grid;
    gap: 12px;
}

.entity-row {
    display: flex;
    align-items: center;
    gap: 11px;
}

.entity-logo {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--clients-border);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.entity-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.entity-logo.is-mono {
    border-color: transparent;
    background: var(--mono-bg, var(--clients-primary));
}

.entity-logo.is-mono::after {
    content: attr(data-initials);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.entity-logo.sm {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.entity-logo.sm.is-mono::after {
    font-size: 0.6rem;
}

.entity-main {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 6px;
}

.entity-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.entity-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--clients-text);
    font-weight: 700;
    font-size: 0.9rem;
}

.entity-count {
    flex: 0 0 auto;
    color: var(--clients-text-soft);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
}

.entity-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--clients-surface-muted);
    overflow: hidden;
}

.entity-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--clients-accent), var(--clients-primary));
}

.entity-rate {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: right;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--clients-text-soft);
}

.entity-rate.good {
    color: var(--clients-success);
}

.entity-rate.warn {
    color: #8a661f;
}

.entity-rate.bad {
    color: var(--clients-danger);
}

/* Codes list */
.usage-codes {
    display: grid;
    gap: 8px;
}

.code-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) 70px auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: var(--clients-radius);
    background: transparent;
    text-align: left;
    transition: background var(--clients-transition-base), border-color var(--clients-transition-base);
}

.code-row:hover {
    border-color: var(--clients-border);
    background: var(--clients-surface-muted);
}

.code-num {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clients-text);
}

.code-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--clients-text-soft);
    font-size: 0.84rem;
}

.code-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--clients-surface-muted);
    overflow: hidden;
}

.code-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.code-count {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--clients-text);
    text-align: right;
}

/* Calls table */
.usage-calls-head {
    align-items: flex-start;
    flex-wrap: wrap;
}

.usage-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.usage-status-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-chip {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--clients-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--clients-text-soft);
    font-weight: 700;
    font-size: 0.8rem;
    transition: background var(--clients-transition-base), border-color var(--clients-transition-base), color var(--clients-transition-base);
}

.status-chip:hover {
    border-color: var(--clients-accent);
    color: var(--clients-text);
}

.status-chip.active {
    border-color: rgba(15, 139, 141, 0.4);
    background: rgba(15, 139, 141, 0.1);
    color: var(--clients-primary);
}

.code-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.code-filter-chip .chip-x {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.usage-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.usage-search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--clients-text-muted);
    pointer-events: none;
}

.usage-search input {
    min-height: 34px;
    width: min(280px, 60vw);
    padding: 0 12px 0 32px;
    border: 1px solid var(--clients-border-strong);
    border-radius: var(--clients-radius);
    background: #ffffff;
    color: var(--clients-text);
}

.usage-search input:focus {
    outline: 3px solid rgba(185, 138, 50, 0.22);
    border-color: var(--clients-gold);
}

.usage-calls-table {
    min-width: 760px;
}

.usage-calls-table tbody tr {
    cursor: pointer;
    transition: background var(--clients-transition-fast);
}

.usage-calls-table tbody tr:hover {
    background: var(--clients-surface-muted);
}

.usage-calls-table tbody tr:focus-visible {
    outline: 2px solid rgba(15, 139, 141, 0.5);
    outline-offset: -2px;
}

.usage-calls-table td {
    vertical-align: middle;
}

.usage-when {
    color: var(--clients-text-soft);
    font-size: 0.82rem;
    white-space: nowrap;
}

.usage-domain {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.entity-cell-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    font-weight: 700;
}

.usage-result-cell {
    white-space: nowrap;
}

.usage-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.usage-pill .dot {
    width: 7px;
    height: 7px;
    background: currentColor;
}

.pill-success {
    background: rgba(34, 107, 71, 0.12);
    color: var(--clients-success);
}

.pill-challenge {
    background: rgba(74, 165, 124, 0.16);
    color: #2c7d54;
}

.pill-warning {
    background: rgba(185, 138, 50, 0.16);
    color: #8a661f;
}

.pill-error {
    background: rgba(163, 58, 44, 0.12);
    color: var(--clients-danger);
}

.pill-maintenance {
    background: rgba(194, 105, 28, 0.15);
    color: #b35f17;
}

.pill-other,
.pill-running,
.pill-cancelled {
    background: var(--clients-surface-muted);
    color: var(--clients-text-soft);
}

.usage-code-mini {
    margin-left: 7px;
    color: var(--clients-text-muted);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.74rem;
}

.mono-cell {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    color: var(--clients-text-soft);
    white-space: nowrap;
}

.usage-calls-table tbody.is-loading {
    opacity: 0.5;
    transition: opacity var(--clients-transition-base);
}

.usage-mini-empty {
    margin: 0;
    padding: 18px 4px;
    color: var(--clients-text-muted);
    font-size: 0.86rem;
}

/* Pagination */
.usage-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.usage-page-info {
    color: var(--clients-text-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.usage-page-btns {
    display: flex;
    gap: 8px;
}

/* Detail dialog */
.usage-detail-dialog {
    width: min(94vw, 580px);
}

.usage-detail-header {
    align-items: flex-start;
}

.usage-detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.usage-detail-title h2 {
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.usage-detail-logo .entity-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.usage-detail-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--clients-radius);
}

.usage-detail-status .dot {
    width: 9px;
    height: 9px;
    background: currentColor;
}

.usage-detail-status strong {
    font-weight: 800;
}

.usage-detail-response {
    display: grid;
    gap: 6px;
}

.usage-detail-response > span {
    color: var(--clients-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.usage-detail-response pre {
    margin: 0;
    max-height: 200px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #f7f8fb;
    color: var(--clients-text);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* --- Portal banners (avisos) — full-width strips above the header --------- */

.portal-banners {
    width: 100%;
}

.portal-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 20px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.portal-banner + .portal-banner {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.portal-banner-info {
    background: linear-gradient(90deg, #246e49, #2f8559);
}

.portal-banner-warning {
    background: linear-gradient(90deg, #a87715, #c8911f);
}

.portal-banner-critical {
    background: linear-gradient(90deg, #a23a2b, #bd4636);
}

.portal-banner-icon {
    flex: 0 0 auto;
    display: inline-flex;
}

.portal-banner-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.portal-banner-close {
    flex: 0 0 auto;
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background var(--clients-transition-fast);
}

.portal-banner-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* --- Banner admin (staff-only "Avisos" section) ---------------------------- */

.banner-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.banner-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.banner-form textarea {
    resize: vertical;
    min-height: 76px;
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--clients-border);
    border-radius: var(--clients-radius);
    background: #f7f8fb;
    color: var(--clients-text);
}

.banner-form textarea:focus {
    outline: 2px solid var(--clients-accent);
    outline-offset: 1px;
}

.banner-counter {
    text-align: right;
    color: var(--clients-text-muted);
}

.banner-importance {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.importance-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1.5px solid var(--clients-border);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--clients-transition-fast), background var(--clients-transition-fast);
}

.importance-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.importance-chip .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.importance-info .dot { background: #2f8559; }
.importance-warning .dot { background: #c8911f; }
.importance-critical .dot { background: #bd4636; }

.importance-info:has(input:checked) { border-color: #2f8559; background: rgba(47, 133, 89, 0.1); }
.importance-warning:has(input:checked) { border-color: #c8911f; background: rgba(200, 145, 31, 0.1); }
.importance-critical:has(input:checked) { border-color: #bd4636; background: rgba(189, 70, 54, 0.1); }

.banner-form-row {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.banner-days-field {
    max-width: 130px;
}

.switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.banner-preview .portal-banner {
    border-radius: var(--clients-radius);
}

.banner-preview .portal-banner-close {
    pointer-events: none;
}

.banner-form-actions {
    display: flex;
    justify-content: flex-end;
}

.banner-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 640px;
    overflow: auto;
}

.banner-item {
    border: 1px solid var(--clients-border);
    border-left-width: 4px;
    border-radius: var(--clients-radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.banner-item-info { border-left-color: #2f8559; }
.banner-item-warning { border-left-color: #c8911f; }
.banner-item-critical { border-left-color: #bd4636; }

.banner-item.is-inactive {
    opacity: 0.62;
}

.banner-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.banner-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.banner-pill-info { background: rgba(47, 133, 89, 0.14); color: #226b47; }
.banner-pill-warning { background: rgba(200, 145, 31, 0.16); color: #8e6512; }
.banner-pill-critical { background: rgba(189, 70, 54, 0.14); color: #9b3327; }

.banner-state {
    font-size: 0.76rem;
    font-weight: 700;
}

.banner-state.is-live { color: #226b47; }
.banner-state.is-expired { color: var(--clients-text-muted); }
.banner-state.is-off { color: var(--clients-danger); }

.banner-item-message {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.banner-item-meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px 14px;
}

.banner-item-meta dt {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clients-text-muted);
}

.banner-item-meta dd {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--clients-text);
}

.banner-item-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1080px) {
    .usage-charts {
        grid-template-columns: 1fr;
    }

    .banner-admin-grid {
        grid-template-columns: 1fr;
    }

    .usage-donut-card {
        align-items: center;
    }
}

@media (max-width: 900px) {
    .usage-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .usage-meta-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .usage-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .usage-kpis {
        grid-template-columns: 1fr;
    }

    .usage-meta-strip {
        grid-template-columns: 1fr 1fr;
    }

    .usage-filters {
        width: 100%;
    }

    .usage-search input {
        width: 100%;
    }
}

@media (max-width: 860px) {
    .clients-shell {
        padding: 16px;
    }

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

    .clients-main {
        place-items: start stretch;
        padding: 30px 0 48px;
    }

    .auth-card {
        padding: 24px;
    }

    h1 {
        font-size: 1.62rem;
    }

    .auth-actions,
    .api-key-form {
        grid-template-columns: 1fr;
    }

    .app-view {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-item {
        justify-content: center;
        text-align: center;
    }

    .app-hero,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .clients-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        flex: none;
        margin-left: 0;
    }

    .client-switch-btn {
        max-width: 100%;
    }

    .app-sidebar,
    .metrics-grid,
    .product-grid,
    .account-summary {
        grid-template-columns: 1fr;
    }

    .row-actions {
        align-items: center;
        flex-direction: row;
    }

    .modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

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

    *:hover,
    *:focus-visible,
    *:active {
        transform: none !important;
    }
}
