/* Tokens del SWISH Design System (colores, tipografía Asap, espaciado, sombras, radios).
   @import debe ser la primera regla real del fichero (los comentarios antes no cuentan). */
@import url("./design-tokens.css");
@import url("./icons.css");

/* === FILTER DROPDOWN SYSTEM === */

/* Iconos de filtro */
.filter-icon {
    cursor: pointer;
    margin-left: 4px;
    color: rgb(105,116,132);
    font-size: 12px;
    transition: color 0.2s ease;
}

.filter-icon:hover {
    color: rgb(59,104,255);
}

.filter-icon.active {
    color: rgb(59,104,255);
}

/* Dropdown de filtro */
.filter-dropdown {
    position: fixed;
    background: white;
    border: 1px solid rgb(213,220,230);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
}

/* Opciones de filtro */
.filter-option {
    padding: 2px 4px;
}

.filter-option label {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.filter-option label:hover {
    background-color: rgb(233,238,244);
}

.filter-option input[type="checkbox"] {
    margin-right: 6px;
}

.filter-option .option-text {
    user-select: none;
}

.user-info {
    display: flex;
    padding: 1rem
}

/* Estilos para filtros jerárquicos */
.filter-dropdown .hierarchical-parent {
    font-weight: 600;
    background: rgb(233,238,244);
    border-radius: 4px;
    margin: 4px 0;
    border-left: 2px solid rgb(213,220,230);
    padding-left: 8px;
}

.filter-dropdown .hierarchical-child {
    margin-left: 20px;
    padding: 2px 4px;
    font-size: 12px;
}

/* === TABLA AGRUPADA DASHBOARD FOLLOWS === */

a {
    text-decoration: none;
    color: inherit;
}

.tabla-vacia {
    padding: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    background: rgb(233,238,244);
    border-radius: 8px;
}

.results-table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.table-header {
    background: rgb(233,238,244);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgb(213,220,230);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.table-header h3 {
    margin: 0;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.25rem;
}

.table-header p {
    margin: 0.5rem 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    color: #e5e5e5;
}

/* Botón de exportar Excel */
.btn-success {
    background-color: rgb(0,165,125);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    background-color: #047857;
    transform: translateY(-1px);
}

/* Filtros de tabla */
.table-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgb(233,238,244);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgb(213,220,230);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-label {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 500;
}

.filter-select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85em;
    background: white;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: rgb(59,104,255);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-filters-btn {
    padding: 4px 8px;
    background: rgb(247,59,59);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: rgb(218,0,0);

    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-success:hover {
    background-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-text {
    font-family: inherit;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgb(233,238,244);
    text-align: left;
    vertical-align: middle;
}

.results-table th {
    background: rgb(233,238,244);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Filas agrupadas */
.grouped-row {
    background: rgb(233,238,244);
    font-weight: 600;
}

.grouped-row td {
    border-bottom: 1px solid rgb(213,220,230);
}

/* Botones de expandir/colapsar */
.expand-group-btn {
    color: rgb(59,104,255);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-group-btn:hover {
    color: rgb(43,63,108);
}

/* Filas de detalle */
.detail-row {
    background: #f9fafb;
}

.detail-row td {
    background: #f9fafb;
    font-size: 0.9rem;
    color: #374151;
}

/* Subtablas */
.subtable {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.subtable td {
    padding: 8px 16px;
    border-bottom: 1px solid rgb(233,238,244);
}

/* Clases específicas para identificadores */
.project-key,
.competition-id {
    font-size: 11px;
    color: rgb(105,116,132);
    font-style: italic;
    margin-top: 4px;
}

/* Filas ocultas por defecto */
.subgroup {
    display: none;
    transition: all 0.2s ease;
}

/* Hover en filas de la tabla */
.results-table tbody tr:hover {
    background: rgb(233,238,244);
}

.detail-row:hover {
    background: #f3f4f6 !important;
}
/* Reset y variables base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: rgb(233,238,244);
    --primary-color: rgb(59,104,255);
    --secondary-color: rgb(105,116,132);
    --accent-color: rgb(255,107,1);
    --text-primary: rgb(19,25,34);
    --text-secondary: rgb(105,116,132);
    --white: #ffffff;
    --border-color: rgb(213,220,230);
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Asap', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Estilos para SearchFiltersSection */
.search-filters-section {
    margin-bottom: 2rem;
}

.results-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}



.table-responsive {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid rgb(233,238,244);
    vertical-align: middle;
}

.results-table th {
    background: rgb(233,238,244);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table tbody tr:hover {
    background: rgb(233,238,244);
}

.project-key,
.competition-id {
    font-size: 11px;
    color: rgb(105,116,132);
    font-style: italic;
    margin-top: 4px;
}

.delete-btn {
    background: rgb(247,59,59);
    color: white;
    border: none;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.delete-btn:hover {
    opacity: 1;
}

.revshare-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid rgb(213,220,230);
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.percentage-value {
    color: rgb(0,165,125);
    font-weight: 600;
}

.currency-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================================
   Sidebar de navegación global (SWISH Design System)
   Inyectada por frontend/src/js/hamburger-menu.js en todas las páginas.
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 248px;
    height: 100vh;
    background: var(--grey-800);
    color: rgb(200, 208, 219);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) var(--space-4);
    flex: none;
}

.sidebar-logo-link {
    display: inline-flex;
}

.sidebar-logo {
    height: 30px;
    width: auto;
}

.sidebar-brand-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2) 0;
}

.sidebar-group {
    padding: var(--space-3) 0;
}

.sidebar-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grey-400);
    margin: 0 0 var(--space-2) 0;
    padding: 0 var(--space-5);
}

.sidebar-empty {
    margin: 0;
    padding: 0 var(--space-5);
    font-size: 13px;
    color: var(--grey-300);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5) var(--space-2) calc(var(--space-5) - 3px);
    border-left: 3px solid transparent;
    color: rgb(200, 208, 219);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-link--active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    border-left-color: var(--coral-500);
}

.sidebar-link .icon {
    color: inherit;
}

/* Selector de idioma ES/EN, justo encima del usuario (i18n.js, I18N-1) */
.sidebar-lang {
    display: flex;
    gap: 2px;
    padding: 3px;
    margin: 0 var(--space-4) var(--space-3);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    flex: none;
}

.sidebar-lang-option {
    flex: 1;
    height: 28px;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: rgb(200, 208, 219);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-lang-option:hover {
    color: #fff;
}

.sidebar-lang-option[aria-checked="true"] {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 700;
}

.sidebar-lang-option:focus-visible {
    outline: 2px solid var(--coral-500);
    outline-offset: 1px;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex: none;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--coral-500);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: none;
}

.sidebar-user {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 11px;
    color: var(--grey-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgb(200, 208, 219);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-logout:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Toggle (solo <900px, ver media query) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--grey-800);
    border: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.sidebar-toggle .hamburger-line {
    width: 20px;
    height: 2px;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(22, 25, 36, 0.4);
    z-index: 900;
}

.sidebar-backdrop--open {
    display: block;
}

body.sidebar-active {
    padding-left: 248px;
}

@media (max-width: 899px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar--open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    body.sidebar-active {
        padding-left: 0;
        padding-top: 56px;
    }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}
.menu-overlay.active {
    display: block;
}
.menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0,0,0,0.12);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s;
    padding: 32px 20px 20px 20px;
    display: flex;
    flex-direction: column;
}
.menu-content.active {
    transform: translateX(0);
}
.menu-content h2 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
}
.menu-content ul {
    list-style: none;
    padding: 0;
    margin: 24px 0 0 0;
}
.menu-content ul li {
    margin-bottom: 18px;
}
.menu-content ul li a {
    color: #1976d2;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.2s;
}
.menu-content ul li a:hover {
    color: #1565c0;
}
.menu-close {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 1.5em;
    color: #888;
    cursor: pointer;
    background: none;
    border: none;
}


.logo-image {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.data-logo {
    height: clamp(30px, 5vw, 40px);
    width: auto;
    object-fit: contain;
    margin-left: clamp(8px, 2vw, 15px);
    opacity: 0.8;
    transition: var(--transition);
}

.data-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.language-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.language-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59,104,255, 0.1);
}

.auth-button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.5rem 0 0 0;
}

.user-avatar-header {
  max-width: 50px;
  max-height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  overflow: hidden;
}

.user-header {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* Espacio entre avatar y detalles */
}
.user-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1rem;
}




/* Main Content */
.main-content {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones */
.btn {
    display: block;
    box-sizing: border-box;
    margin-top: auto;
    font-family: 'Asap', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 16px;
    background-color: rgb(247,59,59);
    text-decoration: none;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    color: white;
    border: none;
    text-align: center;
    text-transform: none;
    cursor: pointer;
    transition: var(--transition);

}

button {
    font-family: 'Asap', sans-serif;
}

.btn:hover {
    background-color: rgb(218,0,0);
    transform: translateY(-1px);
}

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

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {

    .main-content {
        padding: 1rem;
    }

}

/* ==========================================
   FULL RESPONSIVE SYSTEM
   ========================================== */

/* Base responsive utilities */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive typography */
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
h4 { font-size: clamp(1rem, 2.5vw, 1.25rem); }
h5 { font-size: clamp(0.9rem, 2vw, 1.1rem); }
h6 { font-size: clamp(0.8rem, 1.8vw, 1rem); }
p { font-size: clamp(0.9rem, 1.8vw, 1rem); }

/* Responsive spacing utilities */
.p-responsive { padding: clamp(1rem, 3vw, 2rem); }
.m-responsive { margin: clamp(1rem, 3vw, 2rem); }
.gap-responsive { gap: clamp(0.5rem, 2vw, 1.5rem); }

/* ==========================================
   TABLET LANDSCAPE (1024px - 1366px)
   ========================================== */
@media (max-width: 1366px) and (min-width: 1025px) {


    .main-content {
        padding: 1.5rem;
    }

    .logo {
        gap: 0.6rem;
    }
}

/* ==========================================
   TABLET PORTRAIT & LANDSCAPE (768px - 1024px)
   ========================================== */
@media (max-width: 1024px) {



    .main-content {
        padding: 1rem;
    }

    /* Navigation responsive */
    .nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow-medium);
        padding: 1rem;
        z-index: 999;
    }

    .nav-menu.active {
        display: block;
    }
}


/* ==========================================
   MOBILE LARGE (480px - 767px)
   ========================================== */
@media (max-width: 767px) {
    .user-header {
        display: none;
    }



    .main-content {
        padding: 0.75rem;
    }

    /* Hide complex elements on small screens */
    .data-logo {
        display: none;
    }
}

/* ==========================================
   MOBILE STANDARD (360px - 479px)
   ========================================== */
@media (max-width: 479px) {




    .main-content {
        padding: 0.5rem;
    }

    /* Ultra compact layout */
    .container {
        padding: 0 0.5rem;
    }
}

/* ==========================================
   MOBILE SMALL (320px - 359px)
   ========================================== */
@media (max-width: 359px) {


    .main-content {
        padding: 0.25rem;
    }

    .container {
        padding: 0 0.25rem;
    }

    /* Minimize everything */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1rem !important; }
    p { font-size: 0.85rem !important; }
}

/* ==========================================
   LANDSCAPE MOBILE (orientation specific)
   ========================================== */
@media (max-height: 600px) and (orientation: landscape) {


    .main-content {
        padding: 0.5rem 1rem;
    }
}

/* ==========================================
   ULTRA WIDE SCREENS (1400px+)
   ========================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }



    .main-content {
        padding: 2.5rem;
    }
}

/* ==========================================
   4K AND ULTRA HIGH RESOLUTION (1920px+)
   ========================================== */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }



    .main-content {
        padding: 3rem;
    }

    /* Scale up typography for large screens */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }
    p { font-size: 1.1rem; }
}

/* ==========================================
   LOGIN FORM STYLES
   ========================================== */
.login-form {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.email-login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-login-form h3 {
    margin: 0 0 15px 0;
    text-align: center;
    color: rgb(19,25,34);
}

.email-login-form input {
    padding: 12px 15px;
    border: 1px solid rgb(213,220,230);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.email-login-form input:focus {
    outline: none;
    border-color: rgb(247,59,59);
    box-shadow: 0 0 0 3px rgba(247, 59, 59, 0.1);
}

.btn-email-login {
    padding: 12px 20px;
    background: rgb(247,59,59);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-email-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 59, 59, 0.4);
}

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

.login-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.login-separator::before,
.login-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgb(213,220,230);
}

.login-separator::before {
    left: 0;
}

.login-separator::after {
    right: 0;
}

.login-separator span {
    background: white;
    padding: 0 15px;
    color: rgb(147,155,167);
    font-size: 14px;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* =================================================================
   WIZARD STYLES - Automatización de Reportes
   ================================================================= */

/* Wizard Container */
.wizard-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.step.active .step-number {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(59,104,255, 0.3);
}

.step.completed .step-number {
    background: var(--success-green);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    color: var(--gray-700);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary-blue);
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 1rem;
    align-self: flex-start;
    margin-top: 24px;
}

/* Wizard Content */
.wizard-content {
    min-height: 400px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-step h2 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--gray-700);
    margin-bottom: 2rem;
}

/* Frequency Options */
.frequency-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.frequency-option {
    cursor: pointer;
}

.frequency-option input[type="radio"] {
    display: none;
}

.option-card {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    height: 100%;
}

.frequency-option input[type="radio"]:checked + .option-card {
    border-color: var(--primary-blue);
    background: rgba(59,104,255, 0.05);
}

.option-card:hover {
    border-color: var(--primary-blue-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.option-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.option-description {
    font-size: 0.85rem;
    color: var(--gray-700);
}

/* Search Container */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59,104,255, 0.1);
}

/* Results Container */
.results-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.result-item {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.result-item:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-info {
    flex: 1;
}

.result-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.result-subtitle {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.btn-select {
    padding: 0.5rem 1.5rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-select:hover {
    background: var(--primary-blue-light);
    transform: translateY(-1px);
}

/* Selected Item */
.selected-item {
    background: var(--success-green);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 500;
}

/* Checkbox List */
.checkbox-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--gray-50);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* KPIs Grid */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.kpi-category {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1.25rem;
}

.kpi-category h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.kpi-category label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.kpi-category label:hover {
    background: white;
}

.kpi-category input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Selection Count */
.selection-count {
    background: var(--primary-blue);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}

.selection-count span {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Wizard Navigation */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.nav-spacer {
    flex: 1;
}

/* Saved Reports Section */
.saved-reports-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.section-toggle {
    width: 100%;
    padding: 1.5rem;
    background: var(--gray-50);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    transition: background 0.2s;
}

.section-toggle:hover {
    background: var(--gray-100);
}

.toggle-icon {
    transition: transform 0.3s;
}

.section-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.saved-reports-content {
    padding: 1.5rem;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .step-indicator {
        padding: 0;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .frequency-options {
        grid-template-columns: 1fr;
    }

    .kpis-grid {
        grid-template-columns: 1fr;
    }

    .search-container {
        flex-direction: column;
    }
}

/* ==========================================================================
   Login Gate (pantalla de login a pantalla completa)
   ========================================================================== */

.login-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16224f 0%, #101E4C 45%, #0a1230 100%);
}

.login-gate.is-visible {
    display: flex;
}

.login-gate-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 20px;
}

.login-gate-logo {
    width: 88px;
    max-width: 30vw;
    height: auto;
}

.login-gate-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: -16px;
}

.login-gate-title-brand {
    font-family: 'Asap', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffffff;
}

.login-gate-title-product {
    font-family: 'Asap', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #9aa5c9;
}

.login-gate-button {
    min-width: 200px;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    background-color: #E35000;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.login-gate-button:hover:not(:disabled) {
    background-color: #c94600;
}

.login-gate-button:active:not(:disabled) {
    transform: scale(0.98);
}

.login-gate-button:disabled {
    opacity: 0.7;
    cursor: default;
}

/* ── Solicitar acceso (js/access-request.js) ──────────────────────────────── */
/* En la pantalla "No tienes acceso" (route-protection.js) y en la portada vacía. */
#rpNoAccessTitle:focus {
    outline: none;
}

.rq-slot {
    width: 100%;
    margin: 0 0 20px;
    text-align: left;
}

.rq-slot:empty {
    display: none;
}

.rq-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rq-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-700);
}

.rq-optional {
    font-weight: 400;
    color: var(--grey-600);
}

.rq-select,
.rq-note {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-ui, rgb(213, 220, 230));
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--grey-700);
    background: #fff;
}

.rq-note {
    resize: vertical;
    min-height: 72px;
}

.rq-select:focus,
.rq-note:focus {
    outline: none;
    border-color: var(--grey-700);
}

.rq-error {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--coral-600, rgb(218, 0, 0));
}

.rq-error:empty {
    display: none;
}

.rq-submit {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 4px 0 0;
}

.rq-sent {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--green-100, rgb(206, 241, 233));
    color: var(--grey-700);
    font-size: 13px;
    line-height: 1.4;
}

.rq-sent-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: rgb(0, 110, 83);
}

.rq-sent-list {
    margin: 0 0 6px;
    padding-left: 18px;
}

.rq-hint {
    margin: 0;
    color: var(--grey-600);
}
