/* ==========================================================================
   CSS DESIGN SYSTEM - PORTAL DA PLANILHA PREMIUM (DESBRAVANDO A TERRA)
   ========================================================================== */
:root {
    --bg-main: #060913;
    --bg-card: rgba(15, 22, 42, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;
    
    /* Cores de Destaque Patagônicas */
    --accent-terracota: #ea580c;
    --accent-terracota-dark: #9a3412;
    --accent-glacial: #2563eb;
    --accent-glacial-dark: #1d4ed8;
    
    --font-titles: 'Outfit', sans-serif;
    --font-text: 'Plus Jakarta Sans', sans-serif;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-text);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Customizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-terracota);
}

.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

.text-orange {
    color: var(--accent-terracota) !important;
}

.text-green {
    color: #10b981 !important;
}

.text-red {
    color: #ef4444 !important;
}

/* ==========================================================================
   TELA DE LOGIN (PROTEÇÃO DE ACESSO)
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: linear-gradient(to bottom, rgba(6, 9, 19, 0.8) 0%, rgba(6, 9, 19, 0.98) 100%), url('../ushuaia_placa.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
}

.login-card {
    background: rgba(15, 22, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.25rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-header .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-terracota) 0%, var(--accent-glacial) 100%);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2);
}

.login-header h2 {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-smooth);
}

.password-wrapper input:focus {
    border-color: var(--accent-terracota);
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.15);
}

.password-wrapper .btn-icon {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-wrapper .btn-icon:hover {
    color: white;
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    text-align: left;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-terracota) 0%, var(--accent-terracota-dark) 100%);
    border: none;
    color: white;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   BARRA SUPERIOR (HEADER)
   ========================================================================== */
.app-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-back {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-terracota);
}

.brand-info h1 {
    font-family: var(--font-titles);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.badge-premium {
    font-size: 0.75rem;
    background: rgba(234, 88, 12, 0.15);
    color: var(--accent-terracota);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(234, 88, 12, 0.25);
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-secondary-sm {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-secondary-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-glacial);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* ==========================================================================
   LAYOUT GRID
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    flex-grow: 1;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* CARDS ESTRUTURA */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card h3 {
    font-family: var(--font-titles);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   AREA DE DOWNLOADS
   ========================================================================== */
.download-card {
    background: linear-gradient(135deg, rgba(15, 22, 42, 0.85) 0%, rgba(11, 15, 25, 0.95) 100%);
    border: 1px solid rgba(234, 88, 12, 0.15);
}

.card-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--accent-terracota);
    filter: blur(60px);
    opacity: 0.15;
    pointer-events: none;
}

.download-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.download-header .icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(234, 88, 12, 0.1);
    color: var(--accent-terracota);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.download-header h2 {
    font-family: var(--font-titles);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.download-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: white;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-content i {
    width: 24px;
    height: 24px;
}

.btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.btn-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.btn-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-size {
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.badge-online {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Excel Style Button */
.excel-btn {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.05) 0%, rgba(234, 88, 12, 0.1) 100%);
    border-color: rgba(234, 88, 12, 0.3);
}

.excel-btn:hover {
    border-color: var(--accent-terracota);
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.15) 0%, rgba(234, 88, 12, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.15);
}

/* Sheets Style Button */
.sheets-btn {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: rgba(37, 99, 235, 0.3);
}

.sheets-btn:hover {
    border-color: var(--accent-glacial);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.download-info {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.download-info i {
    width: 16px;
    height: 16px;
    color: var(--accent-terracota);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   SIMULADOR WEB
   ========================================================================== */
.simulator-configs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.config-row .input-group {
    margin-bottom: 0;
}

.config-row input, .config-row select {
    width: 100%;
    background: rgba(6, 9, 19, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.config-row input:focus, .config-row select:focus {
    border-color: var(--accent-glacial);
}

.info-wrapper-label {
    position: relative;
    display: flex;
    align-items: center;
}

.tooltip-icon {
    position: absolute;
    right: 10px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

/* RESULTADOS SIMULADOR */
.simulator-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.result-tile {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.result-tile .tile-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.result-tile h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.result-tile.highlight {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.05) 0%, rgba(234, 88, 12, 0.12) 100%);
    border-color: rgba(234, 88, 12, 0.25);
}

.result-tile.highlight h3 {
    font-family: var(--font-titles);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-terracota);
}

.autonomy-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    margin-top: 6px;
}

.badge-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   GUIA DE VEICULOS (TABS)
   ========================================================================== */
.vehicle-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 1.25rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: rgba(234, 88, 12, 0.1);
    color: var(--accent-terracota);
}

.tab-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tab-content li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}

.tab-content li::before {
    content: "•";
    color: var(--accent-terracota);
    font-size: 1.2rem;
    position: absolute;
    left: 4px;
    top: -1px;
}

/* ==========================================================================
   ESTRUTURA PLANILHA (SIDEBAR)
   ========================================================================== */
.sheet-tabs-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sheet-tab-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sheet-color-badge {
    width: 6px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.color-dash { background: #6b7280; }
.color-rot { background: #ef4444; }
.color-comb { background: #eab308; }
.color-fin { background: #10b981; }
.color-doc { background: #8b5cf6; }
.color-check { background: #3b82f6; }

.sheet-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.sheet-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: block;
}

/* ==========================================================================
   SEGREDOS CAMBIO (SIDEBAR)
   ========================================================================== */
.exchange-card {
    background: linear-gradient(135deg, rgba(15, 22, 42, 0.7) 0%, rgba(234, 88, 12, 0.03) 100%);
}

.exchange-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.exchange-header i {
    width: 24px;
    height: 24px;
}

.exchange-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.exchange-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.box-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.box-label {
    color: var(--text-secondary);
}

.box-val {
    font-weight: 700;
}

.savings-badge {
    text-align: center;
    background: rgba(234, 88, 12, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.2);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-top: 4px;
}

.exchange-footer-text {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   RODAPE (FOOTER)
   ========================================================================== */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: stretch;
    }
    .header-brand {
        justify-content: center;
    }
    .header-actions {
        justify-content: center;
    }
    .simulator-results {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .simulator-results {
        grid-template-columns: 1fr;
    }
    .config-row {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 2rem 1.5rem;
    }
}
