/*
 * Warrior TV — Design System (camada de componentes).
 * Consome os tokens de includes/design-tokens.php (única fonte de cor/raio/espaço/tipografia):
 * nenhum valor de cor literal aqui. Usado pelo shell (includes/layout.php) e por todas as páginas.
 * Sem Bootstrap.
 */

/* ─── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--label);
    background-color: var(--bg);
    background-image: var(--bg-image);
    background-size: cover;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color var(--motion-fast) var(--ease-out); }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--separator); margin: var(--space-6) 0; }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* ─── Typography ───────────────────────────────────────────────── */
.onbr-display { font-size: 34px; font-weight: 700; letter-spacing: -0.024em; line-height: 1.12; }
.onbr-title-1 { font-size: 28px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.2; }
.onbr-title-2 { font-size: 22px; font-weight: 600; letter-spacing: -0.019em; line-height: 1.25; }
.onbr-title-3 { font-size: 19px; font-weight: 600; letter-spacing: -0.017em; line-height: 1.3; }
.onbr-headline { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; }
.onbr-body { font-size: 15px; font-weight: 400; letter-spacing: -0.01em; }
.onbr-callout { font-size: 14px; font-weight: 400; letter-spacing: -0.006em; }
.onbr-caption { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--label-secondary); }
.onbr-mono { font-family: var(--font-mono); font-size: 13px; }
.onbr-muted { color: var(--label-secondary); }
.onbr-tertiary { color: var(--label-tertiary); }

/* ─── Shell layout ─────────────────────────────────────────────── */
.onbr-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}
.onbr-shell[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr); }

/* ─── Sidebar ──────────────────────────────────────────────────── */
.onbr-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: var(--blur-material);
    -webkit-backdrop-filter: var(--blur-material);
    border-right: 1px solid var(--separator);
    padding: var(--space-5) var(--space-3) var(--space-3);
    gap: var(--space-5);
    z-index: var(--z-sidebar);
}
.onbr-sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    text-decoration: none;
    color: var(--label);
}
.onbr-sidebar__brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}
.onbr-sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.onbr-sidebar__brand-title { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; }
.onbr-sidebar__brand-subtitle { font-size: 12px; color: var(--label-secondary); }

.onbr-sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin: 0 calc(var(--space-3) * -1);
    padding: 0 var(--space-3);
}
.onbr-sidebar__scroll::-webkit-scrollbar { width: 4px; }
.onbr-sidebar__scroll::-webkit-scrollbar-thumb { background: var(--fill-strong); border-radius: 4px; }

.onbr-nav-section__title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--label-tertiary);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
}
.onbr-nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.onbr-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--label-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.006em;
    text-decoration: none;
    transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
    white-space: normal;
    line-height: 1.3;
    overflow: hidden;
}
.onbr-nav-item span { min-width: 0; overflow-wrap: anywhere; }
.onbr-nav-item:hover { background: var(--fill); color: var(--label); }
.onbr-nav-item[aria-current="page"] {
    background: var(--nav-active-bg);
    color: var(--nav-active);
    font-weight: 600;
}
.onbr-nav-item[aria-current="page"] svg { color: var(--nav-active); }
.onbr-nav-item svg { flex-shrink: 0; width: 20px; height: 20px; color: currentColor; }

.onbr-sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--separator);
}

.onbr-sidebar[data-collapsed="true"] .onbr-sidebar__brand-text,
.onbr-sidebar[data-collapsed="true"] .onbr-nav-section__title,
.onbr-sidebar[data-collapsed="true"] .onbr-nav-item span,
.onbr-sidebar[data-collapsed="true"] .onbr-user-menu__label {
    display: none;
}

/* ─── Topbar ───────────────────────────────────────────────────── */
.onbr-topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 var(--space-7);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: var(--blur-material);
    -webkit-backdrop-filter: var(--blur-material);
    border-bottom: 1px solid var(--separator);
    z-index: var(--z-topbar);
}
.onbr-topbar__breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--label-secondary);
    min-width: 0;
    flex-shrink: 1;
}
.onbr-topbar__breadcrumb strong { color: var(--label); font-weight: 600; letter-spacing: -0.01em; }
.onbr-topbar__search {
    flex: 1;
    max-width: 420px;
    margin: 0 auto;
    position: relative;
}
.onbr-topbar__search input {
    width: 100%;
    height: 36px;
    padding: 0 var(--space-4) 0 36px;
    background: var(--fill);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--label);
    font-size: 14px;
    transition: background var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.onbr-topbar__search input:hover { background: var(--fill-hover); }
.onbr-topbar__search input:focus { background: var(--surface); border-color: var(--accent); outline: none; }
.onbr-topbar__search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--label-tertiary);
    pointer-events: none;
}
.onbr-topbar__search kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--label-tertiary);
    background: var(--fill-strong);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    pointer-events: none;
}
.onbr-topbar__actions { display: flex; align-items: center; gap: var(--space-2); }

/* ─── Content ──────────────────────────────────────────────────── */
.onbr-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.onbr-content__body {
    padding: var(--space-7);
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
}
.onbr-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}
.onbr-page-header__text { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.onbr-page-header__title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.2;
    color: var(--label);
    text-wrap: balance;
}
.onbr-page-header__subtitle {
    font-size: 15px;
    color: var(--label-secondary);
    margin-top: var(--space-1);
}
.onbr-page-header__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.onbr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 120px;
    height: 44px;
    padding: 0 var(--space-5);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background var(--motion-fast) var(--ease-out),
                color var(--motion-fast) var(--ease-out),
                transform var(--motion-fast) var(--ease-out),
                opacity var(--motion-fast) var(--ease-out);
    white-space: nowrap;
    user-select: none;
    border: 1px solid transparent;
}
.onbr-btn:active:not(:disabled) { transform: scale(0.98); }
.onbr-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.onbr-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.onbr-btn--primary { background: var(--accent); color: var(--label-on-accent); }
.onbr-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.onbr-btn--primary:active:not(:disabled) { background: var(--accent-pressed); }

.onbr-btn--secondary { background: var(--fill); color: var(--label); }
.onbr-btn--secondary:hover:not(:disabled) { background: var(--fill-hover); }

.onbr-btn--tertiary { background: transparent; color: var(--accent); border-color: var(--separator); }
.onbr-btn--tertiary:hover:not(:disabled) { background: var(--accent-soft); }

.onbr-btn--destructive { background: var(--danger); color: var(--label-on-accent); }
.onbr-btn--destructive:hover:not(:disabled) { background: var(--danger-hover); }

.onbr-btn--ghost { background: transparent; color: var(--label); min-width: 0; }
.onbr-btn--ghost:hover:not(:disabled) { background: var(--fill); }

.onbr-btn--sm { height: 32px; min-width: 0; padding: 0 var(--space-3); font-size: 13px; border-radius: var(--radius-sm); }
.onbr-btn--lg { height: 52px; font-size: 16px; padding: 0 var(--space-6); }
.onbr-btn--block { width: 100%; }

.onbr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--label-secondary);
    background: transparent;
    cursor: pointer;
    transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.onbr-icon-btn:hover { background: var(--fill); color: var(--label); }
.onbr-icon-btn:active { transform: scale(0.96); }
.onbr-icon-btn svg { width: 18px; height: 18px; }

/* ─── Fields ───────────────────────────────────────────────────── */
.onbr-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.onbr-field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--label);
    letter-spacing: -0.006em;
}
.onbr-field__hint { font-size: 12px; color: var(--label-secondary); }
.onbr-field__error { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.onbr-input, .onbr-select, .onbr-textarea {
    width: 100%;
    min-height: var(--input-height);
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--label);
    font-size: 15px;
    letter-spacing: -0.01em;
    transition: background var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}
.onbr-input::placeholder, .onbr-textarea::placeholder { color: var(--label-tertiary); }
.onbr-input:hover, .onbr-select:hover, .onbr-textarea:hover { background: var(--input-bg-hover); }
.onbr-input:focus, .onbr-select:focus, .onbr-textarea:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--input-border-focus);
    box-shadow: var(--focus-ring);
}
.onbr-input:disabled, .onbr-select:disabled, .onbr-textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.onbr-textarea { resize: vertical; min-height: 96px; padding: 12px 14px; }
.onbr-field--error .onbr-input,
.onbr-field--error .onbr-select,
.onbr-field--error .onbr-textarea { border-color: var(--input-border-error); }
.onbr-field--error .onbr-field__label { color: var(--danger); }
.onbr-field--inline { flex-direction: row; align-items: center; gap: var(--space-3); }
.onbr-check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.onbr-check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ─── Cards ────────────────────────────────────────────────────── */
.onbr-card {
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}
.onbr-card--elevated { box-shadow: var(--shadow-md); }
.onbr-card--inset { background: var(--surface-sunken); box-shadow: none; }
.onbr-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.onbr-card__title { font-size: 19px; font-weight: 600; letter-spacing: -0.017em; color: var(--label); }
.onbr-card__subtitle { font-size: 14px; color: var(--label-secondary); margin-top: 2px; }

/* ─── Grid helpers ─────────────────────────────────────────────── */
.onbr-grid { display: grid; gap: var(--space-4); }
.onbr-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.onbr-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.onbr-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.onbr-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.onbr-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

/* Stat cards grid — auto-fit so it collapses cleanly on mobile. */
.onbr-stats {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ─── Tables ───────────────────────────────────────────────────── */
/* Contêiner: rola nos dois eixos (cabeçalho fica fixo no scroll vertical; no celular a tabela
   rola na horizontal DENTRO do contêiner, com sombra indicando conteúdo além da borda). */
.onbr-table-wrap {
    background:
        linear-gradient(to right, var(--surface) 30%, transparent) left center / 24px 100% no-repeat local,
        linear-gradient(to left, var(--surface) 30%, transparent) right center / 24px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, var(--separator-strong), transparent) left center / 10px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, var(--separator-strong), transparent) right center / 10px 100% no-repeat scroll,
        var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-xl);
    overflow: auto;
    max-height: 72vh;
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}
.onbr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.onbr-table thead th {
    text-align: left;
    padding: var(--table-cell-y) var(--table-cell-x);
    font-weight: 600;
    font-size: 12px;
    color: var(--label-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--table-head-bg);
    border-bottom: 1px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}
.onbr-table tbody tr {
    border-bottom: 1px solid var(--separator);
    transition: background var(--motion-fast) var(--ease-out);
}
.onbr-table tbody tr:last-child { border-bottom: 0; }
.onbr-table tbody tr:hover { background: var(--table-row-hover); }
.onbr-table td { padding: var(--table-cell-y) var(--table-cell-x); color: var(--label); vertical-align: middle; }
.onbr-table td.is-muted { color: var(--label-secondary); }
.onbr-table .is-actions, .onbr-table th.is-actions { text-align: right; white-space: nowrap; }
.onbr-table .is-num, .onbr-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.onbr-table--compact thead th { padding: var(--table-cell-y-compact) var(--table-cell-x-compact); }
.onbr-table--compact td { padding: var(--table-cell-y-compact) var(--table-cell-x-compact); font-size: 13px; }

/* ─── Badges ───────────────────────────────────────────────────── */
.onbr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.006em;
    background: var(--fill-strong);
    color: var(--label-secondary);
}
.onbr-badge--success { background: var(--success-soft); color: var(--success); }
.onbr-badge--warning { background: var(--warning-soft); color: var(--warning); }
.onbr-badge--danger  { background: var(--danger-soft); color: var(--danger); }
.onbr-badge--info    { background: var(--info-soft); color: var(--info); }
.onbr-badge--accent  { background: var(--accent-soft); color: var(--accent); }
.onbr-badge--pending  { background: var(--info-soft); color: var(--info); }
.onbr-badge--expiring { background: var(--warning-soft); color: var(--warning); }
.onbr-badge--expired, .onbr-badge--blocked { background: var(--danger-soft); color: var(--danger); }
.onbr-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── Segmented control ────────────────────────────────────────── */
.onbr-segmented {
    display: inline-flex;
    padding: 3px;
    background: var(--fill);
    border-radius: var(--radius-md);
    gap: 2px;
}
.onbr-segmented__item {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--label-secondary);
    text-decoration: none;
    border-radius: calc(var(--radius-md) - 3px);
    transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
    cursor: pointer;
    border: 0;
    background: transparent;
}
.onbr-segmented__item:hover { color: var(--label); }
.onbr-segmented__item[aria-selected="true"],
.onbr-segmented__item.is-active {
    background: var(--surface);
    color: var(--label);
    box-shadow: var(--shadow-sm);
}

/* ─── Toggle ───────────────────────────────────────────────────── */
.onbr-toggle { position: relative; display: inline-block; width: 51px; height: 31px; }
.onbr-toggle input { opacity: 0; width: 0; height: 0; }
.onbr-toggle__track {
    position: absolute;
    inset: 0;
    background: var(--fill-strong);
    border-radius: var(--radius-pill);
    transition: background var(--motion-base) var(--ease-out);
    cursor: pointer;
}
.onbr-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background: var(--switch-thumb);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--motion-base) var(--ease-out);
}
.onbr-toggle input:checked ~ .onbr-toggle__track { background: var(--success); }
.onbr-toggle input:checked ~ .onbr-toggle__thumb { transform: translateX(20px); }

/* ─── Sheet (modal) ────────────────────────────────────────────── */
.onbr-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--motion-base) var(--ease-out);
}
.onbr-sheet-backdrop.is-open { opacity: 1; }
.onbr-sheet {
    background: var(--surface);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    opacity: 0;
    transition: transform var(--motion-base) var(--ease-out), opacity var(--motion-base) var(--ease-out);
}
.onbr-sheet-backdrop.is-open .onbr-sheet { transform: translateY(0); opacity: 1; }
.onbr-sheet__header { padding: var(--space-6) var(--space-6) 0; }
.onbr-sheet__body   { padding: var(--space-4) var(--space-6); }
.onbr-sheet__footer {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6) var(--space-6);
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ─── Toast ────────────────────────────────────────────────────── */
.onbr-toasts {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: var(--z-toast);
    pointer-events: none;
}
.onbr-toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--surface-elevated);
    border: 1px solid var(--separator);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    max-width: 380px;
    pointer-events: auto;
    animation: onbr-toast-in var(--motion-base) var(--ease-out);
}
.onbr-toast--success { border-left: 3px solid var(--success); }
.onbr-toast--danger, .onbr-toast--error { border-left: 3px solid var(--danger); }
.onbr-toast--info    { border-left: 3px solid var(--accent); }
@keyframes onbr-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Empty state ──────────────────────────────────────────────── */
.onbr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-5);
    gap: var(--space-3);
    color: var(--label-secondary);
}
.onbr-empty__icon {
    width: 64px;
    height: 64px;
    color: var(--label-tertiary);
    margin-bottom: var(--space-2);
}
.onbr-empty__title { font-size: 17px; font-weight: 600; color: var(--label); letter-spacing: -0.012em; }
.onbr-empty__desc  { font-size: 14px; max-width: 360px; }

/* ─── Skeleton ─────────────────────────────────────────────────── */
.onbr-skeleton {
    background: linear-gradient(90deg, var(--fill) 0%, var(--fill-strong) 50%, var(--fill) 100%);
    background-size: 200% 100%;
    animation: onbr-shimmer 1.4s linear infinite;
    border-radius: var(--radius-sm);
    min-height: 14px;
}
@keyframes onbr-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ─── Divider / separator line ─────────────────────────────────── */
.onbr-divider { height: 1px; background: var(--separator); margin: var(--space-5) 0; }

/* ─── User menu (sidebar footer) ──────────────────────────────── */
.onbr-user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--label);
    transition: background var(--motion-fast) var(--ease-out);
}
.onbr-user-menu:hover { background: var(--fill); }
.onbr-user-menu__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--fill-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--label);
    flex-shrink: 0;
}
.onbr-user-menu__label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.onbr-user-menu__name  { font-size: 14px; font-weight: 500; letter-spacing: -0.006em; }
.onbr-user-menu__meta  { font-size: 12px; color: var(--label-secondary); }

/* ─── Mobile drawer (abaixo de 1024px) ────────────────────────── */
.onbr-drawer-btn { display: none; }
.onbr-drawer-overlay { display: none; }
@media (max-width: 1023px) {
    .onbr-shell { grid-template-columns: minmax(0, 1fr); }
    .onbr-drawer-btn { display: inline-flex; }
    .onbr-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 84vw;
        max-width: 320px;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform var(--motion-slow) var(--ease-out), visibility 0s linear var(--motion-slow);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-drawer);
        background: var(--surface);
    }
    .onbr-shell[data-drawer="open"] .onbr-sidebar {
        transform: translateX(0);
        visibility: visible;
        transition: transform var(--motion-slow) var(--ease-out), visibility 0s;
    }
    .onbr-shell[data-drawer="open"] .onbr-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--overlay);
        z-index: var(--z-overlay);
    }
    .onbr-topbar { padding: 0 var(--space-4); }
    .onbr-content__body { padding: var(--space-5) var(--space-4); }
}
@media (max-width: 767px) {
    .onbr-page-header__title { font-size: 22px; }
    /* Busca colapsa para um ícone que expande ao tocar. */
    .onbr-topbar__search { flex: 0 0 auto; margin: 0 0 0 auto; max-width: none; }
    .onbr-topbar__search input { width: 36px; padding: 0; color: transparent; cursor: pointer; }
    .onbr-topbar__search input::placeholder { color: transparent; }
    .onbr-topbar__search kbd { display: none; }
    .onbr-topbar__search.is-open { position: absolute; left: var(--space-4); right: var(--space-4); top: 10px; margin: 0; max-width: none; z-index: 2; }
    .onbr-topbar__search.is-open input { width: 100%; padding: 0 var(--space-4) 0 36px; color: var(--label); cursor: text; background: var(--surface); border-color: var(--accent); }
    .onbr-topbar__search.is-open input::placeholder { color: var(--label-tertiary); }
    .onbr-grid--cols-2, .onbr-grid--cols-3, .onbr-grid--cols-4 { grid-template-columns: 1fr; }
    .onbr-toasts { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); }
    .onbr-toast { min-width: 0; max-width: none; }
}

/* ─── Page header: identificador da seção ──────────────────────── */
.onbr-page-header__eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-1);
}

/* ─── Button states ────────────────────────────────────────────── */
.onbr-btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.onbr-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid var(--label-on-accent);
    border-right-color: transparent;
    border-radius: 50%;
    animation: onbr-spin 0.7s linear infinite;
}
.onbr-btn--secondary.is-loading::after, .onbr-btn--ghost.is-loading::after, .onbr-btn--tertiary.is-loading::after {
    border-color: var(--label);
    border-right-color: transparent;
}
@keyframes onbr-spin { to { transform: rotate(360deg); } }
.onbr-btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.onbr-btn:focus-visible, .onbr-icon-btn:focus-visible, .onbr-nav-item:focus-visible, .onbr-segmented__item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.onbr-btn-group { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; }

/* ─── Cards: panel, stat, alert ────────────────────────────────── */
.onbr-card__body { }
.onbr-card--flush { padding: 0; overflow: hidden; }
.onbr-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--separator);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--label);
    min-width: 0;
}
a.onbr-stat:hover { border-color: var(--accent); color: var(--label); }
.onbr-stat__label { font-size: 13px; font-weight: 500; color: var(--label-secondary); display: flex; align-items: center; gap: var(--space-2); }
.onbr-stat__label svg { width: 18px; height: 18px; color: var(--accent); }
.onbr-stat__value { font-size: 34px; font-weight: 700; letter-spacing: -0.024em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.onbr-stat__hint { font-size: 12px; color: var(--label-tertiary); }

.onbr-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--separator);
    border-left-width: 3px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: var(--space-4);
}
.onbr-alert__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.onbr-alert__body { flex: 1; min-width: 0; }
.onbr-alert__title { font-weight: 600; letter-spacing: -0.01em; }
.onbr-alert__text { font-size: 14px; color: var(--label-secondary); }
.onbr-alert__action { flex-shrink: 0; }
.onbr-alert--info    { border-left-color: var(--info); }    .onbr-alert--info .onbr-alert__icon    { color: var(--info); }
.onbr-alert--success { border-left-color: var(--success); } .onbr-alert--success .onbr-alert__icon { color: var(--success); }
.onbr-alert--warning { border-left-color: var(--warning); } .onbr-alert--warning .onbr-alert__icon { color: var(--warning); }
.onbr-alert--danger  { border-left-color: var(--danger); }  .onbr-alert--danger .onbr-alert__icon  { color: var(--danger); }

/* ─── Pagination & breadcrumbs ─────────────────────────────────── */
.onbr-pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-1); flex-wrap: wrap; margin-top: var(--space-5); list-style: none; }
.onbr-pagination__item {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--label-secondary);
    font-size: 14px; font-weight: 500;
    text-decoration: none;
    background: transparent;
}
a.onbr-pagination__item:hover { background: var(--fill); color: var(--label); }
.onbr-pagination__item[aria-current="page"] { background: var(--accent); color: var(--label-on-accent); }
.onbr-pagination__item[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.onbr-breadcrumbs { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; color: var(--label-secondary); list-style: none; margin-bottom: var(--space-3); }
.onbr-breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--label-tertiary); }
.onbr-breadcrumbs a { color: var(--label-secondary); }
.onbr-breadcrumbs a:hover { color: var(--accent); }
.onbr-breadcrumbs [aria-current="page"] { color: var(--label); font-weight: 600; }

/* ─── Toast com ícone ──────────────────────────────────────────── */
.onbr-toast__icon { width: 20px; height: 20px; flex-shrink: 0; }
.onbr-toast--success .onbr-toast__icon { color: var(--success); }
.onbr-toast--danger .onbr-toast__icon, .onbr-toast--error .onbr-toast__icon { color: var(--danger); }
.onbr-toast--info .onbr-toast__icon { color: var(--info); }
.onbr-toast__text { font-size: 14px; }

/* ─── Modal (sheet) acessível ──────────────────────────────────── */
.onbr-sheet-backdrop[hidden] { display: none; }

/* ─── Menu suspenso (dropdown) ─────────────────────────────────── */
.onbr-dropdown { position: relative; display: inline-block; }
.onbr-dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
    background: var(--surface-elevated); border: 1px solid var(--separator);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: var(--space-1); z-index: var(--z-modal); display: none;
}
.onbr-dropdown.is-open .onbr-dropdown__menu { display: block; }
.onbr-dropdown__item {
    display: block; width: 100%; text-align: left; padding: 8px 12px;
    border-radius: var(--radius-sm); color: var(--label); font-size: 14px; text-decoration: none;
}
.onbr-dropdown__item:hover { background: var(--fill); color: var(--label); }

/* ─── Formulário em grade ──────────────────────────────────────── */
.onbr-form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.onbr-form-actions { display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--space-5); }
.onbr-section-title { font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--label-tertiary); margin: var(--space-6) 0 var(--space-3); }

/* ─── Ajustes de estado ────────────────────────────────────────── */
.onbr-alert[hidden], .onbr-field__error[hidden], .onbr-toast[hidden], .onbr-empty[hidden] { display: none; }
.onbr-btn.is-loading:disabled { opacity: 1; }
.onbr-input-icon { position: relative; }
.onbr-input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--label-tertiary); pointer-events: none; }
.onbr-input-icon > .onbr-input { padding-left: 40px; }

/* ─── Tiny utilities ───────────────────────────────────────────── */
.onbr-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.onbr-hidden { display: none !important; }
