/* Design tokens — light */
:root,
[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: rgba(79, 70, 229, 0.12);
    --teal: #0d9488;
    --teal-soft: rgba(13, 148, 136, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 14px;
    --radius-sm: 10px;
    --font: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --header-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
    --bg: #0b1220;
    --bg-elevated: #111827;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --border: #1f2937;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.15);
    --teal: #2dd4bf;
    --teal-soft: rgba(45, 212, 191, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(17, 24, 39, 0.92);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.app-header__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-brand {
 font-weight: 700;
 font-size: 1.1rem;
 color: var(--text);
 text-decoration: none;
 letter-spacing: -0.02em;
}
.app-brand:hover { text-decoration: none; color: var(--accent); }

.app-nav {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.app-nav__link {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
}
.app-nav__link:hover { color: var(--text); text-decoration: none; }
.app-nav__link--active {
    background: var(--accent-soft);
    color: var(--accent);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.6rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    max-width: 220px;
}

.user-chip__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-chip__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-chip__name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip__role {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.page-auth .app-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: calc(100vh - 56px);
}

body.page-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: #020617;
    background-image:
        radial-gradient(ellipse 100% 90% at 82% -28%, rgba(99, 102, 241, 0.48) 0%, transparent 52%),
        radial-gradient(ellipse 72% 52% at 4% 102%, rgba(34, 211, 238, 0.16) 0%, transparent 48%),
        radial-gradient(ellipse 55% 42% at 48% 118%, rgba(79, 70, 229, 0.2) 0%, transparent 42%),
        linear-gradient(168deg, #020617 0%, #0c1222 38%, #1e1b4b 58%, #020617 100%);
    background-attachment: fixed;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
}

.page-auth .auth-topbar {
    flex-shrink: 0;
    background: rgba(2, 6, 23, 0.72);
    border-bottom-color: rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.auth-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-auth .auth-brand {
    color: #f8fafc;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.page-auth .theme-toggle {
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.45);
}

.page-auth .theme-toggle:hover {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(165, 180, 252, 0.35);
    color: #fff;
}

/* NEXUS login — full-viewport gradient, single glass panel (no nested cards) */
.auth-login-shell {
    position: relative;
    width: 100%;
    max-width: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.auth-login-page {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-top));
    padding-right: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-right));
    padding-bottom: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-bottom));
    padding-left: max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-left));
    isolation: isolate;
    overflow-x: hidden;
}

.auth-login-page__mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 18% 28%, rgba(99, 102, 241, 0.12) 0%, transparent 38%),
        radial-gradient(circle at 88% 72%, rgba(34, 211, 238, 0.08) 0%, transparent 42%);
}

.auth-login-page__grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
    background-size: min(56px, 12vw) min(56px, 12vw);
    mask-image: radial-gradient(ellipse 72% 62% at 50% 48%, #000 22%, transparent 68%);
}

.auth-login-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 5vw, 3rem);
    align-items: center;
}

@media (min-width: 900px) {
    .auth-login-layout {
        grid-template-columns: minmax(0, 1.08fr) minmax(280px, 400px);
        gap: clamp(2rem, 5vw, 4rem);
        align-items: stretch;
    }
}

/* Mobile / celular: apenas o formulário (texto institucional só em telas ≥900px) */
@media (max-width: 899px) {
    .auth-login-brand {
        display: none;
    }

    .auth-login-layout {
        max-width: min(100%, 400px);
        margin-inline: auto;
        gap: 0;
    }

    .auth-login-page__grid {
        opacity: 0.1;
        mask-image: radial-gradient(ellipse 95% 75% at 50% 35%, #000 15%, transparent 70%);
    }

    .auth-login-panel {
        border-radius: 22px;
        border-color: rgba(148, 163, 184, 0.2);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06) inset,
            0 32px 64px -20px rgba(0, 0, 0, 0.65),
            0 0 0 1px rgba(99, 102, 241, 0.12);
    }

    .auth-login-panel__head {
        margin-bottom: 1.15rem;
        text-align: center;
    }

    .auth-login-panel__eyebrow {
        letter-spacing: 0.28em;
    }

    .auth-login-panel__title {
        font-size: 1.42rem;
    }
}

.auth-login-brand {
    padding: clamp(0.25rem, 2vw, 0.5rem) 0;
}

.auth-login-brand__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.35rem 0.85rem 0.35rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.92);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(8px);
}

.auth-login-brand__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
    animation: auth-nexus-pulse 2.4s ease-in-out infinite;
}

@keyframes auth-nexus-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.75;
        transform: scale(0.92);
    }
}

.auth-login-brand__title {
    margin: 0 0 1rem;
    font-size: clamp(1.45rem, 4.2vw, 2.125rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.2;
    color: #f8fafc;
}

.auth-login-brand__lead {
    margin: 0 0 1.5rem;
    max-width: 44ch;
    font-size: clamp(0.9375rem, 2.4vw, 1.0625rem);
    line-height: 1.58;
    color: rgba(203, 213, 225, 0.88);
}

.auth-login-brand__viz {
    display: flex;
    align-items: flex-end;
    gap: clamp(0.35rem, 2vw, 0.55rem);
    height: clamp(52px, 14vw, 72px);
    margin-bottom: 1.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.auth-login-brand__bar {
    flex: 1;
    min-width: 4px;
    max-width: 14px;
    height: var(--h, 50%);
    border-radius: 4px 4px 1px 1px;
    background: linear-gradient(180deg, rgba(129, 140, 248, 0.95) 0%, rgba(34, 211, 238, 0.35) 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.22);
    transform-origin: bottom center;
    animation: auth-nexus-bar 3.2s ease-in-out infinite alternate;
}

.auth-login-brand__bar:nth-child(2) {
    animation-delay: -0.4s;
}
.auth-login-brand__bar:nth-child(3) {
    animation-delay: -0.8s;
}
.auth-login-brand__bar:nth-child(4) {
    animation-delay: -1.2s;
}
.auth-login-brand__bar:nth-child(5) {
    animation-delay: -1.6s;
}
.auth-login-brand__bar:nth-child(6) {
    animation-delay: -2s;
}

@keyframes auth-nexus-bar {
    0% {
        transform: scaleY(0.88);
        opacity: 0.85;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.auth-login-brand__tags {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-login-brand__tags li {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.85);
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .auth-login-brand__dot,
    .auth-login-brand__bar {
        animation: none;
    }
}

.auth-login-panel {
    width: 100%;
    padding: clamp(1.5rem, 4.5vw, 2.25rem);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 28px 56px -16px rgba(0, 0, 0, 0.55),
        0 12px 32px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.auth-login-panel__head {
    margin-bottom: 1.35rem;
}

.auth-login-panel__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(165, 180, 252, 0.95);
}

.auth-login-panel__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.35rem, 3.8vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.auth-login-panel__subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: rgba(148, 163, 184, 0.95);
}

.auth-login-panel__alert {
    margin-bottom: 1.1rem;
}

.auth-login-panel .alert--error {
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.auth-login-form {
    gap: 0;
}

.auth-login-form__fields {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.field--nexus {
    margin: 0;
}

.field__label--nexus {
    margin-bottom: 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.82);
}

.auth-login-panel .field__wrap {
    position: relative;
}

.field__icon--nexus {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: rgba(148, 163, 184, 0.85);
    pointer-events: none;
    z-index: 1;
    transition: color 0.15s ease;
}

.field__icon--nexus svg {
    display: block;
}

.field--nexus:focus-within .field__icon--nexus {
    color: #a5b4fc;
}

.auth-login-panel .field__input--nexus.field__input {
    width: 100%;
    padding: 0.92rem 1rem 0.92rem 2.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(2, 6, 23, 0.55);
    color: #f8fafc;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-login-panel .field__input--nexus.field__input::placeholder {
    color: rgba(148, 163, 184, 0.45);
}

.auth-login-panel .field__input--nexus.field__input:focus {
    outline: none;
    border-color: rgba(129, 140, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.btn--auth-submit.btn--nexus-submit {
    margin-top: 1.45rem;
    padding: 0.95rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    color: #fff;
    background: linear-gradient(175deg, #818cf8 0%, #4f46e5 48%, #4338ca 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 10px 28px rgba(79, 70, 229, 0.38);
    transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn--auth-submit.btn--nexus-submit:hover {
    filter: brightness(1.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 14px 36px rgba(79, 70, 229, 0.42);
    text-decoration: none;
    color: #fff;
}

.btn--auth-submit.btn--nexus-submit:active {
    transform: translateY(1px);
}

.auth-login-form__note {
    margin: 1.15rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(148, 163, 184, 0.85);
}

.auth-login-form__note-icon {
    display: flex;
    color: rgba(45, 212, 191, 0.75);
}

.auth-login-form__note-icon svg {
    display: block;
}

/* Login splash — 3D-style brand reveal (~3s, CSS only) */

.auth-splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse 90% 70% at 50% 20%, #1e1b4b 0%, #0f172a 45%, #020617 100%);
    animation: auth-splash-vanish 2.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: auto;
}

@keyframes auth-splash-vanish {
    0% {
        opacity: 1;
        visibility: visible;
    }
    78% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.auth-splash__noise {
    position: absolute;
    inset: -40%;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: auth-splash-drift 20s linear infinite;
}

@keyframes auth-splash-drift {
    to {
        transform: translate(2%, 2%);
    }
}

.auth-splash__glow {
    position: absolute;
    width: min(120vw, 900px);
    height: min(120vw, 900px);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: auth-splash-pulse 3s ease-in-out infinite;
}

.auth-splash__glow--a {
    top: -25%;
    left: -20%;
    background: conic-gradient(from 120deg, #6366f1, #22d3ee, #818cf8, #6366f1);
}

.auth-splash__glow--b {
    bottom: -30%;
    right: -25%;
    background: conic-gradient(from 220deg, #4f46e5, #0ea5e9, #a78bfa, #4f46e5);
    animation-delay: -1.5s;
}

@keyframes auth-splash-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.45;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.65;
    }
}

.auth-splash__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    perspective: 1100px;
    perspective-origin: 50% 40%;
}

.auth-splash__ring {
    position: absolute;
    width: min(72vw, 340px);
    height: min(72vw, 340px);
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(129, 140, 248, 0.15) 60deg, rgba(34, 211, 238, 0.35) 120deg, rgba(99, 102, 241, 0.2) 200deg, transparent 280deg);
    mask: radial-gradient(circle, transparent 58%, #000 59%, #000 71%, transparent 72%);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 71%, transparent 72%);
    animation: auth-splash-spin 4.5s linear infinite;
    filter: drop-shadow(0 0 24px rgba(99, 102, 241, 0.35));
}

@keyframes auth-splash-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-splash__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    transform-style: preserve-3d;
    animation: auth-splash-tilt 2.6s ease-in-out infinite alternate;
}

@keyframes auth-splash-tilt {
    0% {
        transform: rotateX(18deg) rotateY(-14deg) translateZ(0);
    }
    100% {
        transform: rotateX(8deg) rotateY(10deg) translateZ(0);
    }
}

.auth-splash__word {
    display: block;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.auth-splash__word--nexus {
    font-size: clamp(2.75rem, 11vw, 4.75rem);
    letter-spacing: 0.42em;
    padding-left: 0.42em;
    background: linear-gradient(185deg, #f8fafc 0%, #c7d2fe 35%, #6366f1 72%, #312e81 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 40px rgba(99, 102, 241, 0.45));
    text-shadow:
        0 0.04em 0 rgba(49, 46, 129, 0.85),
        0 0.08em 0 rgba(67, 56, 202, 0.65),
        0 0.12em 0 rgba(79, 70, 229, 0.45),
        0 0.16em 0 rgba(99, 102, 241, 0.25),
        0 0.22em 0.12em rgba(0, 0, 0, 0.4);
    transform: translateZ(56px);
}

.auth-splash__word--sds {
    font-size: clamp(1.35rem, 5.5vw, 2.1rem);
    letter-spacing: 0.72em;
    padding-left: 0.72em;
    margin-top: 0.35rem;
    color: rgba(226, 232, 240, 0.92);
    text-transform: uppercase;
    transform: translateZ(28px);
    text-shadow:
        0 0 1px rgba(255, 255, 255, 0.5),
        0 2px 0 rgba(15, 23, 42, 0.9),
        0 3px 0 rgba(30, 27, 75, 0.8),
        0 4px 0 rgba(49, 46, 129, 0.6),
        0 6px 16px rgba(0, 0, 0, 0.5),
        0 0 28px rgba(34, 211, 238, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .auth-splash {
        animation-duration: 0.6s;
    }
    .auth-splash__noise,
    .auth-splash__glow,
    .auth-splash__ring,
    .auth-splash__stage {
        animation: none !important;
    }
    .auth-splash__stage {
        transform: rotateX(12deg) rotateY(-8deg);
    }
}

.alert {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert--error {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

[data-theme="dark"] .alert--error {
    border-color: rgba(248, 113, 113, 0.35);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field__label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.field__input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.btn--block {
    width: 100%;
    padding: 0.8rem 1rem;
}

.btn--outline {
    border-color: var(--border);
    background: transparent;
    color: var(--text);
}
.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
.btn--ghost:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.theme-toggle__icon--moon {
    display: none;
}
[data-theme="dark"] .theme-toggle__icon--sun {
    display: none;
}
[data-theme="dark"] .theme-toggle__icon--moon {
    display: inline;
}

.shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-head__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    letter-spacing: -0.03em;
}

.page-head__desc {
    margin: 0;
    color: var(--text-muted);
    max-width: 52ch;
}

.page-head--simple .page-head__title {
    font-size: 1.65rem;
}

.profile-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}

.profile-panel--compact {
    padding: 1rem 1.15rem;
}

.profile-panel__title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem 1.25rem;
}

.profile-grid--dense {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
}

.profile-item__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.profile-item__value {
    font-weight: 600;
    word-break: break-word;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--accent {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge--teal {
    background: var(--teal-soft);
    color: var(--teal);
}

.badge--muted {
    background: var(--border);
    color: var(--text-muted);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.metrics--sales {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.metric-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.metric-card--highlight {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent-soft), transparent);
}

.metric-card--wide {
    grid-column: span 2;
}

@media (max-width: 720px) {
    .metric-card--wide {
        grid-column: span 1;
    }
}

.metric-card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.metric-card__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.metric-card__value--lg {
    font-size: 1.75rem;
}

.metric-card__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--teal));
    border-radius: inherit;
    transition: width 0.35s ease;
}

.panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow);
}

.panel--accent {
    border-color: var(--teal);
    background: linear-gradient(145deg, var(--teal-soft), var(--bg-elevated) 55%);
}

.panel--soft {
    background: var(--bg-elevated);
}

.panel__title {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.timeline__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.45rem;
    vertical-align: middle;
}

.checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.92rem;
}

.checklist__item {
    padding-left: 1.2rem;
    position: relative;
    color: var(--text-muted);
}

.checklist__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--border);
}

.checklist__item--ok::before {
    background: var(--teal);
}

.checklist__item--warn::before {
    background: #f59e0b;
}

.funnel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.funnel__step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.funnel__step em {
    font-style: normal;
    font-weight: 700;
    color: var(--accent);
}

.steps {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.simple-layout {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .simple-layout {
        grid-template-columns: 1.1fr 0.9fr;
        grid-template-rows: auto auto;
    }
    .welcome-card {
        grid-row: span 2;
    }
}

.welcome-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow);
}

.welcome-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.welcome-card__sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.55rem;
}

.info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-list span {
    color: var(--text-muted);
}

.mini-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mini-widget {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.mini-widget--note {
    border-style: dashed;
}

.mini-widget__label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.mini-widget__value {
    font-size: 1.5rem;
    font-weight: 700;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip {
    display: inline-flex;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .app-header__inner {
        flex-direction: column;
        align-items: stretch;
    }
    .app-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .app-header__actions {
        justify-content: space-between;
    }
}

.alert--success {
    background: var(--teal-soft);
    color: var(--teal);
    border: 1px solid rgba(13, 148, 136, 0.35);
    margin-bottom: 1rem;
}

[data-theme="dark"] .alert--success {
    border-color: rgba(45, 212, 191, 0.35);
}

.page-head--crud {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.crud-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.crud-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.crud-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.crud-empty {
    margin: 0;
    padding: 2rem 1.25rem;
    color: var(--text-muted);
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    background: var(--bg);
}

.data-table tbody tr:hover {
    background: var(--accent-soft);
}

.data-table__actions {
    white-space: nowrap;
    width: 1%;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.cell-user__photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.cell-user__placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.cell-user__name {
    font-weight: 600;
}

.mono {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.inline-form {
    display: inline;
}

.hint-inline {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn--sm {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
}

.btn--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn--danger:hover {
    background: var(--danger);
    color: #fff;
    text-decoration: none;
    border-color: var(--danger);
}

[data-theme="dark"] .btn--danger {
    border-color: rgba(248, 113, 113, 0.4);
}

.tabs {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.tabs__btn {
    border: none;
    background: transparent;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tabs__btn:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.tabs__btn--active {
    background: var(--accent-soft);
    color: var(--accent);
}

.tabs__panels {
    padding: 1.25rem 1.35rem 1.5rem;
}

.tab-panel[hidden] {
    display: none !important;
}

.tab-panel--active {
    display: block;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--2 {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.form-grid__full {
    grid-column: 1 / -1;
}

.field__hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.req {
    color: var(--danger);
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.88rem;
    cursor: pointer;
}

.radio-pill input {
    margin: 0;
}

.preview-box {
    margin-top: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    padding: 0.5rem;
    display: inline-block;
    max-width: 100%;
}

.preview-box__img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    display: block;
}

.doc-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.doc-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.88rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.shell--form .form-actions {
    margin-top: 0;
    padding: 1.25rem 0 0;
    border: none;
}

.shell--form {
    gap: 1.25rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.88em;
}

.badge--warn {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

[data-theme="dark"] .badge--warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge--danger-soft {
    background: var(--danger-soft);
    color: var(--danger);
    margin-left: 0.35rem;
    font-size: 0.7rem;
    vertical-align: middle;
}

.data-table__row--warn {
    background: rgba(245, 158, 11, 0.08);
}

[data-theme="dark"] .data-table__row--warn {
    background: rgba(245, 158, 11, 0.12);
}

.finance-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.finance-subnav__link {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.finance-subnav__link:hover {
    color: var(--text);
    background: var(--accent-soft);
    text-decoration: none;
}

.finance-subnav__link--active {
    background: var(--accent-soft);
    color: var(--accent);
}

.finance-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.finance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.finance-cards__item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.finance-cards__item--expense {
    border-left: 4px solid var(--danger);
}

.finance-cards__item--income {
    border-left: 4px solid var(--teal);
}

.finance-cards__item--neutral {
    border-left: 4px solid var(--accent);
}

.finance-cards__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.finance-cards__value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.finance-cards__sub,
.finance-cards__hint {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.finance-legend__list {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.finance-swatch {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--swatch, var(--border));
    border: 1px solid var(--border);
    vertical-align: middle;
}

.finance-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--tag) 22%, transparent);
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--tag) 45%, var(--border));
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem 1rem;
    align-items: end;
}

.finance-filters__actions .btn {
    width: 100%;
}

.finance-filters {
    margin-bottom: 0.25rem;
}

.finance-form-max {
    max-width: 920px;
}

.color-field {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.color-field__pick {
    width: 48px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg);
}

.color-field__hex {
    flex: 1;
    max-width: 140px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    cursor: pointer;
}

.finance-due-alerts {
    background: var(--bg-elevated);
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.15rem;
    overflow: hidden;
}

[data-theme="dark"] .finance-due-alerts {
    border-color: rgba(248, 113, 113, 0.4);
}

.finance-due-alerts__head {
    padding: 0.85rem 1.1rem;
    background: var(--danger-soft);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.finance-due-alerts__hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.finance-due-alerts__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.finance-due-alerts__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-top: 1px solid var(--border);
    border-left: 4px solid var(--alert-accent, var(--danger));
}

.finance-due-alerts__main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.finance-due-alerts__kind {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.finance-due-alerts__title {
    font-weight: 700;
    font-size: 0.95rem;
}

.finance-due-alerts__meta {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.finance-due-alerts__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.finance-due-alerts__dismiss {
    margin: 0;
}

.switch-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.switch-pill__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-pill__track {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.switch-pill__knob {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-elevated);
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch-pill__input:focus-visible + .switch-pill__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.switch-pill__input:checked + .switch-pill__track {
    background: var(--teal);
}

.switch-pill__input:checked + .switch-pill__track .switch-pill__knob {
    transform: translateX(16px);
}

.admin-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.admin-shortcuts__card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-shortcuts__card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 28px var(--accent-soft);
    text-decoration: none;
    color: inherit;
}

.admin-shortcuts__title {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.admin-shortcuts__meta {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* —— Instalações / programador / modais administrativos —— */
.queue-busy-note {
    display: block;
    margin-top: 0.5rem;
    color: var(--danger);
    font-weight: 500;
}

.install-os-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
}

.install-os-stats strong:first-of-type {
    width: 100%;
    flex-basis: 100%;
    font-size: 0.95rem;
}

.programmer-assets-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}

.programmer-asset-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.programmer-asset-row__link-img {
    display: block;
    width: 100%;
    max-width: min(100%, 480px);
    margin: 0 auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}

.programmer-asset-row__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(50vh, 320px);
    object-fit: contain;
    vertical-align: middle;
}

.programmer-asset-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.programmer-asset-row__label {
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-thread-item {
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.admin-thread-item__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}

.admin-thread-item__when {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.admin-thread-item__body {
    font-size: 0.92rem;
    line-height: 1.45;
}

.admin-thread-item__file {
    margin-top: 0.65rem;
}

.data-table__programmer-cell {
    vertical-align: middle;
    min-width: 140px;
}

.programmer-chip--action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    cursor: pointer;
    font: inherit;
    color: inherit;
    max-width: 220px;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.programmer-chip--action:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px var(--accent-soft);
}

.programmer-chip__img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.programmer-chip__fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.programmer-chip__name {
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-sheet {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.modal-sheet--alert {
    max-width: 400px;
}

.modal-sheet__title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.modal-sheet__sub {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
    white-space: pre-wrap;
}

.modal-sheet__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.install-fieldset[disabled] {
    opacity: 0.65;
    pointer-events: none;
}

/* Kanban instalações */
.page-kanban .shell--kanban {
    max-width: 1400px;
}

.page-head--kanban .page-head__desc {
    max-width: 52rem;
}

.kanban-you-busy {
    display: block;
    margin-top: 0.65rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    border: 1px solid var(--border);
    font-weight: 500;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-col {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 200px;
}

.kanban-col__head {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.kanban-col__title {
    margin: 0;
    display: inline;
    font-size: 0.92rem;
    font-weight: 700;
}

.kanban-col__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    margin-left: 0.3rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.kanban-col__hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.kanban-col__cards {
    padding: 0.65rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: min(68vh, 720px);
    overflow-y: auto;
}

.kanban-col__empty {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

.kanban-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    cursor: grab;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card--mine {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px var(--teal-soft);
}

.kanban-card--dragging {
    opacity: 0.6;
}

.kanban-card__title {
    margin: 0 0 0.2rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.kanban-card__site {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-word;
}

.kanban-card__meta {
    margin: 0.35rem 0 0;
    font-size: 0.74rem;
    color: var(--teal);
}

.kanban-card__hint-sm {
    margin: 0.3rem 0 0;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.kanban-card__actions {
    margin-top: 0.55rem;
}

.kanban-card__actions--row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.offer-wait {
    margin-top: 0.45rem;
}

.offer-wait__label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.offer-wait__bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    margin-top: 0.25rem;
    overflow: hidden;
}

.offer-wait__fill {
    display: block;
    height: 100%;
    width: var(--p, 100%);
    background: linear-gradient(90deg, var(--teal), var(--accent));
    border-radius: 999px;
    transition: width 1s linear;
}

.offer-wait__time {
    font-size: 0.78rem;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.kanban-flash {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--text);
}

.kanban-flash--err {
    background: var(--danger-soft);
}

.kanban-foot-empty {
    text-align: center;
    color: var(--text-muted);
    margin: 1rem 0 0;
}

.kanban-foot-hint {
    margin: 1rem 0 0;
}

/* Controle — lista (link domínio) */
.controle-domain-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.controle-domain-link:hover {
    text-decoration: underline;
}

/* Dashboard detalhe sistema-filho */
.page-controle-detalhe .filho-dash {
    max-width: 1280px;
}

.filho-dash__crumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
}
.filho-dash__crumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.filho-dash__crumb a:hover {
    text-decoration: underline;
}
.filho-dash__crumb-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.45;
}
.filho-dash__crumb-current {
    font-weight: 600;
    color: var(--text);
}

.filho-dash__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.75rem;
}

.filho-dash__head-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.filho-dash__title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.filho-dash__subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 36rem;
    line-height: 1.45;
}

.filho-dash__sync {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg));
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    box-shadow: var(--shadow);
}
.filho-dash__sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-soft);
    animation: filho-pulse 2.2s ease-in-out infinite;
}
@keyframes filho-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}
.filho-dash__sync-label {
    font-variant-numeric: tabular-nums;
}

.filho-dash__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.filho-kpi {
    position: relative;
    border-radius: 14px;
    padding: 1rem 1.05rem 0.95rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.filho-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
    opacity: 0.9;
}
.filho-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
[data-theme='dark'] .filho-kpi:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.filho-kpi--teal::before {
    background: linear-gradient(180deg, var(--teal), #0d9488);
}
.filho-kpi--amber::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}
.filho-kpi--indigo::before {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}
.filho-kpi--slate::before {
    background: linear-gradient(180deg, #64748b, #475569);
}
.filho-kpi--rose::before {
    background: linear-gradient(180deg, #f43f5e, #e11d48);
}

.filho-kpi__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.filho-kpi__value {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.filho-kpi__sub {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.filho-dash__mix {
    margin-bottom: 1.75rem;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--bg-elevated) 0%, var(--bg) 100%);
    box-shadow: var(--shadow);
}

.filho-dash__mix-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.65rem;
}
.filho-dash__mix-pct {
    font-weight: 700;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
}

.filho-dash__mix-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border);
}
.filho-dash__mix-seg {
    display: block;
    height: 100%;
    min-width: 0;
    transition: width 0.45s ease;
}
.filho-dash__mix-seg--pago {
    background: linear-gradient(90deg, #14b8a6, #0d9488);
}
.filho-dash__mix-seg--pend {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.filho-dash__mix-seg--exp {
    background: linear-gradient(90deg, #94a3b8, #64748b);
}

.filho-dash__mix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.filho-dash__mix-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.filho-dash__lg {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}
.filho-dash__lg--pago {
    background: #0d9488;
}
.filho-dash__lg--pend {
    background: #f59e0b;
}
.filho-dash__lg--exp {
    background: #64748b;
}

/* Tabs (radio + CSS) */
.filho-tabs {
    margin-top: 0.25rem;
}

.filho-tabs__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    margin-bottom: 1.15rem;
    box-shadow: var(--shadow);
}

.filho-tabs__sso-btn {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.22);
}

.filho-tabs__inline-access {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    background: linear-gradient(135deg, var(--accent-soft), transparent 55%);
    box-shadow: var(--shadow);
}

.filho-tabs__inline-access-text {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 36rem;
}

.filho-tabs__inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filho-tabs__cfg-btn {
    white-space: nowrap;
}

.filho-tabs__tab {
    cursor: pointer;
    padding: 0.5rem 0.85rem;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}
.filho-tabs__tab:hover {
    color: var(--text);
    background: var(--bg);
}

#filho-tab-visao:checked ~ .filho-tabs__bar label[for='filho-tab-visao'],
#filho-tab-pedidos:checked ~ .filho-tabs__bar label[for='filho-tab-pedidos'],
#filho-tab-operacao:checked ~ .filho-tabs__bar label[for='filho-tab-operacao'],
#filho-tab-aquisicao:checked ~ .filho-tabs__bar label[for='filho-tab-aquisicao'],
#filho-tab-parceiros:checked ~ .filho-tabs__bar label[for='filho-tab-parceiros'],
#filho-tab-infra:checked ~ .filho-tabs__bar label[for='filho-tab-infra'] {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.25);
}

.filho-tabs__panel {
    display: none;
    animation: filho-tab-in 0.28s ease;
}
@keyframes filho-tab-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#filho-tab-visao:checked ~ .filho-tabs__panels .filho-tabs__panel--visao,
#filho-tab-pedidos:checked ~ .filho-tabs__panels .filho-tabs__panel--pedidos,
#filho-tab-operacao:checked ~ .filho-tabs__panels .filho-tabs__panel--operacao,
#filho-tab-aquisicao:checked ~ .filho-tabs__panels .filho-tabs__panel--aquisicao,
#filho-tab-parceiros:checked ~ .filho-tabs__panels .filho-tabs__panel--parceiros,
#filho-tab-infra:checked ~ .filho-tabs__panels .filho-tabs__panel--infra {
    display: block;
}

.filho-tabs__lead {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 48rem;
}

.filho-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.filho-mini-card {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filho-mini-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.filho-mini-card__title {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
}
.filho-mini-card__metric {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.filho-mini-card__key {
    margin: 0.35rem 0 0;
    font-size: 0.68rem;
    font-family: ui-monospace, monospace;
    color: var(--text-muted);
    opacity: 0.85;
}

.filho-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filho-card {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--shadow);
}
.filho-card--lift {
    transition: transform 0.15s ease;
}
.filho-card--lift:hover {
    transform: translateY(-1px);
}
.filho-card--flush {
    padding-bottom: 0.25rem;
}

.filho-card__title {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.filho-card__body {
    font-size: 0.84rem;
    line-height: 1.5;
}

.filho-stat-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.filho-stat {
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border);
}
.filho-stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filho-stat__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.filho-stat__val {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.filho-stat__meta {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.filho-gw {
    margin-bottom: 1rem;
}
.filho-gw:last-child {
    margin-bottom: 0;
}
.filho-gw__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.filho-gw__name {
    font-weight: 700;
    font-size: 0.86rem;
}
.filho-gw__money {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: 0.88rem;
    color: var(--accent);
}
.filho-gw__track {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.filho-gw__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    transition: width 0.5s ease;
}
.filho-gw__meta {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.filho-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filho-muted {
    color: var(--text-muted);
    font-style: italic;
}

.filho-tree {
    margin: 0.25rem 0 0.25rem 1.1rem;
    padding: 0;
}

.filho-nested {
    font-size: 0.82rem;
}
.filho-nested__k {
    width: 36%;
    vertical-align: top;
    font-weight: 600;
    color: var(--text-muted);
}

.table-wrap--tight {
    margin: 0;
}

.filho-table-soft thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.filho-tname {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
}

.filho-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Modal remoto de configurações (estilo janela) */
.has-modal-open {
    overflow: hidden;
}

.filho-modal[hidden] {
    display: none !important;
}

.filho-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.filho-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(3px);
}

.filho-modal__window {
    position: relative;
    width: min(1100px, 100%);
    max-height: min(92vh, 900px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
}

.filho-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg), var(--bg-elevated));
}

.filho-modal__traffic {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.filho-modal__traffic .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.filho-modal__traffic .dot--red { background: #ff5f57; }
.filho-modal__traffic .dot--yellow { background: #febc2e; }
.filho-modal__traffic .dot--green { background: #28c840; }

.filho-modal__title-wrap {
    flex: 1;
    min-width: 0;
}

.filho-modal__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.filho-modal__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.filho-modal__close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
}

.filho-modal__close:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.filho-modal__body {
    padding: 1rem;
    overflow: auto;
    flex: 1;
}

.filho-cfg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.filho-cfg-tabs__btn {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.filho-cfg-tabs__btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

.filho-cfg-panel {
    display: none;
}

.filho-cfg-panel.is-active {
    display: block;
}

.filho-cfg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.7rem;
}

.filho-cfg-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filho-cfg-field > span {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 700;
}

.filho-cfg-field input,
.filho-cfg-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    font: inherit;
    font-size: 0.82rem;
}

.filho-cfg-field textarea {
    resize: vertical;
}

.filho-cfg-hint {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.filho-cfg-field__k {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 700;
    font-family: ui-monospace, monospace;
}

.filho-cfg-field__label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 700;
}

.filho-cfg-field--locked input:disabled,
.filho-cfg-field--locked textarea:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: color-mix(in srgb, var(--bg) 88%, var(--border));
}

.filho-cfg-field--switch {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 92%, var(--accent-soft));
}

.filho-cfg-field--switch .filho-cfg-field__label {
    flex: 1;
    line-height: 1.35;
}

.filho-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.filho-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.filho-switch__track {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 70%, var(--text-muted));
    transition: background 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.filho-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.filho-switch__input:checked + .filho-switch__track {
    background: color-mix(in srgb, var(--accent) 75%, var(--teal, #0d9488));
}

.filho-switch__input:checked + .filho-switch__track::after {
    transform: translateX(18px);
}

.filho-switch__input:focus-visible + .filho-switch__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.filho-cfg-split {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}

.filho-cfg-split__title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.filho-cfg-split__desc {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.filho-modal__footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filho-modal__status {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filho-modal__status.is-ok { color: var(--teal); }
.filho-modal__status.is-err { color: var(--danger); }

.filho-modal__actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .filho-tabs__bar {
        flex-direction: column;
    }
    .filho-tabs__tab {
        width: 100%;
        text-align: center;
    }
    .filho-tabs__inline-access {
        flex-direction: column;
        align-items: stretch;
    }
    .filho-tabs__inline-access .filho-tabs__sso-btn {
        width: 100%;
        text-align: center;
    }
    .filho-tabs__inline-actions {
        width: 100%;
    }
    .filho-modal__window {
        max-height: 95vh;
    }
    .filho-cfg-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Controle financeiro (admin-controle) ───────────────────────────────── */
.page-controle-fin .shell.controle-fin {
    max-width: 1200px;
}

.controle-fin__head {
    margin-bottom: 1.25rem;
}

.controle-fin__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.controle-fin__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.controle-fin__live {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--border);
    color: var(--text-muted);
}

.controle-fin__live--ok {
    background: rgba(13, 148, 136, 0.15);
    color: var(--teal, #0d9488);
}

.controle-fin__live--err {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.controle-fin__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.controle-fin__kpi {
    border-radius: 12px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.controle-fin__kpi--teal { border-left: 4px solid #0d9488; }
.controle-fin__kpi--indigo { border-left: 4px solid #4f46e5; }
.controle-fin__kpi--amber { border-left: 4px solid #d97706; }
.controle-fin__kpi--slate { border-left: 4px solid #64748b; }

.controle-fin__kpi-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.controle-fin__kpi-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.controle-fin__cards2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.controle-fin__card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--bg);
}

.controle-fin__card-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.controle-fin__card-sub {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.controle-fin__mini-rank {
    list-style: none;
    margin: 0;
    padding: 0;
}

.controle-fin__mini-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.controle-fin__mini-item:last-child {
    border-bottom: 0;
}

.controle-fin__mini-rank-num {
    font-weight: 700;
    color: var(--text-muted);
    width: 1.25rem;
}

.controle-fin__mini-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.controle-fin__mini-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

a.controle-fin__mini-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

a.controle-fin__mini-link:hover {
    text-decoration: underline;
}

.controle-fin__charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.controle-fin__chartbox--wide {
    grid-column: 1 / -1;
}

.controle-fin__chart-title {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.controle-fin__chart-hint {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.controle-fin__canvas-wrap {
    position: relative;
    height: 220px;
}

.controle-fin__canvas-wrap--tall {
    height: 260px;
}

.controle-fin__table-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--bg);
}

.controle-fin__table-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.controle-fin__table-meta {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.controle-fin__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.controle-fin__page-btn {
    font-size: 0.78rem;
}

.controle-fin__page-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.controle-fin__loading,
.controle-fin__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem !important;
}

@media (max-width: 900px) {
    .controle-fin__charts {
        grid-template-columns: 1fr;
    }
    .controle-fin__chartbox--wide {
        grid-column: auto;
    }
}
