/* RESET E BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #f6f8fb;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-purple: #1f726a;
    --accent-purple-glow: rgba(31, 114, 106, 0.2);
    --accent-blue: #0f766e;
    --accent-blue-glow: rgba(15, 118, 110, 0.2);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.2);
    --accent-red: #ef4444;
    
    --gradient-primary: linear-gradient(135deg, #1f726a, #0f766e);
    --gradient-success: linear-gradient(135deg, #10b981, #059669);
    --gradient-glow: 0 4px 12px rgba(31, 114, 106, 0.12);
    --primary-light: #1f726a;
    --gradient-logo: linear-gradient(135deg, #1f726a, #0f766e);
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Inputs variables */
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-bg-focus: #ffffff;
    
    /* Table variables */
    --table-border: rgba(0, 0, 0, 0.06);
    --table-bg: #f8fafc;
    --table-header-bg: #f1f5f9;
    --table-row-hover: #f1f5f9;
    
    /* Card shadow */
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    
    /* Modal variables */
    --modal-bg: #ffffff;
    --modal-border: rgba(0, 0, 0, 0.1);
    --modal-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    /* Button variables */
    --btn-secondary-bg: #f1f5f9;
    --btn-secondary-border: #cbd5e1;
    --btn-secondary-hover-bg: #e2e8f0;
    --btn-secondary-hover-border: #cbd5e1;
    
    /* Favorites variables */
    --fav-container-bg: #f8fafc;
    --fav-container-border: rgba(0, 0, 0, 0.1);
    --fav-slot-bg: #f1f5f9;
    --fav-slot-border: #cbd5e1;

    /* Currency input variables */
    --currency-bg-color: rgba(31, 114, 106, 0.08);
    --currency-border-color: rgba(31, 114, 106, 0.24);
    --currency-text-color: #1f726a;

    /* CRM variables */
    --crm-input-bg: #f8fafc;
    --crm-input-border: #cbd5e1;
    --crm-input-hover-bg: #f1f5f9;
    --crm-input-hover-border: #cbd5e1;
    --crm-input-focus-bg: #ffffff;
    --crm-placeholder: #77728d;
    --crm-color-scheme: light;

    --crm-tag-bg: #f3e8ff;
    --crm-tag-border: #d8b4fe;
    --crm-tag-color: #6b21a8;

    --crm-pill-bg: #f1f5f9;
    --crm-pill-border: #cbd5e1;
    --crm-pill-color: #475569;

    --crm-card-bg: #f8fafc;
    --crm-card-border: rgba(0, 0, 0, 0.06);

    --crm-border: rgba(0, 0, 0, 0.08);
    --crm-header-bg: #f8fafc;
    --crm-hover-bg: rgba(0, 0, 0, 0.02);
    --crm-active-tab-bg: #f1f5f9;
    --crm-badge-bg: #f1f5f9;

    /* Toast variables */
    --toast-bg: #ffffff;
    --toast-color: #1e293b;
    --toast-border: rgba(31, 114, 106, 0.25);
    --toast-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 15px rgba(31, 114, 106, 0.05);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Background elements for visual premium depth */
.background-decor {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.circle-1 {
    width: 45vw;
    height: 45vw;
    background: var(--accent-purple);
    top: -10vw;
    right: -5vw;
}

.circle-2 {
    width: 35vw;
    height: 35vw;
    background: var(--accent-blue);
    bottom: -5vw;
    left: -5vw;
}

/* CONTAINER PRINCIPAL */
.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* CABEÇALHO */
.app-header {
    margin-bottom: 1rem;
    text-align: left;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-settings-btn,
.header-logout-btn,
.header-sheets-btn,
.header-drive-btn {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.header-settings-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: rotate(45deg);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

.header-sheets-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.header-drive-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #60a5fa;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

.header-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--text-primary);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}


.logo {
    display: inline-flex;
    align-items: center;
    gap: 1.1rem;
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(56, 168, 146, 0.35));
}

.logo-icon {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(139, 92, 246, 0.3));
}

.logo-text {
    color: var(--text-primary);
}

.logo-text span {
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* GRID LAYOUT */
.grid-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

/* CARDS E VIDROFOSCO */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.card-title i {
    color: var(--accent-purple);
}

/* FORMULÁRIO E INPUTS */
#config-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.75rem;
    padding: 0.1rem 0.6rem;
    border-radius: 30px;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

input:focus,
textarea:focus {
    background: var(--input-bg-focus);
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px var(--accent-purple-glow);
}

textarea {
    resize: vertical;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.input-tip {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

/* PASSWORD SHOW/HIDE WRAPPER */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 3.2rem !important; /* Garante que o texto não sobreponha o ícone */
}

.btn-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    z-index: 3; /* Fica acima do input para cliques, mas sem cobrir o resto do campo */
}

.btn-icon:hover {
    color: var(--text-primary);
}

/* FORM FILAS E GRUPOS */
.form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
}

.form-row-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quick-dates {
    display: flex;
    gap: 0.5rem;
    margin-top: -0.4rem;
}

/* BOTÕES */
button, .btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--gradient-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
    border-color: var(--btn-secondary-hover-border);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.35);
}

/* PAINEL DIREITO */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* STATUS CARD */
.status-card {
    border-left: 4px solid var(--accent-purple);
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-badge {
    align-self: flex-start;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Status variants */
.status-card.running { border-left-color: var(--accent-blue); }
.status-card.completed { border-left-color: var(--accent-green); }
.status-card.failed { border-left-color: var(--accent-red); }

.status-badge.running {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    animation: statusPulse 1.5s infinite alternate;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.status-text {
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.5;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
    height: 100%;
    width: 30%;
    background: var(--gradient-primary);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--accent-purple-glow);
    animation: progressInfinite 2s infinite linear;
}

@keyframes progressInfinite {
    0% { left: -30%; }
    100% { left: 100%; }
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    100% { box-shadow: 0 0 10px 4px rgba(59, 130, 246, 0.1); }
}

#status-icon.running {
    animation: spin 1s infinite linear;
    color: var(--accent-blue) !important;
}

#status-icon.completed { color: var(--accent-green) !important; }
#status-icon.failed { color: var(--accent-red) !important; }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Erros e Alertas */
.error-alert {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 1rem;
    color: #fca5a5;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.error-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.error-details strong {
    color: #fecaca;
    font-family: var(--font-heading);
    font-size: 0.92rem;
}

.error-details span {
    color: #fca5a5;
    line-height: 1.45;
}

.error-details small {
    margin-top: 0.2rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(239, 68, 68, 0.16);
    color: var(--text-secondary);
    line-height: 1.45;
}

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

.error-details summary {
    cursor: pointer;
}

.error-details code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: #fecaca;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.error-alert i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

/* Download box */
.download-container {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.success-msg {
    color: var(--accent-green);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* TABELA DE RESULTADOS */
.results-card {
    min-height: 350px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--table-border);
    background: var(--table-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
}

th {
    background-color: var(--table-header-bg);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    transition: var(--transition-smooth);
}

tbody tr:hover {
    background: var(--table-row-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

td.empty-table {
    text-align: center;
    padding: 3.5rem;
    color: var(--text-secondary);
}

td.empty-table i {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}



.post-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-smooth);
}

.post-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.hotel-match {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

.date-col {
    white-space: nowrap;
}

.agency-col {
    color: var(--accent-purple);
    font-weight: 500;
    white-space: nowrap;
}

/* Scrollbar Custom */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--toast-bg);
    border: 1px solid var(--toast-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: var(--toast-shadow);
    color: var(--toast-color);
    font-size: 0.9rem;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    backdrop-filter: blur(8px);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-color: var(--accent-green); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 0 15px rgba(16, 185, 129, 0.15); }
.toast-success i { color: var(--accent-green); }

.toast-error { border-color: var(--accent-red); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 0 15px rgba(239, 68, 68, 0.15); }
.toast-error i { color: var(--accent-red); }

/* RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS */
@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.5rem 1rem;
        gap: 1.2rem;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .form-row-dates {
        grid-template-columns: 1fr; /* Empilha campos de data no celular */
        gap: 1rem;
    }

    .quick-dates {
        flex-wrap: wrap; /* Envolve botões de data no celular se faltar espaço */
        gap: 0.5rem;
    }

    .quick-dates button {
        flex: 1;
        min-width: 100px;
    }

    .button-group {
        grid-template-columns: 1fr; /* Empilha botões Salvar/Varredura verticalmente */
        gap: 0.8rem;
    }
    
    button, .btn-success {
        width: 100%;
        padding: 0.75rem 1.2rem;
    }

    /* Transformar Tabela em Cards no Celular */
    .table-container {
        border: none;
        background: transparent;
        overflow-x: visible; /* Não precisa rolar de lado se virou card */
    }

    #results-table, 
    #results-table thead, 
    #results-table tbody, 
    #results-table th, 
    #results-table td, 
    #results-table tr {
        display: block;
    }

    #results-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    #results-table tbody tr {
        border: 1px solid var(--card-border);
        border-radius: 12px;
        margin-bottom: 1.2rem;
        background: var(--card-bg);
        padding: 1rem;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: var(--card-shadow);
    }

    #results-table tbody tr:hover {
        background: var(--table-row-hover);
        border-color: var(--accent-purple);
    }

    #results-table td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        position: relative;
        padding: 0.8rem 0.5rem 0.8rem 45% !important; /* espaço para o label */
        text-align: right;
        font-size: 0.88rem;
        min-height: 2.5rem;
        display: block; /* Corrigido de flex para block para melhor responsividade no mobile */
    }

    #results-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0.4rem !important;
    }

    #results-table td:first-child {
        padding-top: 0.4rem !important;
    }

    #results-table td:before {
        position: absolute;
        left: 0.8rem;
        top: 0.8rem; /* Alinhado ao topo com o padding do td */
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        font-family: var(--font-heading);
        color: var(--text-secondary);
        content: attr(data-label);
    }



    /* Caso a tabela esteja vazia, não aplicar card style */
    #results-table td.empty-table {
        padding: 3rem 1.5rem !important;
        text-align: center;
        justify-content: center;
        display: block;
        min-height: auto;
    }

    #results-table td.empty-table:before {
        display: none;
    }

    /* Evitar zoom automático irritante do iOS em inputs menores que 16px */
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 1rem 0.5rem;
    }
    
    .card {
        padding: 1.2rem 0.8rem;
        border-radius: 15px;
    }
    
    /* Reduzir padding do modal em celulares bem pequenos */
    .modal-content {
        padding: 1.5rem 1.2rem;
        border-radius: 16px;
    }
    
    .modal-header {
        margin-bottom: 1rem;
    }
    
    #modal-settings-form {
        gap: 1rem;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: calc(100% - 2rem);
    }
}

/* MODAL STYLES (COMPARTILHADO) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: 20px;
    padding: 2.2rem;
    max-width: 500px;
    width: 90%;
    text-align: left;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--modal-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-btn {
    width: 100%;
    margin-top: 1rem;
}

/* CONTAINER DE FAVORITOS */
.favorites-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
    background: var(--fav-container-bg);
    border: 1px dashed var(--fav-container-border);
    border-radius: 10px;
    padding: 0.6rem;
}

.favorites-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

.favorites-label i {
    color: #fbbf24; /* Estrela amarela de favorito */
}

.favorites-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.favorite-slot {
    display: flex;
    align-items: center;
    background: var(--fav-slot-bg);
    border: 1px solid var(--fav-slot-border);
    border-radius: 6px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.favorite-slot:hover {
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.06);
}

.btn-fav-load {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 0.78rem !important;
    padding: 0.35rem 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 130px;
    height: auto !important;
    display: inline-block !important;
    transition: var(--transition-smooth);
}

.btn-fav-load:hover {
    color: #fbbf24 !important;
}

.btn-fav-save {
    background: rgba(255, 255, 255, 0.04) !important;
    border: none !important;
    border-left: 1px solid var(--fav-slot-border) !important;
    color: var(--text-secondary) !important;
    padding: 0.35rem 0.5rem !important;
    cursor: pointer;
    font-size: 0.75rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--transition-smooth);
}

.btn-fav-save:hover {
    background: rgba(56, 168, 146, 0.2) !important;
    color: var(--accent-purple) !important;
}

/* HOKWE HUB */
body {
    display: block;
}

.hub-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
}

.hub-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 310px;
    padding: 1.5rem 1rem;
    background: rgba(7, 7, 13, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    z-index: 20;

    /* Override variables locally for the sidebar dark theme */
    --text-primary: #f3f1f7;
    --text-secondary: #9a94b4;
    --accent-purple: #38a892;
    --accent-purple-glow: rgba(56, 168, 146, 0.4);
    --accent-blue: #1f726a;
    --accent-blue-glow: rgba(31, 114, 106, 0.4);
    --gradient-primary: linear-gradient(135deg, #38a892, #1f726a);
    --gradient-logo: linear-gradient(135deg, #a7f3d0, #38a892);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.8rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
}

.sidebar-item span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-brand strong {
    font-family: var(--font-heading);
    font-size: 2.35rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.sidebar-brand-name b {
    color: var(--accent-purple);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

.sidebar-brand-name {
    display: inline-flex;
    align-items: baseline;
}

.sidebar-brand-name {
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-brand span,
.sidebar-item small,
.sidebar-footer small {
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.4;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 1.4rem;
}

.nav-section-label {
    padding: 0 0.7rem 0.45rem;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-item {
    width: 100%;
    min-height: 66px;
    padding: 0.8rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.sidebar-item i {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.sidebar-tool-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sidebar-item strong {
    font-size: 0.83rem;
    margin-bottom: 0.16rem;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(56, 168, 146, 0.16), rgba(31, 114, 106, 0.08));
    border-color: rgba(56, 168, 146, 0.3);
    box-shadow: inset 3px 0 0 var(--accent-purple);
}

.sidebar-item.active i {
    color: var(--accent-purple);
}

.sidebar-item.upcoming {
    cursor: default;
    opacity: 0.58;
}

.sidebar-item em {
    color: var(--accent-purple);
    font-size: 0.6rem;
    font-style: normal;
    white-space: nowrap;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.7rem 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-primary);
    font-size: 0.76rem;
}

.hub-main {
    grid-column: 2;
    min-width: 0;
}

.tool-context {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.9rem;
}

.tool-context-icon {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.eyebrow {
    color: var(--accent-purple);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tool-context h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.tool-context p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.tool-status {
    flex: none;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 30px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-green);
    font-size: 0.72rem;
    font-weight: 600;
}

.tool-status i {
    margin-right: 0.3rem;
    font-size: 0.45rem;
}

.hub-main .app-container {
    max-width: 1400px;
    padding-top: 1.8rem;
}

.hub-main .app-header {
    padding: 0;
    margin-bottom: 0;
    border: 0;
    background: transparent;
}

.compact-actions .header-content {
    min-height: 44px;
}

.hub-main .logo {
    font-size: 1.8rem;
}

.hub-main .logo-img {
    height: 38px;
}

@media (max-width: 1100px) {
    .hub-shell {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .hub-sidebar {
        width: 82px;
        padding-inline: 0.65rem;
    }

    .sidebar-brand {
        justify-content: center;
        padding-inline: 0;
    }

    .sidebar-brand div,
    .sidebar-item span,
    .sidebar-item em,
    .nav-section-label {
        display: none;
    }

    .sidebar-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.8rem !important;
        padding: 1rem 0 0.5rem !important;
        background: rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 8px !important;
        width: 100% !important;
    }

    .sidebar-footer > div {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .sidebar-footer > div > div:last-child {
        display: none !important;
    }

    .sidebar-item {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 0.8rem 0;
    }

    .sidebar-tool-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 700px) {
    .hub-shell {
        display: block;
        padding-bottom: 76px;
    }

    .hub-sidebar {
        inset: auto 0 0;
        width: 100%;
        height: 70px;
        padding: 0.55rem 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-right: none;
    }

    .sidebar-brand,
    .sidebar-footer,
    .nav-section-label {
        display: none;
    }

    .sidebar-nav {
        height: 100%;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .sidebar-item {
        min-height: 0;
        height: 100%;
        border-radius: 12px;
    }

    .hub-main {
        width: 100%;
    }

    .tool-context {
        padding: 1.3rem 1rem 0;
        align-items: center;
    }

    .tool-status {
        display: none;
    }
}
