/*
 * iKrav — design system.
 *
 * Servido como está, sem etapa de build. Organização:
 *   1. Fonte e tokens   5. Formulários     9. Navegação e menus
 *   2. Base             6. Tabelas        10. Janelas e avisos
 *   3. Tipografia       7. Indicadores    11. Molduras das áreas
 *   4. Botões           8. Cartões        12. Utilitários
 *
 * A cor de cada federação substitui --brand e --brand-contrast em tempo de execução; os tons
 * derivados (fundo suave, anel de foco, hover) são calculados a partir dela.
 */

/* ============================ 1. Fonte e tokens ========================== */

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations"),
         url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations"),
         url("../fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Marca: azul profundo do iKrav; cada federação troca estas duas variáveis. */
    --brand: #2450e3;
    --brand-contrast: #ffffff;

    /* Neutros frios, com tinta quase preta (como a logo). */
    --canvas: #eef0f4;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --surface-sunken: #f3f4f7;
    --border: #e8eaef;
    --border-strong: #d5d9e0;

    --ink: #0b1220;
    --text: #1d2433;
    --text-secondary: #475067;
    --text-muted: #6b7489;
    --text-subtle: #9aa2b4;

    --ok: #077a4c;
    --ok-soft: #e9f8f0;
    --warning: #a85b07;
    --warning-soft: #fff6e6;
    --danger: #c72d1c;
    --danger-soft: #fdf0ee;
    --info: #2450e3;
    --info-soft: #edf2ff;
    --violet: #6e3fd6;
    --violet-soft: #f3efff;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgb(11 18 32 / 0.05);
    --shadow-sm: 0 1px 2px rgb(11 18 32 / 0.04), 0 1px 3px rgb(11 18 32 / 0.06);
    --shadow-md: 0 4px 12px -2px rgb(11 18 32 / 0.08), 0 2px 4px -2px rgb(11 18 32 / 0.04);
    --shadow-lg: 0 24px 48px -12px rgb(11 18 32 / 0.18), 0 8px 16px -8px rgb(11 18 32 / 0.08);
    --shadow-frame: 0 1px 2px rgb(11 18 32 / 0.03), 0 32px 64px -32px rgb(11 18 32 / 0.12);

    --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --sidebar-width: 280px;
    --content-width: 1240px;
    --ease: cubic-bezier(0.2, 0, 0, 1);
}

/*
 * Tons derivados da cor da marca. Ficam no body (e não no :root) para acompanhar a cor da
 * federação, que é aplicada no atributo style do body ou de uma prévia.
 */
body,
.brand-preview {
    --brand-hover: color-mix(in srgb, var(--brand) 86%, black);
    --brand-soft: color-mix(in srgb, var(--brand) 8%, white);
    --brand-softer: color-mix(in srgb, var(--brand) 4%, white);
    --brand-ring: color-mix(in srgb, var(--brand) 16%, transparent);
}

/* ================================ 2. Base ================================ */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    font-feature-settings: "ss01" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

a.link {
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
}

a.link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

::selection {
    background: color-mix(in srgb, var(--brand) 18%, white);
}

[x-cloak] {
    display: none !important;
}

code,
.mono {
    font-family: var(--font-mono);
    font-size: 0.86em;
}

code {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 1px 6px;
    color: var(--ink);
    word-break: break-all;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--lg {
    width: 24px;
    height: 24px;
}

.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;
}

/* ============================== 3. Tipografia ============================ */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.page-header__main {
    min-width: 0;
}

.page-header__title {
    margin: 0;
    color: var(--ink);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-header__description {
    margin: 8px 0 0;
    max-width: 64ch;
    color: var(--text-muted);
    font-size: 16px;
}

.page-header__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-header__kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 15px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.breadcrumbs a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--ink);
}

.breadcrumbs li:last-child {
    color: var(--ink);
}

.breadcrumbs .icon {
    width: 16px;
    height: 16px;
}

.breadcrumbs__sep {
    color: var(--text-subtle);
}

.section-title {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.muted {
    color: var(--text-muted);
}

.subtle {
    color: var(--text-subtle);
}

.small {
    font-size: 13.5px;
}

.strong {
    color: var(--ink);
    font-weight: 600;
}

/* ================================ 4. Botões ============================== */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.05s var(--ease);
}

.btn:active:not(:disabled) {
    transform: translateY(0.5px);
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 80%, black);
    color: var(--brand-contrast);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 1px 2px rgb(11 18 32 / 0.12);
}

.btn--primary:hover:not(:disabled) {
    background: var(--brand-hover);
}

.btn--dark {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 1px 2px rgb(11 18 32 / 0.16);
}

.btn--dark:hover:not(:disabled) {
    background: #222a3a;
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--ink);
    box-shadow: var(--shadow-xs);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--surface-muted);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
    background: var(--surface-sunken);
    color: var(--ink);
}

.btn--danger {
    background: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 80%, black);
    color: #fff;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 1px 2px rgb(11 18 32 / 0.12);
}

.btn--danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--danger) 88%, black);
}

.btn--sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
}

.btn--lg {
    min-height: 46px;
    padding: 11px 20px;
    font-size: 15.5px;
}

.btn--block {
    width: 100%;
}

.btn--icon {
    width: 40px;
    padding: 0;
}

.btn--icon.btn--sm {
    width: 34px;
}

.btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn[data-loading] {
    pointer-events: none;
}

.btn[data-loading] .btn__spinner {
    display: inline-block;
}

.btn[data-loading] .btn__icon {
    display: none;
}

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

/* ============================== 5. Formulários ============================ */

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

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

.form-narrow {
    max-width: 880px;
}

.form-grid > .span-2 {
    grid-column: span 2;
}

.form-grid > .span-all {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field__label {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.field__label .required {
    color: var(--danger);
    margin-left: 2px;
}

.field__help {
    color: var(--text-muted);
    font-size: 13.5px;
}

.field__error {
    color: var(--danger);
    font-size: 13.5px;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    color: var(--ink);
    font-size: 15px;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-subtle);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: color-mix(in srgb, var(--border-strong) 70%, var(--text-subtle));
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--shadow-xs), 0 0 0 4px var(--brand-ring);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
    border-color: color-mix(in srgb, var(--danger) 60%, white);
}

.input[aria-invalid="true"]:focus,
.select[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus {
    box-shadow: var(--shadow-xs), 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input[readonly] {
    background: var(--surface-muted);
    color: var(--text-secondary);
    box-shadow: none;
}

.textarea {
    min-height: 104px;
    resize: vertical;
}

.textarea--tall {
    min-height: 280px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.preview-box {
    min-height: 280px;
    padding: 14px 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.prose {
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.prose > * + * {
    margin-top: 0.8em;
}

.prose p,
.prose ul,
.prose ol {
    margin: 0;
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
}

.prose h1,
.prose h2,
.prose h3 {
    margin: 1.2em 0 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 600;
}

.prose a {
    color: var(--brand);
    text-underline-offset: 3px;
}

.prose blockquote {
    margin: 0;
    padding-left: 14px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-secondary);
}

.select {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group__addon {
    display: flex;
    align-items: center;
    padding: 0 13px;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 14.5px;
    white-space: nowrap;
}

.input-group__addon:first-child {
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group__addon:last-child {
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group__addon:first-child + .input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .input:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-icon {
    position: relative;
}

.input-icon > .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
}

.input-icon > .input {
    padding-left: 40px;
}

.choice {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    font-size: 14.5px;
    cursor: pointer;
}

.choice input[type="checkbox"],
.choice input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--brand);
    flex-shrink: 0;
}

.choice__text small {
    display: block;
    color: var(--text-muted);
    font-size: 13.5px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14.5px;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.switch__track {
    position: relative;
    width: 40px;
    height: 24px;
    background: #d9dde5;
    border-radius: var(--radius-full);
    transition: background-color 0.15s var(--ease);
    flex-shrink: 0;
}

.switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgb(11 18 32 / 0.2);
    transition: transform 0.18s var(--ease);
}

.switch input:checked + .switch__track {
    background: var(--brand);
}

.switch input:checked + .switch__track::after {
    transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

/* Seleção com busca */

.combobox {
    position: relative;
}

.combobox__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

.combobox__placeholder {
    color: var(--text-subtle);
}

.combobox__panel {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.combobox__search {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.combobox__search .input {
    min-height: 36px;
    box-shadow: none;
    font-size: 14.5px;
}

.combobox__options {
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
}

.combobox__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 14.5px;
    cursor: pointer;
}

.combobox__option.is-active {
    background: var(--surface-sunken);
}

.combobox__option.is-selected {
    font-weight: 600;
}

.combobox__option .icon {
    color: var(--brand);
}

.combobox__empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 14.5px;
    text-align: center;
}

/* Envio de arquivo com prévia */

.upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.upload__preview {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-strong);
    background: var(--surface-muted);
    color: var(--text-subtle);
    overflow: hidden;
    flex-shrink: 0;
}

.upload__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload__preview--round {
    border-radius: 50%;
}

.upload__preview--logo {
    border-style: solid;
    background: var(--surface);
}

.upload__preview--logo img {
    object-fit: contain;
    padding: 6px;
}

.sortable-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.sortable-item:first-child {
    border-top: 0;
}

.sortable-item__handle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: -6px;
    border-radius: var(--radius-sm);
    color: var(--text-subtle);
    cursor: grab;
    flex-shrink: 0;
}

.sortable-item__handle:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.sortable-item__main {
    flex: 1;
    min-width: 0;
}

.sortable-item__meta {
    color: var(--text-muted);
    font-size: 13.5px;
}

.sortable-item.is-inactive .belt,
.sortable-item.is-inactive .sortable-item__main {
    opacity: 0.5;
}

.announcement-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.announcement {
    border-top: 1px solid var(--border);
}

.announcement:first-child {
    border-top: 0;
}

.announcement__head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}

.announcement__head:hover {
    background: var(--surface-muted);
}

.announcement__title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

.announcement__date {
    color: var(--text-muted);
    font-size: 13.5px;
    white-space: nowrap;
}

.announcement__chevron {
    color: var(--text-subtle);
    transition: transform 0.15s var(--ease);
}

.announcement__chevron.is-open {
    transform: rotate(180deg);
}

.announcement__body {
    padding: 0 24px 18px;
}

.subject-block {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.subject-block:first-child {
    border-top: 0;
}

.subject-block__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.variation-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0 34px;
    padding: 0;
    list-style: none;
}

.variation-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13.5px;
    cursor: grab;
}

.variation-chip button {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text-subtle);
    cursor: pointer;
}

.variation-chip button:hover {
    background: var(--border);
    color: var(--ink);
}

.tree {
    display: grid;
    gap: 4px;
    max-height: 380px;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tree__children {
    display: grid;
    gap: 4px;
    margin: 2px 0 8px 28px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 16px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.copy-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.copy-field .input {
    flex: 1;
    min-width: 0;
    background: var(--surface-muted);
    font-size: 14px;
}

.color-field {
    display: flex;
    gap: 8px;
}

.color-field__swatch {
    width: 48px;
    height: 42px;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}

.color-field__swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-field__swatch::-webkit-color-swatch {
    border: 0;
    border-radius: 6px;
}

.brand-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.brand-preview__aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    min-height: 150px;
    padding: 12px;
    background:
        radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--brand) 55%, transparent) 0%, transparent 60%),
        var(--ink);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.3;
}

.brand-preview__aside .auth__federation-logo {
    width: 36px;
    height: 36px;
    padding: 4px;
    border-radius: 8px;
}

.brand-preview__form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.brand-preview__line {
    height: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
}

.brand-preview__line--short {
    width: 70%;
}

.brand-preview .btn {
    min-height: 28px;
    font-size: 12px;
    pointer-events: none;
}

.sticky-card {
    position: sticky;
    top: 24px;
}

/* =============================== 6. Tabelas ============================== */

.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
}

.table-toolbar > div:first-child:not(.table-toolbar__filters) {
    flex: 1 1 240px;
    min-width: 0;
}

.table-toolbar__title {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.table-toolbar__filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.table-toolbar__search {
    flex: 1;
    min-width: 220px;
    max-width: 380px;
}

.table-toolbar .select,
.table-toolbar .input {
    min-height: 38px;
    font-size: 14.5px;
}

.table-toolbar .select {
    width: auto;
    min-width: 160px;
}

.table-scroll {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.table th {
    padding: 11px 20px;
    background: var(--surface-muted);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

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

.table tbody tr {
    transition: background-color 0.12s var(--ease);
}

.table tbody tr:hover td {
    background: var(--brand-softer);
}

.table tr.is-clickable {
    cursor: pointer;
}

.table-link {
    color: inherit;
    text-decoration: none;
}

.table .is-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table .is-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.table__sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.table__sort:hover {
    color: var(--ink);
}

.table__sort .icon {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.table__sort.is-sorted {
    color: var(--ink);
}

.table__sort.is-sorted .icon {
    opacity: 1;
}

.table-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.table-person__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.table-person__text strong {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: var(--ink);
    font-weight: 600;
}

.table-person__text strong .badge {
    font-size: 11.5px;
    line-height: 18px;
    padding: 0 7px;
}

.table-person__text span {
    color: var(--text-muted);
    font-size: 13.5px;
}

.is-loading-region {
    opacity: 0.55;
    transition: opacity 0.15s var(--ease);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}

.pagination__pages {
    display: flex;
    gap: 4px;
}

.pagination__page {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.pagination__page:hover:not(:disabled):not(.is-current) {
    background: var(--surface-sunken);
    color: var(--ink);
}

.pagination__page.is-current {
    background: var(--surface-sunken);
    border-color: var(--border);
    color: var(--ink);
    font-weight: 600;
    cursor: default;
}

.pagination__page--nav {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
    background: var(--surface);
}

.pagination__page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================= 7. Indicadores ============================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}

.badge--dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--violet { background: var(--violet-soft); color: var(--violet); }
.badge--brand { background: var(--brand-soft); color: var(--brand); }

.belt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    vertical-align: middle;
}

.belt__swatch {
    width: 28px;
    height: 10px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgb(11 18 32 / 0.18);
    flex-shrink: 0;
}

.belt__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.belt--none {
    color: var(--text-subtle);
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, white), color-mix(in srgb, var(--brand) 6%, white));
    color: color-mix(in srgb, var(--brand) 85%, black);
    box-shadow: inset 0 0 0 1px rgb(11 18 32 / 0.06);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--logo {
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border);
}

.avatar--logo img {
    object-fit: contain;
}

.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }
.avatar--xl { width: 88px; height: 88px; font-size: 28px; }

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14.5px;
}

.alert > .icon {
    margin-top: 1px;
}

.alert__title {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-weight: 600;
}

.alert__body {
    min-width: 0;
}

.link-button {
    display: inline;
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.alert--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 14%, transparent); }
.alert--ok > .icon { color: var(--ok); }
.alert--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 16%, transparent); }
.alert--warning > .icon { color: var(--warning); }
.alert--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 14%, transparent); }
.alert--danger > .icon { color: var(--danger); }
.alert--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 12%, transparent); }
.alert--info > .icon { color: var(--info); }

.alert code {
    display: block;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgb(255 255 255 / 0.8);
}

.progress {
    height: 8px;
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    background: var(--brand);
    border-radius: inherit;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
}

.trend--up { background: var(--ok-soft); color: var(--ok); }
.trend--down { background: var(--danger-soft); color: var(--danger); }

/* =============================== 8. Cartões ============================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 0;
}

.card__title {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card__description {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

.card__body {
    padding: 20px 24px 24px;
}

.card__header + .checklist,
.card__header + .table-scroll {
    margin-top: 16px;
}

.card__progress {
    padding: 18px 24px 6px;
}

.card__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
}

.card--muted {
    background: var(--surface-muted);
}

/* Números em destaque: um grupo com divisórias, como nas referências */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    min-width: 0;
}

.stat + .stat {
    border-left: 1px solid var(--border);
}

.stat__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-sunken);
    color: var(--ink);
    flex-shrink: 0;
}

.stat__body {
    min-width: 0;
}

.stat__label {
    color: var(--text-muted);
    font-size: 14.5px;
}

.stat__value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
    color: var(--ink);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.stat__hint {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.profile-hero__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.pre-line {
    white-space: pre-line;
}

.federation-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.federation-hero__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.federation-hero__url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swatch-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(11 18 32 / 0.12);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 56px 24px;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}

.empty__title {
    color: var(--ink);
    font-size: 16.5px;
    font-weight: 600;
}

.empty__text {
    max-width: 46ch;
    color: var(--text-muted);
    font-size: 14.5px;
}

.empty__actions {
    margin-top: 14px;
}

.dl {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    margin: 0;
}

.dl dt,
.dl dd {
    margin: 0;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
}

.dl dt {
    color: var(--text-muted);
}

.dl dd {
    color: var(--ink);
    font-weight: 500;
}

.dl dd.muted {
    color: var(--text-subtle);
    font-weight: 400;
}

.dl--stacked {
    grid-template-columns: 1fr;
}

.dl--stacked dt {
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 13.5px;
}

.dl--stacked dd {
    padding-top: 2px;
}

.dl dt:last-of-type,
.dl dd:last-of-type {
    border-bottom: 0;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0 0 8px;
}

.checklist__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 16px;
    margin: 0 8px;
    padding: 13px 16px;
    border-radius: var(--radius-md);
}

.checklist__item + .checklist__item {
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.checklist__label {
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 500;
}

.checklist__value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14.5px;
    text-align: right;
}

.checklist__hint {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

/* Lista de passos com marcação (próximos passos) */

.steps-list {
    list-style: none;
    margin: 0;
    padding: 0 8px 8px;
}

.steps-list__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
}

.steps-list__item + .steps-list__item {
    border-top: 1px solid var(--border);
}

.steps-list__mark {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    color: transparent;
    flex-shrink: 0;
}

.steps-list__mark .icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.75;
}

.steps-list__item.is-done .steps-list__mark {
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}

.steps-list__item.is-done .steps-list__text {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--text-subtle);
}

.steps-list__text {
    flex: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 500;
}

/* ========================= 9. Navegação e menus ========================== */

.tabs {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-width: 100%;
}

.tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tabs__item:hover {
    color: var(--ink);
}

.tabs--small {
    padding: 3px;
}

.tabs--small .tabs__item {
    padding: 4px 10px;
    font-size: 13px;
}

.tabs__item.is-disabled {
    color: var(--text-subtle);
    cursor: default;
}

.tabs__item.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    position: absolute;
    z-index: 50;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown__menu--up {
    top: auto;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
}

.dropdown__menu--start {
    left: 0;
    right: auto;
}

.notification-bell__button {
    position: relative;
}

.notification-bell__count {
    position: absolute;
    top: 2px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.notification-bell__menu {
    width: min(360px, calc(100vw - 24px));
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
}

.notification-bell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 10px;
    color: var(--ink);
    font-size: 14.5px;
}

.notification-bell__head .link-button {
    font-size: 13px;
}

.notification-bell__empty {
    padding: 18px 10px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.notification-item {
    position: relative;
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 10px 10px 10px 22px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    text-align: left;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--surface-sunken);
}

.notification-item.is-unread::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 16px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
}

.notification-item__title {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.notification-item__body {
    color: var(--text-secondary);
    font-size: 13.5px;
}

.notification-item__time {
    color: var(--text-subtle);
    font-size: 12.5px;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font-size: 14.5px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.dropdown__item:hover,
.dropdown__item:focus-visible {
    background: var(--surface-sunken);
    outline: none;
}

.dropdown__item .icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.dropdown__item--danger,
.dropdown__item--danger .icon {
    color: var(--danger);
}

.dropdown__separator {
    height: 1px;
    margin: 6px -6px;
    background: var(--border);
}

.dropdown__label {
    padding: 8px 10px 6px;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.4;
}

.dropdown__label strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

/* ======================== 10. Janelas e avisos =========================== */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgb(11 18 32 / 0.42);
    backdrop-filter: blur(3px);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 16px;
    overflow-y: auto;
}

.modal__panel {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal__panel--lg {
    max-width: 760px;
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 24px 0;
}

.modal__title {
    margin: 0;
    color: var(--ink);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.modal__description {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

.modal__body {
    padding: 20px 24px 24px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.modal__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--danger-soft);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger-soft) 50%, white);
    color: var(--danger);
}

.drawer {
    position: fixed;
    z-index: 90;
    top: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column;
    width: min(520px, calc(100vw - 24px));
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.drawer__body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.toasts {
    position: fixed;
    z-index: 100;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14.5px;
    pointer-events: auto;
}

.toast > .icon {
    margin-top: 1px;
}

.toast--ok > .icon { color: #4ade9a; }
.toast--danger > .icon { color: #ff9a8a; }
.toast--warning > .icon { color: #ffcc66; }
.toast--info > .icon { color: #9db7ff; }

.toast__close {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: rgb(255 255 255 / 0.55);
    cursor: pointer;
}

.toast__close:hover {
    color: #fff;
}

.fade-enter { transition: opacity 0.15s var(--ease); }
.fade-start { opacity: 0; }
.fade-end { opacity: 1; }
.pop-enter { transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); }
.pop-start { opacity: 0; transform: translateY(6px) scale(0.98); }
.pop-end { opacity: 1; transform: none; }
.slide-enter { transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.slide-start { transform: translateX(24px); opacity: 0; }
.slide-end { transform: none; opacity: 1; }

/* ======================= 11. Molduras das áreas ========================== */

/* Painel (iKrav e federação): aplicação numa moldura branca sobre o fundo */

.app {
    min-height: 100vh;
    padding: 12px;
}

.app__frame {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-frame);
}

.sidebar {
    border-right: 1px solid var(--border);
}

.sidebar__inner {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 26px);
    padding: 24px 16px 16px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px 24px;
}

.sidebar__brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.sidebar__brand img {
    height: 30px;
    width: auto;
}

.sidebar__brand img.sidebar__brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar__brand-name {
    display: -webkit-box;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sidebar__close {
    display: none;
}

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.nav-section + .nav-section {
    margin-top: 22px;
}

.nav-section__title {
    padding: 0 12px 8px;
    color: var(--text-subtle);
    font-size: 13px;
    font-weight: 500;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}

.nav-item + .nav-item {
    margin-top: 2px;
}

.nav-item .icon {
    color: var(--text-muted);
}

.nav-item:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.nav-item.is-active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 600;
}

.nav-item.is-active .icon {
    color: var(--brand);
}

.nav-item.is-disabled {
    color: var(--text-subtle);
    cursor: default;
}

.nav-item.is-disabled .icon {
    color: var(--text-subtle);
}

.nav-item.is-disabled:hover {
    background: none;
}

.nav-item > span:not(.nav-item__soon) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item__soon {
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-subtle);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
}

.sidebar__bottom {
    display: grid;
    gap: 12px;
    padding-top: 16px;
}

.sidebar-card {
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.sidebar-card__title {
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
}

.sidebar-card__text {
    margin: 2px 0 12px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.sidebar-card .progress {
    background: var(--border);
}

.sidebar-card__link {
    display: inline-block;
    margin-top: 12px;
    color: var(--brand);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    text-align: left;
    cursor: pointer;
}

.user-button:hover {
    background: var(--surface-sunken);
}

.user-button__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.35;
}

.user-button__text strong {
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-button__text span {
    color: var(--text-muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main {
    min-width: 0;
}

.support-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 16px 0;
    padding: 10px 14px;
    background: var(--ink);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
}

.support-banner form {
    margin-left: auto;
}

.support-banner__button {
    padding: 5px 12px;
    background: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.mobilebar {
    display: none;
}

.content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 40px 48px 72px;
}

.shell__backdrop {
    display: none;
}

@media (max-width: 1200px) {
    .content {
        padding: 32px 32px 64px;
    }
}

@media (max-width: 1024px) {
    .app {
        padding: 0;
    }

    .app__frame {
        display: block;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .sidebar {
        position: fixed;
        z-index: 70;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(var(--sidebar-width), 86vw);
        background: var(--surface);
        transform: translateX(-100%);
        transition: transform 0.25s var(--ease);
    }

    .sidebar.is-open {
        transform: none;
        box-shadow: var(--shadow-lg);
    }

    .sidebar__inner {
        position: static;
        height: 100%;
    }

    .sidebar__close {
        display: inline-flex;
    }

    .shell__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgb(11 18 32 / 0.4);
    }

    .mobilebar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 10px;
        height: 60px;
        padding: 0 12px;
        background: rgb(255 255 255 / 0.92);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--border);
    }

    .mobilebar img {
        height: 26px;
        width: auto;
    }

    .content {
        padding: 24px 16px 56px;
    }
}

/* Área do membro (aluno e instrutor): coluna central, navegação inferior no celular */

.member {
    min-height: 100vh;
}

.member-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(255 255 255 / 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.member-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1040px;
    height: 68px;
    margin: 0 auto;
    padding: 0 20px;
}

.member-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.member-header__brand img {
    height: 30px;
    width: auto;
}

.member-header__brand span {
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-nav {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
}

.member-nav__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
}

.member-nav__item:hover {
    color: var(--ink);
}

.member-nav__item.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.member-nav__item.is-disabled {
    color: var(--text-subtle);
    pointer-events: none;
}

.member-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 20px 64px;
}

.bottom-nav {
    display: none;
}

@media (max-width: 860px) {
    .member {
        padding-bottom: 84px;
    }

    .member-header .member-nav {
        display: none;
    }

    .member-header__inner {
        height: 60px;
    }

    .member-content {
        padding: 24px 16px 40px;
    }

    .bottom-nav {
        position: fixed;
        z-index: 60;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        padding: 6px;
        background: rgb(255 255 255 / 0.94);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
    }

    .bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 7px 2px;
        border-radius: var(--radius-lg);
        color: var(--text-subtle);
        font-size: 11.5px;
        font-weight: 500;
        text-decoration: none;
    }

    .bottom-nav__item.is-active {
        background: var(--brand-soft);
        color: var(--brand);
        font-weight: 600;
    }

    .bottom-nav__item.is-disabled {
        opacity: 0.55;
        pointer-events: none;
    }
}

/* Telas de acesso: moldura dividida, painel da marca à esquerda */

.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth__frame {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    width: 100%;
    max-width: 1120px;
    min-height: min(720px, calc(100vh - 48px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-frame);
    overflow: hidden;
}

.auth__aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 10px;
    padding: 40px;
    background:
        radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--brand) 55%, transparent) 0%, transparent 55%),
        radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--brand) 30%, transparent) 0%, transparent 60%),
        var(--ink);
    border-radius: 20px;
    color: #fff;
    overflow: hidden;
}

.auth__aside::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -70px;
    width: 400px;
    height: 400px;
    background: url("../brand/icon-white.png") center / contain no-repeat;
    opacity: 0.07;
    pointer-events: none;
}

.auth__aside > img {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    height: 34px;
    width: auto;
}

.auth__tagline {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.auth__tagline h2 {
    margin: 0 0 14px;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.auth__tagline p {
    margin: 0;
    color: rgb(255 255 255 / 0.72);
    font-size: 16px;
}

.auth__features {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    color: rgb(255 255 255 / 0.86);
    font-size: 14.5px;
}

.auth__features li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth__features .icon {
    width: 18px;
    height: 18px;
    color: color-mix(in srgb, var(--brand) 40%, white);
}

.auth__aside small {
    position: relative;
    z-index: 1;
    color: rgb(255 255 255 / 0.5);
    font-size: 13px;
}

.auth__federation {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.auth__federation-logo {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 6px;
    background: #fff;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.auth__federation-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth__federation-name {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.auth__federation--compact .auth__federation-logo {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
}

.auth__federation--compact .auth__federation-name {
    color: var(--ink);
    font-size: 16px;
}

.auth__aside--federation::after {
    display: none;
}

.auth__powered {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth__powered img {
    height: 16px;
    width: auto;
    opacity: 0.7;
}

.auth__main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px clamp(24px, 6vw, 72px);
}

.auth__form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth__logo {
    display: none;
    margin-bottom: 36px;
}

.auth__logo img {
    height: 32px;
    width: auto;
}

.auth__title {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.auth__lead {
    margin: 0 0 32px;
    color: var(--text-muted);
    font-size: 15.5px;
}

.auth__footer {
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 14.5px;
    text-align: center;
}

@media (max-width: 900px) {
    .auth {
        padding: 0;
        place-items: stretch;
    }

    .auth__frame {
        display: block;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth__aside {
        display: none;
    }

    .auth__logo {
        display: block;
    }

    .auth__main {
        justify-content: flex-start;
        padding: 48px 20px;
    }
}

/* Páginas de sistema (configuração pendente, atualizando) */

.setup {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 20px 72px;
}

.setup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 40px;
}

.setup__header img {
    height: 30px;
    width: auto;
}

.setup .card,
.setup .alert {
    margin-bottom: 16px;
}

/* ============================== 12. Utilitários =========================== */

.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 28px; }
.cluster { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 20px; align-items: start; }
.grid-aside--wide { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
.mr-auto { margin-right: auto; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }

.swatch {
    height: 64px;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgb(11 18 32 / 0.06);
}

@media (max-width: 860px) {
    .form-grid,
    .form-grid--3,
    .grid-2,
    .grid-3,
    .grid-aside {
        grid-template-columns: 1fr;
    }

    .form-grid > .span-2 {
        grid-column: auto;
    }

    .page-header {
        margin-bottom: 24px;
    }

    .page-header__title {
        font-size: 26px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .stat + .stat {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .stat {
        gap: 14px;
        padding: 16px 18px;
    }

    .stat__icon {
        width: 40px;
        height: 40px;
    }

    .stat__value {
        font-size: 24px;
    }

    .dl {
        grid-template-columns: 1fr;
    }

    .dl dt {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .checklist__item {
        grid-template-columns: 1fr;
    }

    .checklist__value {
        justify-content: flex-start;
        text-align: left;
    }
}

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