/* =============================================================
   VELTHERA TRACE — Design System
   Versão: 1.0
   Temas: dark (padrão) | light
   ============================================================= */

/* ── Fontes ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Inter:wght@300;400;500;600&display=swap');

/* ─────────────────────────────────────────
   TOKENS — TEMA DARK (padrão)
───────────────────────────────────────── */
:root,
[data-theme="dark"] {
    --gold:            #C9A96E;
    --gold-light:      #E2C990;
    --gold-dark:       #A68A50;
    --gold-muted:      rgba(201, 169, 110, 0.18);
    --gold-border:     rgba(201, 169, 110, 0.25);
    --gold-glow:       rgba(201, 169, 110, 0.12);

    --bg-root:         #0F0E0C;
    --bg-primary:      #141210;
    --bg-secondary:    #1C1A17;
    --bg-card:         #222019;
    --bg-card-hover:   #2A2721;
    --bg-input:        #1A1815;
    --bg-overlay:      rgba(0, 0, 0, 0.72);

    --text-primary:    #F0EDE6;
    --text-secondary:  #9A9080;
    --text-muted:      #5C5650;
    --text-gold:       #C9A96E;
    --text-invert:     #141210;

    --border-default:  rgba(255, 255, 255, 0.06);
    --border-gold:     rgba(201, 169, 110, 0.30);
    --border-focus:    rgba(201, 169, 110, 0.70);

    --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.50);
    --shadow-glow:     0 0 32px rgba(201, 169, 110, 0.10);
    --shadow-input:    inset 0 1px 3px rgba(0, 0, 0, 0.40);

    --radius-sm:       4px;
    --radius-md:       8px;
    --radius-lg:       12px;
    --radius-xl:       16px;

    --sidebar-width:           240px;
    --sidebar-width-collapsed: 64px;
    --navbar-height:           60px;

    --transition:      150ms ease;
}

/* ─────────────────────────────────────────
   TOKENS — TEMA LIGHT
───────────────────────────────────────── */
[data-theme="light"] {
    --gold:            #9A6E2E;
    --gold-light:      #B8862E;
    --gold-dark:       #7A5520;
    --gold-muted:      rgba(154, 110, 46, 0.10);
    --gold-border:     rgba(154, 110, 46, 0.22);
    --gold-glow:       rgba(154, 110, 46, 0.08);

    --bg-root:         #F5F2ED;
    --bg-primary:      #EDE9E2;
    --bg-secondary:    #E4DFD6;
    --bg-card:         #FFFFFF;
    --bg-card-hover:   #FAF8F5;
    --bg-input:        #F7F4EF;
    --bg-overlay:      rgba(0, 0, 0, 0.45);

    --text-primary:    #1A1714;
    --text-secondary:  #6B6055;
    --text-muted:      #ADA098;
    --text-gold:       #9A6E2E;
    --text-invert:     #F0EDE6;

    --border-default:  rgba(0, 0, 0, 0.08);
    --border-gold:     rgba(154, 110, 46, 0.28);
    --border-focus:    rgba(154, 110, 46, 0.65);

    --shadow-card:     0 2px 16px rgba(0, 0, 0, 0.08);
    --shadow-glow:     0 0 24px rgba(154, 110, 46, 0.08);
    --shadow-input:    inset 0 1px 3px rgba(0, 0, 0, 0.05);

    --sidebar-width:           240px;
    --sidebar-width-collapsed: 64px;
    --navbar-height:           60px;
}

/* ─────────────────────────────────────────
   RESET / BASE
───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition), color var(--transition);
}

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--gold-muted); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─────────────────────────────────────────
   SELEÇÃO DE TEXTO
───────────────────────────────────────── */
::selection {
    background: var(--gold-muted);
    color: var(--gold);
}

/* ─────────────────────────────────────────
   TIPOGRAFIA
───────────────────────────────────────── */
.vl-display {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.vl-heading {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.vl-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-gold);
}

.vl-tagline {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ─────────────────────────────────────────
   LOGO
───────────────────────────────────────── */
.vl-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-decoration: none;
    user-select: none;
}

.vl-logo__mark {
    width: 40px;
    height: 40px;
    color: var(--gold);
}

.vl-logo__name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    line-height: 1;
}

.vl-logo__sub {
    font-size: 0.6rem;
    letter-spacing: 0.28em;
    color: var(--text-gold);
    text-transform: uppercase;
    line-height: 1;
    margin-top: 1px;
}

.vl-logo--sm .vl-logo__mark { width: 28px; height: 28px; }
.vl-logo--sm .vl-logo__name { font-size: 1rem; }

/* ─────────────────────────────────────────
   SEPARADOR DOURADO
───────────────────────────────────────── */
.vl-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.vl-divider::before,
.vl-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-border), transparent);
}

/* ─────────────────────────────────────────
   CARDS
───────────────────────────────────────── */
.vl-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.vl-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.vl-card--gold {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(201, 169, 110, 0.04) 100%);
}

/* ─────────────────────────────────────────
   PAGE STRUCTURE
───────────────────────────────────────── */
.vl-page {
    max-width: 1120px;
}

.vl-page--narrow {
    max-width: 900px;
}

.vl-page--form {
    max-width: 640px;
}

.vl-page--full {
    width: 100%;
    max-width: none;
}

.vl-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vl-page-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.vl-page-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}

.vl-page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vl-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.vl-stat-card {
    padding: 1.1rem 1.25rem;
}

.vl-stat-card__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.vl-stat-card--gold .vl-stat-card__label {
    color: var(--text-gold);
}

.vl-stat-card__value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-gold);
    line-height: 1;
}

.vl-stat-card__value--compact {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.25;
}

.vl-stat-card__meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.vl-data-card {
    overflow: hidden;
    padding: 0;
}

.vl-data-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.vl-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-gold);
}

.vl-table {
    width: 100%;
    border-collapse: collapse;
}

.vl-table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-default);
}

.vl-table th:first-child,
.vl-table td:first-child {
    padding-left: 1.25rem;
}

.vl-table th:last-child,
.vl-table td:last-child {
    padding-right: 1.25rem;
}

.vl-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-default);
}

.vl-empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* ─────────────────────────────────────────
   FORMULÁRIOS
───────────────────────────────────────── */
.vl-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.vl-label-field {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.vl-input {
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    box-shadow: var(--shadow-input);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
}

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

.vl-input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-input), 0 0 0 3px var(--gold-glow);
}

.vl-input.is-invalid {
    border-color: #C0392B;
    box-shadow: var(--shadow-input), 0 0 0 3px rgba(192, 57, 43, 0.10);
}

.vl-invalid-feedback {
    font-size: 0.75rem;
    color: #E74C3C;
    margin-top: 2px;
}

/* ── Combobox dropdown (cidade / profissão) ── */
.vl-combo-dropdown {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .14);
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-default) transparent;
}

.vl-combo-dropdown::-webkit-scrollbar {
    width: 5px;
}
.vl-combo-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.vl-combo-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 99px;
}

.vl-combo-item {
    padding: 0.6rem 1rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    border-bottom: 1px solid transparent;
}

.vl-combo-item:last-child {
    border-bottom: none;
}

.vl-combo-item:hover,
.vl-combo-item--focused {
    background: rgba(201, 169, 110, 0.1);
    color: var(--text-gold);
}

.vl-combo-item--focused {
    background: rgba(201, 169, 110, 0.14);
}

.vl-input-icon {
    position: relative;
}

.vl-input-icon .vl-input {
    padding-left: 2.4rem;
}

.vl-input-icon__icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.vl-input-icon .vl-input:focus ~ .vl-input-icon__icon,
.vl-input-icon:focus-within .vl-input-icon__icon {
    color: var(--gold);
}

/* ─────────────────────────────────────────
   BOTÕES
───────────────────────────────────────── */
.vl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}

.vl-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Gold (primário) */
.vl-btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
    background-size: 200% auto;
    color: #1A1714;
    border-color: var(--gold-dark);
    box-shadow: 0 2px 12px rgba(201, 169, 110, 0.25);
}

.vl-btn-gold:hover:not(:disabled) {
    background-position: right center;
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.40);
    transform: translateY(-1px);
    color: #1A1714;
}

.vl-btn-gold:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.20);
}

/* Outline dourado */
.vl-btn-outline {
    background: transparent;
    border-color: var(--border-gold);
    color: var(--text-gold);
}

.vl-btn-outline:hover:not(:disabled) {
    background: var(--gold-muted);
    border-color: var(--gold);
    color: var(--gold);
}

/* Ghost */
.vl-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.vl-btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* Tamanhos */
.vl-btn-sm { padding: 0.45rem 1rem; font-size: 0.72rem; }
.vl-btn-lg { padding: 0.85rem 2rem; font-size: 0.82rem; }
.vl-btn-full { width: 100%; }

/* ─────────────────────────────────────────
   BADGE
───────────────────────────────────────── */
.vl-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vl-badge-gold {
    background: var(--gold-muted);
    color: var(--text-gold);
    border: 1px solid var(--gold-border);
}

/* ─────────────────────────────────────────
   THEME TOGGLE BUTTON
───────────────────────────────────────── */
.vl-theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.vl-theme-toggle:hover {
    border-color: var(--border-gold);
    color: var(--text-gold);
}

/* ─────────────────────────────────────────
   LAYOUT — LOGIN
───────────────────────────────────────── */
.vl-login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-root);
}

/* Painel esquerdo — branding */
.vl-login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    background: linear-gradient(155deg, #181510 0%, #0F0E0C 60%, #1C1810 100%);
    overflow: hidden;
}

.vl-login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 30% 60%, rgba(201,169,110,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 20%, rgba(201,169,110,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.vl-login-brand__corner {
    position: absolute;
    top: 0; left: 0;
    width: 220px; height: 220px;
    border-right: 1px solid var(--gold-border);
    border-bottom: 1px solid var(--gold-border);
    border-radius: 0 0 var(--radius-xl) 0;
    opacity: 0.35;
}

.vl-login-brand__corner-br {
    position: absolute;
    bottom: 0; right: 0;
    width: 160px; height: 160px;
    border-left: 1px solid var(--gold-border);
    border-top: 1px solid var(--gold-border);
    border-radius: var(--radius-xl) 0 0 0;
    opacity: 0.25;
}

.vl-login-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
}

.vl-login-brand__headline {
    margin-top: 1.5rem;
}

/*
 * O painel de marca tem fundo sempre escuro.
 * Forçamos cores fixas (dark-theme) aqui para que não
 * percam contraste quando o usuário troca para tema claro.
 */
.vl-login-brand,
.vl-login-brand * {
    --text-primary:   #F0EDE6;
    --text-secondary: #B0A898;
    --text-muted:     #6A6258;
    --text-gold:      #C9A96E;
    --gold:           #C9A96E;
    --gold-light:     #E2C990;
    --gold-border:    rgba(201, 169, 110, 0.28);
}

.vl-login-brand__headline h1 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.9rem, 3.2vw, 2.75rem);
    font-weight: 500;
    color: #F0EDE6;
    line-height: 1.25;
    letter-spacing: 0.02em;
    font-kerning: normal;
}

.vl-login-brand__headline h1 span {
    color: #C9A96E;
}

.vl-login-brand__desc {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: #B0A898;
    line-height: 1.85;
    max-width: 360px;
}

.vl-login-brand__features {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 2.5rem;
}

.vl-login-brand__feature {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.9rem;
    color: #B0A898;
}

.vl-login-brand__feature i {
    color: #C9A96E;
    font-size: 0.95rem;
    width: 18px;
    flex-shrink: 0;
}

.vl-login-brand__footer {
    position: absolute;
    bottom: clamp(1.5rem, 3vw, 2.5rem);
    left: clamp(2rem, 5vw, 4rem);
    right: clamp(2rem, 5vw, 4rem);
    z-index: 1;
}

.vl-login-brand__footer .vl-tagline {
    color: #A89880;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
}

/* Painel direito — formulário */
.vl-login-form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4rem);
    background: var(--bg-primary);
    position: relative;
}

.vl-login-form-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    bottom: 0; width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gold-border), transparent);
}

.vl-login-form-box {
    width: 100%;
    max-width: 400px;
}

/* Arco do símbolo: cor visível nos dois temas */
:root .vl-logo-arc,
[data-theme="dark"] .vl-logo-arc  { fill: #3C3830; }
[data-theme="light"] .vl-logo-arc { fill: #2A2826; }

/* Dentro do painel de marca (sempre escuro):
   - arco um tom mais claro para contrastar com o fundo muito escuro
   - wordmark "VELTHERA" sempre em creme (nunca escurece)
   - "TRACE" e linhas divisórias mantêm cor dourada (não sobrescreve) */
.vl-login-brand .vl-logo-arc               { fill: #3C3830; }
.vl-login-brand .vl-logo-block .vl-logo-name { color: #F0EDE6 !important; }

.vl-login-form-box__header {
    margin-bottom: 2rem;
}

.vl-login-form-box__header h2 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.vl-login-form-box__header p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* ─────────────────────────────────────────
   RESPONSIVO — MOBILE
───────────────────────────────────────── */
@media (max-width: 768px) {
    .vl-login-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .vl-login-brand {
        padding: 2rem 1.5rem 1.5rem;
        min-height: auto;
    }

    .vl-login-brand__content {
        max-width: 100%;
        margin-inline: 0;
    }

    .vl-login-brand__content .vl-logo {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .vl-login-brand__headline h1 {
        font-size: 1.5rem;
    }

    .vl-login-brand__headline {
        margin-top: 1rem;
    }

    .vl-login-brand__features,
    .vl-login-brand__desc {
        display: none;
    }

    .vl-login-brand__footer {
        display: none;
    }

    .vl-login-brand__corner,
    .vl-login-brand__corner-br {
        display: none;
    }

    .vl-login-form-wrap {
        padding: 2rem 1.5rem;
        justify-content: flex-start;
    }

    .vl-login-form-wrap::before { display: none; }

    .vl-login-form-box {
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .vl-login-brand {
        padding: 1.5rem 1.25rem 1rem;
    }
    .vl-login-form-wrap {
        padding: 1.5rem 1.25rem;
    }
}

/* ─────────────────────────────────────────
   LAYOUT — APP (sidebar + conteúdo)
───────────────────────────────────────── */
.vl-app-wrap {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — sempre escuro para consistência de marca */
.vl-sidebar {
    /* Força paleta dark independente do tema do usuário */
    --bg-secondary:    #1C1A17;
    --bg-card:         #222019;
    --bg-card-hover:   #2A2721;
    --border-default:  rgba(255, 255, 255, 0.06);
    --gold-muted:      rgba(201, 169, 110, 0.18);
    --gold-border:     rgba(201, 169, 110, 0.25);
    --gold:            #C9A96E;
    --text-primary:    #F0EDE6;
    --text-secondary:  #9A9080;
    --text-muted:      #5C5650;
    --text-gold:       #C9A96E;

    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
    transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.vl-sidebar.is-collapsed {
    width: var(--sidebar-width-collapsed);
}

.vl-sidebar__header {
    border-bottom: 1px solid var(--border-default);
    overflow: hidden;
    flex-shrink: 0;
}

.vl-sidebar__logo {
    display: block;
    width: 100%;
    text-decoration: none;
    line-height: 0;
}

.vl-sidebar.is-collapsed .vl-sidebar__header {
    padding: 0.75rem 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vl-sidebar.is-collapsed .vl-sidebar__header {
    padding: 1.25rem 0.5rem;
    justify-content: center;
}

.vl-sidebar.is-collapsed .vl-sidebar__logo {
    justify-content: center;
}

.vl-sidebar.is-collapsed .vl-nav-item {
    justify-content: center;
    padding: 0.65rem 0;
    gap: 0;
}

.vl-sidebar.is-collapsed .vl-nav-item i {
    width: 20px;
    text-align: center;
}

.vl-sidebar__nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vl-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.vl-nav-item i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.vl-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.vl-nav-item.active,
.vl-nav-item.is-active {
    color: var(--text-gold);
    background: var(--gold-muted);
    border-color: var(--gold-border);
}

.vl-nav-group-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1rem 0.75rem 0.25rem;
}

/* Main content */
.vl-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.vl-main.sidebar-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

/* Top navbar */
.vl-navbar {
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 1rem;
}

.vl-navbar__title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
}

.vl-navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Page content */
.vl-content {
    flex: 1;
    padding: 1.5rem;
}

/* ─────────────────────────────────────────
   CHECKBOX CUSTOMIZADO
───────────────────────────────────────── */
.vl-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.vl-check input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-default);
    border-radius: 3px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition);
}

.vl-check input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.vl-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #1A1714;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.vl-check__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────
   LINK ÂNCORA
───────────────────────────────────────── */
.vl-link {
    color: var(--text-gold);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}

.vl-link:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ─────────────────────────────────────────
   ALERT / FEEDBACK
───────────────────────────────────────── */
.vl-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    border-left: 3px solid;
    margin-bottom: 1rem;
}

.vl-alert-success {
    background: rgba(39, 174, 96, 0.08);
    border-color: #27AE60;
    color: #2ECC71;
}

.vl-alert-danger {
    background: rgba(192, 57, 43, 0.08);
    border-color: #C0392B;
    color: #E74C3C;
}

.vl-alert-gold {
    background: var(--gold-muted);
    border-color: var(--gold);
    color: var(--text-gold);
}

/* ─────────────────────────────────────────
   UTILITIES
───────────────────────────────────────── */
.vl-text-gold  { color: var(--text-gold); }
.vl-text-muted { color: var(--text-muted); }
.vl-text-sm    { font-size: 0.8rem; }
.vl-text-xs    { font-size: 0.72rem; }

.vl-mt-auto { margin-top: auto; }
.vl-gap-sm  { gap: 0.5rem; }

.vl-flex     { display: flex; }
.vl-items-center { align-items: center; }
.vl-justify-between { justify-content: space-between; }
.vl-justify-end { justify-content: flex-end; }

/* Alpine.js cloak — oculta elementos antes da inicialização */
[x-cloak] { display: none !important; }

/* ─────────────────────────────────────────
   CONFIGURAÇÕES / PERFIL
───────────────────────────────────────── */
.vl-settings {
    display: grid;
    grid-template-columns: 172px 1fr;
    gap: 1.25rem;
    align-items: start;
    width: 100%;
    max-width: 1120px;
}

.vl-settings__nav-wrap {
    position: sticky;
    top: calc(var(--navbar-height) + 1.5rem);
}

.vl-settings__nav {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vl-settings__scroll-hint {
    display: none;
}

.vl-settings__tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background var(--transition), color var(--transition);
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
}

.vl-settings__tab i { font-size: 0.95rem; flex-shrink: 0; }

.vl-settings__tab:hover { background: var(--gold-muted); color: var(--text-primary); }

.vl-settings__tab.is-active { background: var(--gold-muted); color: var(--gold); font-weight: 600; }

.vl-settings__tab--danger { margin-top: 0.5rem; border-top: 1px solid var(--border-default); padding-top: 0.75rem; }

.vl-settings__tab--danger:hover   { background: rgba(239,68,68,.08); color: #ef4444; }
.vl-settings__tab--danger.is-active { background: rgba(239,68,68,.08); color: #ef4444; }

.vl-settings__panel {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-card);
}

.vl-settings__panel--danger { border-color: rgba(239,68,68,.25); }

.vl-patient-form {
    grid-template-columns: 196px 1fr;
}

.vl-patient-form__health {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(201, 169, 110, 0.04) 100%);
}

/* ─────────────────────────────────────────
   PRODUTOS
───────────────────────────────────────── */
.vl-product-page {
    max-width: 1120px;
}

.vl-product-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vl-product-toolbar__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vl-product-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, max-content) minmax(120px, max-content) auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.vl-product-filters__select,
.vl-product-filters__status {
    cursor: pointer;
}

.vl-product-list {
    min-width: 0;
}

.vl-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1rem;
}

.vl-product-card {
    min-width: 0;
    min-height: 156px;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 1rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: var(--bg-card);
    transition: border-color var(--transition), background var(--transition);
}

.vl-product-card:hover {
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
}

.vl-product-card__media {
    min-width: 0;
}

.vl-product-card__image {
    width: 116px;
    height: 116px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
}

.vl-product-card__image--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background:
        linear-gradient(135deg, rgba(201, 169, 110, 0.16), rgba(255, 255, 255, 0.02)),
        var(--bg-input);
    color: var(--text-muted);
}

.vl-product-card__image--empty i {
    font-size: 1.45rem;
    color: var(--text-gold);
}

.vl-product-card__image--empty span {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vl-product-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.vl-product-card__head {
    min-height: 42px;
    margin-bottom: 0.7rem;
}

.vl-product-card__title-wrap {
    min-width: 0;
}

.vl-product-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.45em;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.35;
}

.vl-product-card__title:hover {
    color: var(--text-gold);
}

.vl-product-card__brand {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.vl-product-card__meta {
    min-height: 28px;
    display: flex;
    align-content: flex-start;
    align-items: flex-start;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.vl-product-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    color: var(--text-muted);
    border: 1px solid var(--border-default);
    border-radius: 99px;
    padding: 0.16rem 0.52rem;
    line-height: 1.35;
}

.vl-product-chip--gold {
    color: var(--text-gold);
    border-color: var(--gold-border);
    background: var(--gold-muted);
}

.vl-product-chip--source {
    color: var(--text-gold);
}

.vl-product-card__codes {
    min-height: 34px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

.vl-product-card__actions {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default);
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

.vl-product-card__actions .vl-btn:first-child {
    min-width: 96px;
}

.vl-product-card__actions .vl-btn:last-child {
    width: 36px;
    padding-inline: 0;
    justify-content: center;
}

.vl-product-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.vl-product-pagination {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .vl-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .vl-page-actions {
        justify-content: flex-start;
    }

    .vl-stat-grid {
        grid-template-columns: 1fr;
    }

    .vl-product-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .vl-product-toolbar__actions {
        justify-content: flex-start;
    }

    .vl-product-filters {
        grid-template-columns: 1fr 1fr;
    }

    .vl-product-filters__search {
        grid-column: 1 / -1;
    }

    .vl-product-grid {
        grid-template-columns: 1fr;
    }

    .vl-app-wrap {
        display: block;
        min-height: 100vh;
    }

    .vl-sidebar,
    .vl-sidebar.is-collapsed {
        width: min(280px, 84vw);
        height: 100vh;
        top: 0;
        bottom: auto;
        left: 0;
        right: auto;
        z-index: 500;
        flex-direction: column;
        border-right: 1px solid var(--border-default);
        border-top: none;
        overflow: hidden;
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow var(--transition);
    }

    .vl-sidebar:not(.is-collapsed) {
        transform: translateX(0);
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.36);
    }

    .vl-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 450;
        background: rgba(0, 0, 0, 0.42);
        backdrop-filter: blur(2px);
    }

    .vl-sidebar__header,
    .vl-sidebar.is-collapsed .vl-sidebar__header {
        display: block;
        padding: 0;
        border-bottom: 1px solid var(--border-default);
    }

    .vl-sidebar__nav {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0.75rem;
        gap: 2px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .vl-nav-group-label {
        display: block !important;
    }

    .vl-nav-item,
    .vl-sidebar.is-collapsed .vl-nav-item {
        min-width: 0;
        height: auto;
        justify-content: flex-start;
        padding: 0.6rem 0.75rem;
        gap: 0.65rem;
        border-radius: var(--radius-md);
    }

    .vl-nav-item span {
        display: inline !important;
    }

    .vl-nav-item i,
    .vl-sidebar.is-collapsed .vl-nav-item i {
        width: 18px;
        font-size: 0.95rem;
    }

    .vl-sidebar > div:last-child {
        padding: 0.5rem 0.75rem 0.75rem !important;
        border-top: 1px solid var(--border-default) !important;
    }

    .vl-sidebar form span {
        display: inline !important;
    }

    .vl-main,
    .vl-main.sidebar-collapsed {
        margin-left: 0;
        min-height: 100vh;
    }

    .vl-navbar {
        height: 56px;
        padding: 0 1rem;
    }

    .vl-navbar__title {
        font-size: 1rem;
    }

    .vl-content {
        padding: 1rem;
    }
}

@media (max-width: 620px) {
    .vl-page-actions {
        flex-direction: column;
    }

    .vl-page-actions .vl-btn {
        width: 100%;
        justify-content: center;
    }

    .vl-data-card {
        overflow-x: auto;
    }

    .vl-table {
        min-width: 720px;
    }

    .vl-product-toolbar__actions {
        flex-direction: column;
    }

    .vl-product-filters {
        grid-template-columns: 1fr;
    }

    .vl-product-toolbar__actions .vl-btn,
    .vl-product-filters .vl-btn,
    .vl-product-filters__select,
    .vl-product-filters__status {
        width: 100%;
        justify-content: center;
    }

    .vl-product-grid {
        grid-template-columns: 1fr;
    }

    .vl-product-card {
        min-height: 0;
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.9rem;
    }

    .vl-product-card__image {
        width: 86px;
        height: 86px;
    }

    .vl-product-card__head {
        min-height: 0;
    }

    .vl-product-card__title {
        min-height: 0;
    }

    .vl-product-card__meta,
    .vl-product-card__codes {
        min-height: 0;
    }

    .vl-product-card__actions .vl-btn:first-child {
        flex: 1;
        justify-content: center;
    }

    .vl-product-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .vl-settings {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }

    .vl-settings__nav-wrap {
        position: relative;
        top: auto;
        max-width: calc(100vw - 2rem);
    }

    .vl-settings__nav-wrap::after {
        content: '';
        pointer-events: none;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 34px;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        background: linear-gradient(to left, var(--bg-card), transparent);
    }

    .vl-settings__scroll-hint {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin: 0 0 0.4rem 0.2rem;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .vl-settings__nav {
        flex-direction: row;
        overflow-x: auto;
        position: static;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 0.375rem;
        width: 100%;
        max-width: calc(100vw - 2rem);
    }

    .vl-settings__nav::-webkit-scrollbar { display: none; }

    .vl-settings__tab {
        white-space: nowrap;
        flex-shrink: 0;
        border-top: none;
        padding-top: 0.6rem;
        margin-top: 0;
        width: auto;
    }

    .vl-settings__tab--danger {
        border-top: none;
        margin-top: 0;
        padding-top: 0.6rem;
    }

    .vl-settings__panel {
        padding: 1.25rem;
        overflow-x: hidden;
    }

    .vl-settings__panel [style*="grid-template-columns"],
    .vl-settings__panel [style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }

    .vl-settings__panel [style*="display:flex"] {
        flex-wrap: wrap;
    }

    .vl-settings__panel .vl-btn {
        width: 100%;
        justify-content: center;
    }

    .vl-settings__panel .vl-form-group [style*="display:flex"] > .vl-input-icon {
        min-width: 100%;
    }
}

/* Animação de entrada */
@keyframes vl-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.vl-animate {
    animation: vl-fade-up 0.40s ease forwards;
    will-change: opacity;
}
