:root {
    --gold-light: #f0b429;
    --gold: #d4920a;
    --gold-muted: #7a5004;
    --bg-base: #0e0801;
    --bg-card: #1a1008;

    /* Fluid Typography Scale */
    --text-hero: clamp(1.5rem, 1.25rem + 2.5vw, 2.75rem);
    /* Título Principal */
    --text-title: clamp(1.15rem, 1rem + 1.1vw, 2rem);
    /* Títulos de Seção */
    --text-base: clamp(0.9rem, 0.85rem + 0.4vw, 1.15rem);
    /* Corpo de Texto */
    --text-xs: clamp(0.7rem, 0.65rem + 0.3vw, 0.85rem);
    /* Labels/Metadata */

    color-scheme: dark;
}

/* ============================================================
   SIDEBAR: desktop sempre visível, mobile oculta por padrão
   ============================================================ */
#sidebar {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Curva Premium Expressiva */
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 768px) {
    #sidebar {
        transform: translateX(0) !important;
    }

    #sidebar-overlay {
        display: none !important;
    }

    .main-offset {
        margin-left: 260px;
    }
}

@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-260px);
    }

    .main-offset {
        margin-left: 0;
    }

    body.sidebar-active #sidebar {
        transform: translateX(0) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    body.sidebar-active #sidebar-overlay {
        display: block !important;
        opacity: 1;
    }

    body.sidebar-active {
        overflow: hidden;
    }
}

/* ============================================================
   MOBILE & IOS FIXES
   ============================================================ */
[onclick],
[onmousedown],
[onmouseup],
button,
a,
[role="button"] {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button,
input[type="submit"],
input[type="button"] {
    -webkit-appearance: none;
    appearance: none;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
}

html {
    background-color: var(--bg-base);
    color: #e8d5b0;
}

input,
select,
textarea {
    color-scheme: dark;
}

/* Corrige a interação com o ícone do calendário em campos de data */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.section-title {
    @apply font-cinzel text-gold text-sm tracking-[0.3em] uppercase mb-8 pb-2 border-b border-gold/10 flex items-center gap-3;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.form-section {
    @apply bg-white/5 border border-white/5 rounded-3xl p-8 mb-8 backdrop-blur-md;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #0d0800;
}

::-webkit-scrollbar-thumb {
    background: #5a3d0a;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4920a;
}

/* ============================================================
   CHART CANVAS
   ============================================================ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============================================================
   TREND CLASSES (aplicadas via JS)
   ============================================================ */
.trend-up {
    color: #ef4444;
}

.trend-down {
    color: #22c55e;
}

.trend-neutral {
    color: #7a5004;
}

/* ============================================================
   ANIMAÇÕES
   ============================================================ */
@keyframes pulse-gold {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.pulse-dot {
    animation: pulse-gold 2.2s ease-in-out infinite;
}

@keyframes glow-border {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(212, 146, 10, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(240, 180, 41, 0.45);
    }
}

.card-glow {
    animation: glow-border 3s ease-in-out infinite;
}

/* ============================================================
   GLASS COMPONENTS (Standard)
   ============================================================ */
.glass-card {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(200, 146, 42, 0.12);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: var(--gold);
    background: rgba(90, 61, 10, 0.15);
}

.status-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 99px;
    text-transform: uppercase;
    font-weight: 800;
    border: 1px solid currentColor;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
   FORMS (Standard)
   ============================================================ */
input,
select,
textarea,
.input-standard {
    background: #120c06;
    border: 1px solid rgba(212, 146, 10, 0.1);
    color: #fff;
    border-radius: 0.75rem;
    padding: 12px 16px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus,
.input-standard:focus {
    border-color: var(--gold);
    background: #1a1008;
    box-shadow: 0 0 0 4px rgba(212, 146, 10, 0.05);
    outline: none;
}

label,
.label-standard {
    color: var(--gold-muted);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================================
   TIMELINE & PHOTOS (Standard)
   ============================================================ */
.timeline-item {
    border-left: 2px solid rgba(200, 146, 42, 0.2);
    padding-left: 30px;
    position: relative;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--gold-light);
    border-radius: 50%;
    position: absolute;
    left: -7px;
    top: 0;
    box-shadow: 0 0 10px var(--gold-light);
}

.img-preview {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    background: #000;
}

.img-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.img-preview:hover img {
    transform: scale(1.1);
}

/* ============================================================
   TYPOGRAPHY (Standard)
   ============================================================ */
h1,
.h1-premium {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold-light);
    font-size: var(--text-hero);
}

h2,
.h2-premium {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #fff;
    font-size: var(--text-title);
}

.text-premium {
    font-family: 'Rajdhani', sans-serif;
    font-size: var(--text-base);
}

.text-mono-premium {
    font-family: 'Share Tech Mono', monospace;
}

.tracking-premium {
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* UTILS */
.gap-fluid {
    gap: clamp(1rem, 5vw, 2.5rem);
}

.p-fluid {
    padding: clamp(1rem, 5vw, 2.5rem);
}

/* ============================================================
   FLATPICKR CUSTOM THEME (Dark Gold)
   ============================================================ */
.flatpickr-calendar {
    background: #1a1008 !important;
    border: 1px solid rgba(212, 146, 10, 0.3) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9) !important;
    border-radius: 1.5rem !important;
    font-family: 'Rajdhani', sans-serif !important;
    padding-top: 8px;
    /* Espaço para o topo não cortar */
}

.flatpickr-month {
    background: transparent !important;
    color: #fff !important;
    fill: #fff !important;
    height: 40px !important;
}

.flatpickr-current-month {
    padding: 5px 0 0 0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    background: rgba(212, 146, 10, 0.1) !important;
    border: 1px solid rgba(212, 146, 10, 0.2) !important;
    border-radius: 8px !important;
    padding: 2px 8px !important;
    font-weight: 700 !important;
    color: #fff !important;
}

.flatpickr-weekday {
    color: #7a5004 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.flatpickr-day {
    border-radius: 12px !important;
    color: #e8d5b0 !important;
}

.flatpickr-day:hover {
    background: rgba(212, 146, 10, 0.1) !important;
    border-color: transparent !important;
}

.flatpickr-day.today {
    border-color: #d4920a !important;
}

.flatpickr-day.selected {
    background: #d4920a !important;
    color: #000 !important;
    font-weight: 900;
}

.flatpickr-innerContainer {
    padding: 15px;
}

/* Aumentado para evitar corte lateral */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #d4920a !important;
    fill: #d4920a !important;
    top: 10px !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: rgba(212, 146, 10, 0.1);
    border-radius: 50%;
}