/* =====================================================
   ANDRÉ AMARAL — DESIGN SYSTEM
   Paleta inspirada no logotipo Tera (azul → laranja → coral)
   ===================================================== */

:root {
    /* ===== Brand colors ===== */
    --brand-blue-900: #0B1638;
    --brand-blue-800: #0F1F4A;
    --brand-blue-700: #142B66;
    --brand-blue-600: #1E4FB8;
    --brand-blue-500: #2469E0;
    --brand-blue-400: #4F8AF0;
    --brand-blue-300: #8EB2F7;
    --brand-blue-200: #C7D8FB;
    --brand-blue-100: #E7EFFD;
    --brand-blue-050: #F4F7FE;

    --brand-orange-700: #C2410C;
    --brand-orange-600: #EA580C;
    --brand-orange-500: #F97316;
    --brand-orange-400: #FB923C;
    --brand-orange-300: #FDBA74;
    --brand-orange-200: #FED7AA;
    --brand-orange-100: #FFF1E0;

    --brand-coral-600: #E11D48;
    --brand-coral-500: #EF4444;
    --brand-coral-400: #F87171;

    /* ===== Surface (claros) ===== */
    --surface-0: #FFFFFF;
    --surface-1: #F7F9FC;
    --surface-2: #EEF2F9;
    --surface-3: #E1E7F2;
    --surface-line: #DCE3EE;

    /* ===== Text ===== */
    --text-strong: #0B1638;
    --text-body:   #1F2942;
    --text-muted:  #6B7593;
    --text-soft:   #94A0BD;
    --text-on-brand: #FFFFFF;

    /* ===== Status ===== */
    --c-success: #16A34A;
    --c-success-bg: #DCFCE7;
    --c-success-fg: #14532D;

    --c-warning: #D97706;
    --c-warning-bg: #FEF3C7;
    --c-warning-fg: #78350F;

    --c-info: #0284C7;
    --c-info-bg: #E0F2FE;
    --c-info-fg: #075985;

    --c-danger: #DC2626;
    --c-danger-bg: #FEE2E2;
    --c-danger-fg: #7F1D1D;

    --c-muted-bg: #E5E9F2;
    --c-muted-fg: #475569;

    /* ===== Gradients (premium, mono-blue com acentos sutis) ===== */
    --grad-brand:       linear-gradient(135deg, #0F1F4A 0%, #1E4FB8 55%, #2469E0 100%);
    --grad-brand-soft:  linear-gradient(135deg, #EEF3FE 0%, #DCE7FA 60%, #C9D8F4 100%);
    --grad-blue:        linear-gradient(135deg, #0F1F4A 0%, #142B66 35%, #1E4FB8 100%);
    --grad-blue-deep:   linear-gradient(160deg, #0B1638 0%, #142B66 60%, #1E4FB8 100%);
    --grad-blue-soft:   linear-gradient(135deg, #1E4FB8 0%, #2469E0 60%, #4F8AF0 100%);
    --grad-orange:      linear-gradient(135deg, #C2410C 0%, #EA580C 50%, #F97316 100%);
    --grad-blue-orange: linear-gradient(135deg, #0F1F4A 0%, #1E4FB8 60%, #2469E0 100%);
    --grad-night:       linear-gradient(160deg, #0B1638 0%, #142B66 60%, #1E4FB8 100%);
    --grad-accent:      linear-gradient(135deg, #142B66 0%, #2469E0 60%, #4F8AF0 100%);

    /* ===== Shadows ===== */
    --shadow-xs: 0 1px 2px rgba(15, 31, 74, .06);
    --shadow-sm: 0 4px 12px rgba(15, 31, 74, .07);
    --shadow-md: 0 10px 28px rgba(15, 31, 74, .08);
    --shadow-lg: 0 24px 60px rgba(15, 31, 74, .12);
    --shadow-brand: 0 14px 30px rgba(36, 105, 224, .25);
    --shadow-orange: 0 14px 30px rgba(249, 115, 22, .25);

    /* ===== Radius ===== */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* ===== Spacing ===== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 56px;
    --space-10: 72px;

    /* ===== Typography ===== */
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --fs-3xl: 28px;
    --fs-4xl: 36px;
    --fs-5xl: 48px;

    --lh-tight: 1.15;
    --lh-snug: 1.35;
    --lh-normal: 1.5;
    --lh-loose: 1.7;

    /* ===== Misc ===== */
    --header-h: 72px;
    --sidebar-w: 268px;
    --transition: 220ms cubic-bezier(.4, 0, .2, 1);
}

/* =====================================================
   RESET / BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
    color: var(--text-body);
    background: var(--surface-1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

a {
    color: var(--brand-blue-600);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--brand-blue-700); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--text-strong);
    line-height: var(--lh-snug);
    margin: 0 0 var(--space-3);
    letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); font-weight: 700; }
h3 { font-size: var(--fs-xl); font-weight: 700; }
h4 { font-size: var(--fs-lg); font-weight: 600; }

p { margin: 0 0 var(--space-3); }

::selection { background: var(--brand-blue-200); color: var(--text-strong); }

:focus-visible {
    outline: 3px solid var(--brand-blue-300);
    outline-offset: 2px;
    border-radius: 6px;
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.muted { color: var(--text-muted); }
.soft  { color: var(--text-soft); }
.strong { color: var(--text-strong); font-weight: 600; }
.mono  { font-family: var(--font-mono); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-up     { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--fs-xs); font-weight: 600; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); } .mb-6 { margin-bottom: var(--space-6); } .mb-8 { margin-bottom: var(--space-8); }

.hide { display: none !important; }
@media (max-width: 640px) {
    .hide-sm { display: none !important; }
}
@media (max-width: 900px) {
    .hide-md { display: none !important; }
}

/* =====================================================
   GRID HELPERS
   ===================================================== */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =====================================================
   BOTÕES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-sm { padding: 8px 14px; font-size: var(--fs-sm); border-radius: 8px; }
.btn-lg { padding: 16px 28px; font-size: var(--fs-lg); border-radius: 12px; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--brand-blue-600);
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 31, 74, .18);
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(15, 31, 74, .26); color: #fff; background: var(--brand-blue-700); }

/* Botão "gradient" agora é deep-navy → royal blue (premium e discreto) */
.btn-gradient {
    background: var(--grad-blue);
    color: #fff;
    box-shadow: 0 10px 26px rgba(15, 31, 74, .28);
    position: relative;
    overflow: hidden;
}
.btn-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 55%);
    pointer-events: none;
}
.btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(15, 31, 74, .35); color: #fff; }

.btn-secondary {
    background: var(--surface-0);
    color: var(--text-strong);
    border-color: var(--surface-line);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { border-color: var(--brand-blue-300); color: var(--brand-blue-700); }

.btn-ghost {
    background: transparent;
    color: var(--text-body);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-strong); }

.btn-danger {
    background: var(--brand-coral-500);
    color: #fff;
}
.btn-danger:hover { background: var(--brand-coral-600); color:#fff; }

.btn-success {
    background: var(--c-success);
    color: #fff;
}
.btn-success:hover { filter: brightness(1.05); color: #fff; }

.btn-outline {
    background: transparent;
    border-color: var(--brand-blue-500);
    color: var(--brand-blue-600);
}
.btn-outline:hover { background: var(--brand-blue-050); color: var(--brand-blue-700); }

.btn-icon {
    width: 38px;
    padding: 0;
    height: 38px;
    border-radius: 10px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: var(--space-5); }
.form-row { display: grid; gap: var(--space-4); }
.form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
    .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
}

label, .label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 6px;
}

.input, .select, .textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: var(--fs-md);
    color: var(--text-body);
    background: var(--surface-0);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-blue-400);
    box-shadow: 0 0 0 4px rgba(36,105,224,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-muted); }

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

.input-icon {
    position: relative;
}
.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
}
.input-icon .input { padding-left: 40px; }

.help { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 6px; }
.error-text { font-size: var(--fs-xs); color: var(--c-danger); margin-top: 6px; }

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    font-size: var(--fs-sm);
    color: var(--text-body);
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand-blue-500); }

.toggle {
    --w: 44px; --h: 24px;
    position: relative;
    display: inline-block;
    width: var(--w); height: var(--h);
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    transition: background var(--transition);
    cursor: pointer;
}
.toggle::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: var(--shadow-xs);
}
.toggle input { display: none; }
.toggle.is-on { background: var(--brand-blue-500); }
.toggle.is-on::after { transform: translateX(20px); }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--surface-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-line);
    overflow: hidden;
}
.card-pad { padding: var(--space-6); }
.card-pad-sm { padding: var(--space-4); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--surface-line);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: var(--space-6); }
.card-foot {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--surface-line);
    background: var(--surface-1);
}

.card-elev {
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--surface-line);
    padding: var(--space-7);
}

/* Card de métrica (KPI) */
.kpi {
    background: var(--surface-0);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--grad-blue);
}
.kpi-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--brand-blue-050);
    color: var(--brand-blue-600);
    display: grid;
    place-items: center;
    font-size: 20px;
}
.kpi-icon.orange { background: var(--brand-orange-100); color: var(--brand-orange-600); }
.kpi-icon.success { background: var(--c-success-bg); color: var(--c-success-fg); }
.kpi-icon.coral { background: #FFE2E5; color: var(--brand-coral-600); }
.kpi-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.kpi-value {
    font-size: var(--fs-3xl);
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}
.kpi-delta.up { background: var(--c-success-bg); color: var(--c-success-fg); }
.kpi-delta.down { background: var(--c-danger-bg); color: var(--c-danger-fg); }

/* =====================================================
   PILLS / BADGES
   ===================================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    background: var(--c-muted-bg);
    color: var(--c-muted-fg);
    line-height: 1.4;
}
.pill-success { background: var(--c-success-bg); color: var(--c-success-fg); }
.pill-warning { background: var(--c-warning-bg); color: var(--c-warning-fg); }
.pill-info    { background: var(--c-info-bg);    color: var(--c-info-fg); }
.pill-danger  { background: var(--c-danger-bg);  color: var(--c-danger-fg); }
.pill-primary { background: var(--brand-blue-100); color: var(--brand-blue-700); }
.pill-orange  { background: var(--brand-orange-100); color: var(--brand-orange-700); }
.pill-muted   { background: var(--c-muted-bg);    color: var(--c-muted-fg); }

.pill::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}

/* =====================================================
   TABELAS
   ===================================================== */
.table-wrap {
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-md);
    background: var(--surface-0);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}
.table thead th {
    text-align: left;
    padding: 14px 16px;
    background: var(--surface-1);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    border-bottom: 1px solid var(--surface-line);
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-line);
    color: var(--text-body);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-1); }

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .table thead { display: none; }
    .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        background: var(--surface-0);
        border: 1px solid var(--surface-line);
        border-radius: var(--radius-sm);
        margin-bottom: 12px;
        padding: 10px 14px;
    }
    .table tbody td {
        border-bottom: 1px dashed var(--surface-line);
        padding: 10px 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }
    .table tbody td::before {
        content: attr(data-label);
        font-size: var(--fs-xs);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 700;
        color: var(--text-muted);
    }
    .table tbody td:last-child { border-bottom: 0; }
}

/* =====================================================
   BARRA DE PROGRESSO
   ===================================================== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}
.progress-bar {
    height: 100%;
    background: var(--grad-blue-soft);
    border-radius: var(--radius-pill);
    transition: width 600ms cubic-bezier(.2,.7,.3,1);
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}
.progress-lg { height: 12px; }

/* =====================================================
   FLASH / ALERTS
   ===================================================== */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}
.flash {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--brand-blue-500);
    background: var(--brand-blue-050);
    color: var(--brand-blue-700);
    font-size: var(--fs-sm);
    font-weight: 500;
}
.flash i { font-size: 18px; }
.flash-success { background: var(--c-success-bg); color: var(--c-success-fg); border-color: var(--c-success); }
.flash-error   { background: var(--c-danger-bg);  color: var(--c-danger-fg);  border-color: var(--c-danger); }
.flash-warning { background: var(--c-warning-bg); color: var(--c-warning-fg); border-color: var(--c-warning); }
.flash-info    { background: var(--c-info-bg);    color: var(--c-info-fg);    border-color: var(--c-info); }

/* =====================================================
   BRAND
   ===================================================== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-strong);
    text-decoration: none;
}
.brand-mark {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--grad-blue);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 6px 16px rgba(15, 31, 74, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .22) 0%, transparent 55%);
    pointer-events: none;
}
.brand-mark.gradient {
    background: var(--grad-brand);
    box-shadow: 0 8px 20px rgba(15, 31, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}
/* Brand-mark com imagem (logo do gestor / cliente) */
.brand-mark-img {
    background: #fff;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--surface-line);
    box-shadow: 0 4px 14px rgba(15, 31, 74, .12);
}
.brand-mark-img::after { display: none; }
.brand-mark-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Brand-mark large (54px) */
.brand-mark-lg {
    width: 54px !important;
    height: 54px !important;
    border-radius: 14px !important;
    font-size: 22px !important;
}
/* Brand-mark XL (76px) */
.brand-mark-xl {
    width: 76px !important;
    height: 76px !important;
    border-radius: 18px !important;
    font-size: 30px !important;
}
.brand-text strong {
    display: block;
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-strong);
}
.brand-text small {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 2px;
}
.brand-light { color: #fff; }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text small { color: rgba(255,255,255,.78); }

/* =====================================================
   AUTH SCREENS (login/registro)
   ===================================================== */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--surface-1);
}
.auth-art {
    position: relative;
    overflow: hidden;
    background: var(--grad-night);
    color: #fff;
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-art::before, .auth-art::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.auth-art::before {
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(36, 105, 224, .55) 0%, transparent 70%);
    top: -140px; right: -100px;
    opacity: .8;
}
.auth-art::after {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(79, 138, 240, .35) 0%, transparent 70%);
    bottom: -120px; left: -90px;
    opacity: .7;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-headline h2 {
    color: #fff;
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.1;
    letter-spacing: -.02em;
    max-width: 28ch;
    font-weight: 800;
}
.auth-headline p {
    color: rgba(255,255,255,.8);
    font-size: var(--fs-lg);
    max-width: 38ch;
}
.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-6);
}
.auth-feature {
    display: flex; align-items: flex-start; gap: var(--space-3);
    color: rgba(255,255,255,.92);
}
.auth-feature i {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    display: grid; place-items: center;
    color: #FDBA74;
}
.auth-feature strong { display: block; font-weight: 700; }
.auth-feature small { color: rgba(255,255,255,.65); font-size: var(--fs-sm); }

.auth-foot {
    color: rgba(255,255,255,.55);
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    background: var(--surface-1);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--surface-line);
    padding: var(--space-7);
}
.auth-card h1 {
    font-size: var(--fs-3xl);
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -.02em;
}
.auth-card .lead {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}
.auth-card .brand {
    margin-bottom: var(--space-6);
}

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-form-side { padding: var(--space-6) var(--space-4); }
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}
.page-header h1 {
    margin: 0;
}
.page-header p {
    margin: 6px 0 0;
    color: var(--text-muted);
}
.page-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--space-9) var(--space-5);
    background: var(--surface-0);
    border-radius: var(--radius-md);
    border: 1px dashed var(--surface-line);
    color: var(--text-muted);
}
.empty-state .icon {
    width: 64px; height: 64px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: var(--brand-blue-050);
    display: grid; place-items: center;
    color: var(--brand-blue-600);
    font-size: 26px;
}
.empty-state h3 {
    color: var(--text-strong);
    margin-bottom: 6px;
}

/* =====================================================
   TIMELINE / STEPS
   ===================================================== */
.timeline {
    position: relative;
    padding-left: 32px;
}
.timeline::before {
    content: "";
    position: absolute;
    top: 6px; bottom: 6px;
    left: 12px;
    width: 2px;
    background: linear-gradient(to bottom, var(--brand-blue-200) 0%, var(--brand-blue-500) 100%);
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    margin-bottom: var(--space-6);
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    top: 4px; left: -32px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--surface-0);
    border: 3px solid var(--brand-blue-400);
    box-shadow: 0 0 0 4px rgba(36,105,224,.12);
    display: grid; place-items: center;
    color: var(--brand-blue-600);
    font-size: 11px;
}
.timeline-item.is-done .timeline-dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.timeline-item.is-progress .timeline-dot { background: var(--brand-orange-500); border-color: var(--brand-orange-500); color: #fff; }
.timeline-item.is-paused .timeline-dot { background: var(--surface-3); border-color: var(--surface-3); color: var(--text-muted); }

.timeline-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    box-shadow: var(--shadow-xs);
}

/* =====================================================
   ARQUIVO/CHIP
   ===================================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: var(--fs-xs);
    color: var(--text-body);
    font-weight: 500;
}
.chip-strong { background: var(--brand-blue-100); color: var(--brand-blue-700); font-weight: 600; }

/* =====================================================
   CRED BOX (mostra credenciais com copy)
   ===================================================== */
.cred-box {
    background: var(--surface-1);
    border: 1px dashed var(--surface-line);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.cred-box .cred-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.cred-box .cred-value {
    font-family: var(--font-mono);
    color: var(--text-strong);
    font-size: var(--fs-md);
    word-break: break-all;
}

/* =====================================================
   IFRAME / VIEWER de relatório
   ===================================================== */
.report-viewer {
    width: 100%;
    height: calc(100vh - 130px);
    border: 0;
    border-radius: 0;
    background: #fff;
    display: block;
}
.report-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--brand-blue-900);
    color: #fff;
    flex-wrap: wrap;
}
.report-bar h1 {
    font-size: var(--fs-lg);
    color: #fff;
    margin: 0;
}
.report-bar .pill { background: rgba(255,255,255,.1); color: #fff; }
.report-bar a, .report-bar button {
    color: #fff;
    border-color: rgba(255,255,255,.25);
}

/* =====================================================
   404 / 403
   ===================================================== */
.error-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--grad-brand-soft);
    padding: var(--space-6);
}
.error-card {
    background: var(--surface-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-8);
    text-align: center;
    max-width: 460px;
}
.error-card .code {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    background: var(--grad-blue);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -.04em;
}
.error-card h1 {
    font-size: var(--fs-2xl);
    margin: var(--space-3) 0;
}

/* =====================================================
   SCROLLBAR (webkit/blink)
   ===================================================== */
@media (pointer: fine) {
    *::-webkit-scrollbar { width: 10px; height: 10px; }
    *::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; }
    *::-webkit-scrollbar-thumb:hover { background: var(--brand-blue-300); }
    *::-webkit-scrollbar-track { background: var(--surface-1); }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease both; }

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,.5); }
    50% { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}
.dot-live {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand-orange-500);
    animation: pulseDot 1.6s ease-in-out infinite;
    display: inline-block;
}
