/* --- IMPORT DE FUENTES --- */
@import url('fonts.css');

/* --- VARIABLES CSS --- */
:root {
    --fresh-white: #FFFFFF;
    --always-red: #C8102E;
    --warm-red: #7C1525;
    --text-primary: #2D2D2D;
    --text-secondary: #666666;
    --text-muted: #999999;
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --bg-accent: #F5F5F5;
    --border-light: #E8E8E8;
    --border-medium: #DDDDDD;
    --success-color: #28A745;
    --warning-color: #FFC107;
    --critical-color: var(--always-red);
    
    --shadow-sm: 0 1px 3px rgba(45, 45, 45, 0.1);
    --shadow-md: 0 4px 12px rgba(45, 45, 45, 0.15);
    --shadow-lg: 0 8px 24px rgba(45, 45, 45, 0.2);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --sidebar-width: 320px;
    --header-height: 70px;
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET Y BASE --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    font-weight: var(--font-weight-regular);
    overflow-x: hidden;
}

/* Responsive image for mobile */
.placeholder-content img[src*="iconorestaurante.png"] {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 768px) {
    .placeholder-content img[src*="iconorestaurante.png"] {
        width: 280px !important;
        height: auto !important;
    }
}

@media screen and (max-width: 480px) {
    .placeholder-content img[src*="iconorestaurante.png"] {
        width: 200px !important;
        height: auto !important;
    }
}

/* --- HEADER PRINCIPAL --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.system-title {
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    margin: 0;
    letter-spacing: -0.3px;
    transform: translateY(3px);
}

.header-center {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-accent);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.current-time {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--always-red);
}

.time-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 12px;
}

.time-edit-btn:hover {
    background: var(--border-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-action-btn {
    background: var(--always-red);
    color: var(--fresh-white);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center; /* Center text vertically and horizontally */
    gap: 6px;
    text-decoration: none;
    height: 36px; /* Match logout button height */
    min-height: 36px;
}

.header-action-btn:hover {
    background: var(--warm-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.header-action-btn.admin-btn {
    background: #dc3545;
    font-weight: var(--font-weight-semibold);
    margin-right: 10px;
    text-decoration: none;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1;
    height: 36px;
    min-height: 36px;
    padding: 8px 15px;
    vertical-align: middle;
}

.header-action-btn.admin-btn,
.header-action-btn.admin-btn * {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

.header-action-btn.admin-btn:hover {
    background: #c82333;
    text-decoration: none;
}

/* Botón de Historial - Centrado vertical igual que admin */
.header-action-btn[href="/history"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1;
    height: 36px;
    min-height: 36px;
    padding: 8px 15px;
    vertical-align: middle;
}

.header-action-btn[href="/history"],
.header-action-btn[href="/history"] * {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

/* --- LAYOUT PRINCIPAL --- */
.main-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    z-index: 100;
    transition: var(--transition-medium);
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 16px;
    right: -40px;
    width: 32px;
    height: 32px;
    background: var(--always-red);
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    z-index: 101;
}

.hamburger {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--fresh-white);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 16px;
    height: 2px;
    background: var(--fresh-white);
    position: absolute;
    transition: var(--transition-fast);
}

.hamburger::before { top: -5px; }
.hamburger::after { top: 5px; }

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 24px; /* Added gap */
}

/* --- PROGRESS INDICATOR --- */
.setup-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* margin-bottom: 24px; */ /* Removed margin */
    padding: 20px;
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 32px;
    width: 2px;
    height: 16px;
    background: var(--border-medium);
}

.progress-step.active:not(:last-child)::after {
    background: var(--always-red);
}

.step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--border-medium);
    color: var(--fresh-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    transition: var(--transition-fast);
    z-index: 1;
}

.progress-step.active .step-number {
    background: var(--always-red);
}

.progress-step.auto-completed .step-number {
    background: var(--success-color);
}

.progress-step.auto-completed .step-number::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    color: var(--fresh-white);
}

.progress-step.auto-completed span {
    color: var(--success-color);
    font-weight: var(--font-weight-semibold);
}

.progress-step span {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

.progress-step.active span {
    color: var(--text-primary);
}

/* --- FORMULARIOS --- */
.config-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-select,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-input[readonly] {
    background-color: var(--bg-accent);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-input-static {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    background: var(--bg-accent);
    color: var(--text-secondary);
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-input-static [data-lucide] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.stock-duration-display {
    background-color: var(--bg-accent);
    color: var(--text-secondary);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.stock-duration-display [data-lucide] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--always-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C8102E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* --- CHECKBOXES MEJORADOS --- */
.checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.checkbox-item:hover {
    background: var(--bg-primary);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition-fast);
}

.checkbox-item input:checked + .checkmark {
    background: var(--always-red);
    border-color: var(--always-red);
}

.checkbox-item input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--fresh-white);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
}

.checkbox-label {
    font-size: 13px;
    font-weight: var(--font-weight-regular);
    color: var(--text-primary);
}

/* --- COLLAPSIBLE --- */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition-fast);
}

.collapsible-header:hover {
    color: var(--always-red);
}

.expand-icon {
    transition: var(--transition-medium);
    color: var(--always-red);
    font-weight: var(--font-weight-bold);
    margin-left: 8px;
    align-self: baseline;
    line-height: 1;
}

.collapsible-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    margin-top: 8px;
}

.collapsible-content.expanded {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* --- ADJUSTMENT CONTROLS --- */
.adjustment-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adjustment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adjustment-item label {
    font-size: 14px;
    font-weight: var(--font-weight-regular);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.adjustment-item label i {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
}

/* New styles for enhanced UI */
.header-with-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subtle-info {
    font-size: 11px;
    color: rgba(102, 102, 102, 0.7);
    font-weight: 300;
    letter-spacing: 0.3px;
    margin-top: -2px;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 80px;
}

.input-with-unit.wider-input {
    width: 96px;
}

.input-with-unit input {
    border: none;
    background: none;
    padding: 8px 12px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    width: 50px;
}

.input-with-unit input:focus {
    outline: none;
}

.input-with-unit:focus-within {
    border-color: var(--always-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.unit {
    padding: 8px 8px 8px 0;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

/* Disabled input styling for adjustment controls */
.adjustment-controls .adjustment-item input:disabled {
    background-color: #f8f8f8;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
    opacity: 0.6;
}

.adjustment-controls .adjustment-item input:disabled::placeholder {
    color: #ccc;
}

.adjustment-controls .adjustment-item .input-with-unit:has(input:disabled) {
    background-color: #f8f8f8;
    border-color: #e0e0e0;
    opacity: 0.6;
}

.adjustment-controls .adjustment-item:has(input:disabled) label {
    color: #999;
    opacity: 0.6;
}

.adjustment-controls .adjustment-item:has(input:disabled) .unit {
    color: #999;
    opacity: 0.6;
}

.adjustment-controls .adjustment-item:has(input:disabled) label i {
    color: #ccc;
    opacity: 0.6;
}

/* --- SIDEBAR FOOTER --- */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding-bottom: 24px;
}

.primary-action-btn {
    width: 100%;
    background: var(--always-red);
    color: var(--fresh-white);
    border: none;
    height: 52px; /* Equal height for button and link */
    padding: 0 24px; /* Vertical padding handled by fixed height */
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-semibold);
    font-size: 15px;
    line-height: 1; /* Avoid extra vertical space */
    cursor: pointer;
    transition: var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    letter-spacing: -0.2px;
    text-decoration: none; /* Ensure links are not underlined */
}

.primary-action-btn:hover {
    background: var(--warm-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Responsive utility classes */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

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

.primary-action-btn:disabled {
    background: var(--border-medium);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-icon {
    font-size: 16px;
}

/* Normalize Lucide icon size within primary action buttons */
.primary-action-btn .btn-icon [data-lucide] {
    width: 18px;
    height: 18px;
}

/* Sidebar history button spacing */
.history-btn {
    margin-top: 12px;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    background: var(--bg-secondary);
    min-height: calc(100vh - var(--header-height));
    display: flex; /* Added */
    flex-direction: column; /* Added */
    justify-content: flex-start;
}

/* --- KPI SECTION REMOVIDA --- */
.kpi-section {
    display: none !important;
}

/* --- RESUMEN VISUAL DE PRODUCCIÓN - ESTILO JONATHAN IVE --- */
.production-summary {
    background: var(--fresh-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin: 24px 0 32px 0;
}

/* Header minimalista con diseño Jonathan Ive */
.summary-header {
    padding: 28px 32px 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.95));
    backdrop-filter: blur(10px);
    position: relative;
}

.summary-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.08), transparent);
}

.summary-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.summary-subtitle {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
    margin: 4px 0 0 0;
    letter-spacing: -0.01em;
}

/* Acciones del summary (alineadas a la derecha) */
.summary-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hours-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-accent);
    border: 1px solid var(--border-light);
    padding: 6px 10px;
    border-radius: var(--radius-md);
}

.hours-label {
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

.hours-input {
    width: 64px;
    height: 30px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.hours-input:focus {
    outline: none;
    border-color: var(--always-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.summary-subtitle {
    display: none; /* Ocultar para diseño minimalista */
}

.summary-total {
    text-align: right;
}

.summary-total-value {
    font-family: var(--font-family);
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    letter-spacing: -0.5px;
    margin: 0;
}

.summary-total-label {
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}

/* Grid de productos - Estilo minimalista con categorías */
.summary-grid {
    padding: 28px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Category Groups - Jonathan Ive Design */
.category-group {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.1), transparent);
}

.category-group:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.category-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.category-count {
    font-size: 14px;
    color: #6c757d;
    background: rgba(200, 16, 46, 0.08);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.category-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Cada item de producto */
.summary-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(253, 253, 253, 0.9));
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 220px;
    backdrop-filter: blur(10px);
}

.summary-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.1),
        0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(200, 16, 46, 0.15);
}

.summary-item:active {
    transform: translateY(-1px) scale(1.01);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-item.critical {
    border-color: rgba(220, 53, 69, 0.2);
    background: linear-gradient(145deg, rgba(255, 245, 245, 0.95), rgba(254, 242, 242, 0.9));
    box-shadow:
        0 6px 24px rgba(220, 53, 69, 0.08),
        0 2px 6px rgba(220, 53, 69, 0.04);
}

.summary-item.critical:hover {
    border-color: rgba(220, 53, 69, 0.3);
    box-shadow:
        0 12px 40px rgba(220, 53, 69, 0.12),
        0 6px 12px rgba(220, 53, 69, 0.08);
}

.summary-item.warning {
    border-color: rgba(255, 193, 7, 0.2);
    background: linear-gradient(145deg, rgba(255, 251, 240, 0.95), rgba(254, 249, 231, 0.9));
    box-shadow:
        0 6px 24px rgba(255, 193, 7, 0.08),
        0 2px 6px rgba(255, 193, 7, 0.04);
}

.summary-item.warning:hover {
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow:
        0 12px 40px rgba(255, 193, 7, 0.12),
        0 6px 12px rgba(255, 193, 7, 0.08);
}

.summary-item.ok {
    border-color: rgba(40, 167, 69, 0.2);
    background: linear-gradient(145deg, rgba(240, 249, 240, 0.95), rgba(232, 245, 232, 0.9));
    box-shadow:
        0 6px 24px rgba(40, 167, 69, 0.08),
        0 2px 6px rgba(40, 167, 69, 0.04);
}

.summary-item.ok:hover {
    border-color: rgba(40, 167, 69, 0.3);
    box-shadow:
        0 12px 40px rgba(40, 167, 69, 0.12),
        0 6px 12px rgba(40, 167, 69, 0.08);
}

/* Barra de estado sutil */
.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--always-red);
    opacity: 0.6;
}

.summary-item.warning::before {
    background: var(--warning-color);
}

.summary-item.ok::before {
    background: var(--success-color);
}

/* Nombre del producto */
.summary-item-name {
    font-size: 15px;
    font-weight: var(--font-weight-regular);
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

/* Período de tiempo del artículo */
.article-period {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-period-icon {
    font-size: 10px;
    opacity: 0.8;
}

/* Valor numérico principal */
.summary-item-value {
    font-family: var(--font-family);
    font-size: 36px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    letter-spacing: -0.8px;
    line-height: 1;
    margin-bottom: 2px;
}

/* Etiqueta "UNIDADES" */
.summary-item-label {
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Información de quiebre de stock */
.summary-item-stockout {
    font-size: 11px;
    font-weight: var(--font-weight-regular);
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-item-stockout.critical {
    color: var(--critical-color);
    font-weight: var(--font-weight-semibold);
}

.summary-item-stockout.warning {
    color: var(--warning-color);
    font-weight: var(--font-weight-semibold);
}

.summary-item-stockout.ok {
    color: var(--success-color);
}

.stockout-icon {
    font-size: 10px;
}

/* Estilo para la imagen del artículo */
.summary-item-image {
    width: 100%;
    max-width: 120px; /* Tamaño contenido para no dominar la tarjeta */
    height: 120px;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin distorsionarse */
    margin-bottom: 16px;
    background-color: transparent; /* Sin fondo para mostrar transparencia de las imágenes */
}

/* Placeholder para cuando no hay imagen */
.summary-item-image-placeholder {
    width: 100%;
    max-width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    background-color: var(--bg-accent); /* Gris claro */
    border: 1px solid var(--border-light); /* Borde sutil */
}

/* Elementos obsoletos - ocultar */
.summary-item-icon,
.summary-item-details,
.summary-prep-time,
.summary-stock {
    display: none !important;
}

/* Estilo para las horas pico */
.summary-item-peakhours {
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    color: var(--always-red);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    width: 100%;
    text-align: center;
}

.summary-item-peakhours span {
    font-weight: var(--font-weight-regular);
    color: var(--text-secondary);
}



/* Estado vacío */
.summary-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
}

.summary-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.summary-empty-text {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.summary-empty-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-regular);
}

/* Animaciones de entrada */
.summary-item.entering {
    animation: itemEnter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translateY(12px);
}

@keyframes itemEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MAIN TABS INTERFACE --- */
.main-tabs {
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    background: var(--bg-accent);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 0 -32px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: var(--font-weight-semibold);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(200, 16, 46, 0.05);
    color: var(--always-red);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--always-red);
    border-bottom-color: var(--always-red);
    box-shadow: 0 -2px 8px rgba(200, 16, 46, 0.1);
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn span {
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.2px;
}

/* --- TAB CONTENT --- */
#tab-content-container {
    display: block;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: tabFadeIn 0.3s ease;
}

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

/* --- CONSTRUCTION CONTENT --- */
.construction-content {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: hidden;
    text-align: center;
    padding: 24px 0;
}

.construction-header {
    padding: 0 0 32px 0;
    background: transparent;
    border: none;
}

.construction-header h2 {
    font-size: 24px;
    font-weight: var(--font-weight-semibold);
    color: var(--always-red);
    margin: 0;
    letter-spacing: -0.4px;
    line-height: 1.3;
}

.construction-image-container {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.construction-image {
    max-width: 400px;
    width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.construction-image:hover {
    transform: none;
    box-shadow: none;
}

/* --- VIEW CONTROLS (within Articulos tab) --- */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--bg-primary);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.view-toggle {
    display: flex;
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-light);
}

.view-btn {
    background: transparent;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--bg-primary);
    color: var(--always-red);
    box-shadow: var(--shadow-sm);
}

.view-btn:hover:not(.active) {
    color: var(--text-primary);
}

.view-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.action-btn:hover {
    border-color: var(--always-red);
    color: var(--always-red);
}

.action-btn.secondary {
    background: var(--bg-accent);
}

.action-btn.refreshing {
    background: var(--success-color);
    color: var(--fresh-white);
    border-color: var(--success-color);
}

/* --- RESTAURANT SELECTION IMAGE --- */
.restaurant-selection-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin: 24px 0;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.restaurant-selection-image {
    width: 500px;
    height: 500px;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-medium);
}

.restaurant-selection-image:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* --- PLACEHOLDER CONTENT (ELEGANT & COMPACT) --- */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 10px 40px;
    border: 1px solid var(--border-light);
    margin: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%; /* Added */
    justify-content: flex-start;
}

.placeholder-icon {
    color: var(--always-red);
    margin-bottom: 16px;
}

.placeholder-content h3 {
    font-family: 'Sofia Pro', sans-serif;
    font-size: 36px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -1px;
    line-height: 1.2;
}

.placeholder-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    max-width: 500px;
    line-height: 1.6;
}

.placeholder-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    width: 100%;
    max-width: 450px;
    margin-bottom: 30px;
}

.step-item {
    font-size: 14px;
    color: var(--text-secondary);
    background-color: transparent;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease-in-out;
    font-weight: var(--font-weight-regular);
}

.step-item:first-child {
    border-top: 1px solid var(--border-light);
}

.step-item:hover {
    color: var(--always-red);
    border-color: var(--always-red);
}

.placeholder-main-image {
    max-width: 300px;
    height: auto;
    margin-top: 20px;
}

.step-item.completed {
    color: var(--success-color);
    border-color: var(--success-color);
    font-weight: var(--font-weight-semibold);
}

.step-item.active {
    color: var(--always-red);
    border-color: var(--always-red);
    font-weight: var(--font-weight-semibold);
}

/* Help text styling for single restaurant users */
.help-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 20px;
    padding: 12px;
    background-color: var(--bg-accent, #f8f9fa);
    border-left: 3px solid var(--always-red);
    border-radius: 4px;
    font-style: italic;
}

/* --- LOADING STATE --- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin: 0;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    height: 100%; /* Added */
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--always-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.loading-state h3 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.loading-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--always-red);
    width: 0%;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* --- DATA VIEWS --- */
.data-view {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dashboard-header,
.detailed-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h2,
.detailed-header h2 {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.dashboard-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.filter-btn.active {
    background: var(--always-red);
    color: var(--fresh-white);
    border-color: var(--always-red);
}

.filter-btn:hover:not(.active) {
    border-color: var(--always-red);
    color: var(--always-red);
}

.detailed-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-regular);
}

/* --- PRODUCTION TABLE --- */
.dashboard-table-container,
.detailed-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.production-table,
.detailed-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.production-table th,
.production-table td,
.detailed-table th,
.detailed-table td {
    padding: 16px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.production-table th,
.detailed-table th {
    background: var(--bg-accent);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
    letter-spacing: -0.1px;
    font-size: 12px;
    text-transform: uppercase;
}

.production-table tbody tr,
.detailed-table tbody tr {
    transition: var(--transition-fast);
}

.production-table tbody tr:hover,
.detailed-table tbody tr:hover {
    background: var(--bg-accent);
}

.col-article {
    min-width: 140px;
    font-weight: var(--font-weight-semibold);
}

.col-article .article-period {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
}

.col-forecast,
.col-stock,
.col-produce {
    text-align: center;
    min-width: 100px;
    font-weight: var(--font-weight-semibold);
}

.col-time {
    text-align: center;
    min-width: 80px;
    color: var(--text-secondary);
}

.col-status {
    text-align: center;
    min-width: 100px;
}

/* --- STATUS INDICATORS --- */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-critical {
    background: rgba(200, 16, 46, 0.1);
    color: var(--critical-color);
}

.status-ok {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

/* Reduce font size for "sin demanda" text by 50% */
.status-badge.sin-demanda-text {
    font-size: 0.5em;
}

/* --- STOCK INPUTS --- */
.stock-input {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    font-size: 12px;
    background: var(--bg-primary);
    transition: var(--transition-fast);
}

.stock-input:focus {
    outline: none;
    border-color: var(--always-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* --- PRODUCE VALUES --- */
.produce-value {
    font-weight: var(--font-weight-bold);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.produce-critical {
    color: var(--critical-color);
    background: rgba(200, 16, 46, 0.1);
}

.produce-ok {
    color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-primary);
    margin: 5% auto;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: modalSlideIn 0.3s ease;
}

/* Media queries para modales en escritorio */
@media (min-width: 768px) {
    .modal-content {
        width: 80%;
        max-width: 90%;
        margin: 3% auto;
    }
}

@media (min-width: 1024px) {
    .modal-content {
        width: 65%;
        max-width: 750px;
        margin: 2% auto;
    }
}

@media (min-width: 1440px) {
    .modal-content {
        width: 55%;
        max-width: 700px;
    }
}

/* Responsive: centrar y compactar modal en pantallas pequeñas */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 0 auto;            /* centrar horizontal */
        position: relative;
        top: 50%;
        transform: translateY(-50%); /* centrar vertical dentro del viewport */
        border-radius: var(--radius-lg);
    }
    .ive-modal-header {
        padding: 12px 14px 8px 14px;
    }
    .ive-header-content h2 {
        font-size: 16px;
    }
    .ive-subtitle {
        font-size: 12px;
    }
    .ive-header-meta { gap: 6px; }
    .ive-chip { font-size: 11px; padding: 3px 8px; }
    .ive-modal-body { padding: 10px 14px 4px 14px; }
    .ive-motivo-row { padding: 6px; gap: 6px; }
    .ive-motivo-icon { width: 24px; height: 24px; }
    .ive-motivo-details h4 { font-size: 12px; }
    .ive-motivo-details p { font-size: 10px; }
    .ive-total-value { font-size: 12px; min-width: 60px; padding: 5px 8px; }
    .ive-adjustment-input { font-size: 12px; width: 70px; padding: 5px 8px; }
    .ive-inline-label { font-size: 10px; }
    .ive-btn { font-size: 13px; padding: 8px 14px; }
    .ive-modal-footer { padding: 10px 14px; margin-top: 4px; }
}

@media (max-width: 480px) {
    .modal-content {
        width: 96%;
        max-width: 96%;
        border-radius: var(--radius-md);
    }
    .ive-header-content h2 { font-size: 15px; }
    .ive-subtitle { font-size: 11px; }
    .ive-chip { font-size: 10px; padding: 3px 6px; }
    .ive-total-value { font-size: 11px; min-width: 56px; padding: 4px 6px; }
    .ive-adjustment-input { font-size: 11px; width: 64px; padding: 4px 6px; }
    .ive-btn { font-size: 12px; padding: 7px 12px; }
    .ive-modal-footer { padding: 8px 12px; }
}

/* Estilos específicos para el modal de pronóstico IVE */
.ive-modal {
    max-height: 90vh !important;
    overflow-y: auto !important;
}

.ive-modal-header {
    padding: 20px 24px 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, var(--always-red) 0%, var(--warm-red) 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    /* Fix Safari mobile blur issue */
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
    z-index: 1003;
}

.ive-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    /* Safari mobile fix - disable on small screens */
}

@media (max-width: 768px) {
    .ive-modal-header::before {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.02);
    }
}

.ive-header-content {
    position: relative;
    z-index: 1;
    flex: 1;
}

.ive-header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ive-item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background-color: #EDDDCD;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.ive-title-content {
    flex: 1;
}

.ive-header-content h2 {
    margin: 0;
    font-size: 19px;
    font-weight: var(--font-weight-bold);
    color: var(--fresh-white);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.ive-subtitle {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.1px;
}

/* Meta compacto en header (chips estilo Ive) */
.ive-header-meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ive-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
}

.ive-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-medium);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.ive-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--fresh-white);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ive-modal-body {
    padding: 12px 20px 8px 20px; /* ajustado el padding inferior */
    flex: 1;
    overflow-y: auto;
}

.ive-modal-footer {
    padding: 8px 20px 12px 20px;
    display: flex;
    justify-content: space-between; /* izquierda (detalle por horas) y derecha (acciones) */
    align-items: center;
    border-top: 1px solid var(--border-light);
    margin-top: 0px; /* eliminado el margen superior para acercar más */
    flex-shrink: 0;
    flex-wrap: nowrap; /* evitar que salte de línea */
}

.ive-footer-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex: 0 0 auto; /* no crecer, no encoger */
}

.ive-footer-right {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex: 0 0 auto; /* no crecer, no encoger */
    flex-wrap: nowrap; /* mantener en la misma fila */
    white-space: nowrap;
}

.ive-btn {
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-medium);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.2px;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.ive-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.ive-btn:hover::before {
    left: 100%;
}

.ive-btn-primary {
    background: var(--always-red);
    color: var(--fresh-white);
}

.ive-btn-primary:hover {
    background: var(--warm-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.ive-btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--border-medium);
}

/* Estilos para el contenido del modal de pronóstico */
.ive-motivos-container {
    display: flex;
    flex-direction: column;
    gap: 6px; /* más compacto */
}

.ive-motivo-row {
    display: flex;
    align-items: center;
    gap: 8px; /* más compacto */
    padding: 8px; /* más compacto */
    background: var(--bg-accent);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* Filas de solo lectura (más sutiles) */
.ive-motivo-row.readonly {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.ive-motivo-row.readonly .ive-motivo-icon {
    background: var(--text-secondary);
}

.ive-motivo-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.ive-motivo-icon {
    width: 28px; /* más compacto */
    height: 28px; /* más compacto */
    background: var(--always-red);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fresh-white);
    flex-shrink: 0;
}

.ive-motivo-details h4 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.ive-motivo-details p {
    margin: 0;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.1px;
    line-height: 1.4;
}

.ive-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Etiquetas inline cortas para valores dobles */
.ive-inline-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.ive-total-value {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    min-width: 70px;
    font-size: 13px;
}

.ive-total-value.ive-neutral {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.ive-total-value.ive-positive {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.ive-adjustment-input {
    padding: 6px 10px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.ive-adjustment-input:focus {
    outline: none;
    border-color: var(--always-red);
    box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.1);
}

.ive-percentage-symbol {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Reducir tamaño del texto de duración del stock */
.ive-total-value#modal-stock-duration {
    font-size: 10px !important;
    padding: 4px 8px;
    line-height: 1.3;
}

/* Reducir tamaño del texto de stockout en el resumen */
.summary-item-stockout {
    font-size: 10px !important;
    line-height: 1.3;
    width: 80px;
    text-align: center;
}

.ive-adjustment-input:focus {
    outline: none;
    border-color: var(--always-red);
    box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.1);
}

.ive-percentage-symbol {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Fix for Safari mobile blur issue */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
    position: relative;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.98);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 24px 20px 24px;
}

.quick-time-options {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.quick-time-btn {
    background: var(--bg-accent);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.quick-time-btn:hover {
    border-color: var(--always-red);
    color: var(--always-red);
}

.modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: -8px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--always-red);
    color: var(--fresh-white);
}

.btn-primary:hover {
    background: var(--warm-red);
}

.btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--always-red);
    color: var(--always-red);
}

.btn-link {
    background: none;
    border: none;
    color: var(--always-red);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-link:hover {
    background: rgba(200, 16, 46, 0.1);
    text-decoration: underline;
}

#hourly-sales-chart-container {
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
}
.btn-link {
    background: none;
    border: none;
    color: var(--always-red);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-link:hover {
    background: rgba(200, 16, 46, 0.1);
    text-decoration: underline;
}

#hourly-sales-chart-container {
    min-height: 300px;
    max-height: 60vh;
    overflow-y: auto;
}


/* --- MOBILE SIDEBAR CONTEXT --- */
.sidebar-context {
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    display: none;
}

.context-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
}

.context-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
    padding-bottom: 16px;
}

.context-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.context-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.mobile-time .time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.mobile-admin .admin-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--always-red);
    color: var(--fresh-white);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
}

.mobile-actions {
    display: none; /* Hidden by default on desktop */
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    color: var(--always-red);
    border: 2px solid var(--border-light);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition-fast);
}

.mobile-action-btn:hover {
    border-color: var(--always-red);
    background: rgba(200, 16, 46, 0.05);
}

.mobile-action-btn.admin-btn-mobile {
    background: #dc3545;
    color: var(--fresh-white);
    border-color: #dc3545;
}

.mobile-action-btn.admin-btn-mobile:hover {
    background: #c82333;
    border-color: #c82333;
}

/* --- RESPONSIVE DESIGN --- */
@media screen and (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .system-title {
        font-size: 18px;
    }
    
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Change from 768px to 767px to avoid hamburger showing at exactly 768px */
@media screen and (max-width: 767px) {
    /* Safari mobile modal header blur fix */
    .modal-header,
    .ive-modal-header,
    .forecast-header {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
        will-change: transform;
        position: relative !important;
        z-index: 1003 !important;
    }
    
    .modal-header {
        background: rgba(255, 255, 255, 0.98) !important;
    }
    
    /* Specific fix for ive-modal-header content */
    .ive-header-content,
    .ive-header-title-row,
    .ive-title-content {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
        position: relative;
        z-index: 1004;
    }
    .desktop-only {
        display: none !important;
    }
    /* Hide desktop-only elements */
    
    /* Hide specific header elements in mobile */
    .header-action-btn.admin-btn,
    .auth-section .user-info.desktop-only,
    .mobile-action-btn.admin-btn-mobile {
        display: none !important;
    }
    
    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }
    
    /* Ensure mobile user button is visible */
    .mobile-only .user-icon-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .sidebar-context {
        display: block;
    }
    
    .mobile-actions {
        display: flex !important; /* Force show on mobile */
        padding: 16px 24px 24px 24px;
    }
    
    .main-header {
        padding: 0 16px;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .header-left {
        gap: 12px;
        flex-shrink: 0;
    }
    
    .header-center {
        flex-grow: 0;
        justify-content: flex-start;
        margin: 0 8px 0 0;
    }
    
    .header-logo {
        height: 32px;
    }
    
    .system-title {
        font-size: 16px;
    }
    
    /* Simplify header-right for mobile - remove margin-left auto */
    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }
    
    /* Make time display more compact in mobile */
    .time-display {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .current-time {
        font-size: 10px;
        font-weight: 600;
    }
    
    .time-edit-btn {
        font-size: 9px;
        padding: 2px;
    }
    
    .auth-section {
        margin-left: 8px;
    }
    
    .user-name {
        display: none; /* Hide user name in mobile header */
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .data-view,
    .view-controls {
        display: none !important;
    }
    
    .kpi-section {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .view-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .view-toggle {
        align-self: center;
    }
    
    .dashboard-header,
    .detailed-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .dashboard-filters {
        justify-content: center;
    }
    
    .production-table th,
    .production-table td {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .col-article {
        min-width: 120px;
    }
    
    .col-article .article-period {
        font-size: 10px;
        margin-top: 2px;
    }
    
    .col-forecast,
    .col-stock,
    .col-produce {
        min-width: 80px;
    }
    
    .modal-content {
        width: 95%;
        margin: 0 auto;             /* centrar horizontal */
        position: relative;
        top: 50%;
        transform: translateY(-50%); /* centrar vertical */
    }
    
    /* Responsive para resumen visual */
    .summary-header {
        padding: 20px 24px 16px 24px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .summary-actions {
        width: 100%;
        justify-content: center;
    }
    
    .summary-actions {
        width: 100%;
        justify-content: center;
    }

    .summary-grid {
        padding: 24px 24px 28px 24px;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* Responsive para imagen de selección de restaurante */
    .restaurant-selection-container {
        padding: 30px 20px;
        margin: 30px 0;
    }
    
    .restaurant-selection-image {
        width: 300px;
        height: 300px;
        max-width: 85%;
    }

    .summary-item {
        padding: 16px 14px;
    }


    .summary-item-name {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .summary-item-value {
        font-size: 28px;
    }
}


@media screen and (max-width: 480px) {
    .main-header {
        padding: 0 8px;
        gap: 8px;
    }
    
    .header-left {
        gap: 6px;
    }
    
    .header-center {
        margin: 0;
    }
    
    .header-logo {
        height: 28px;
    }
    
    .system-title {
        font-size: 14px;
    }
    
    .time-display {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .current-time {
        font-size: 10px;
    }
    
    .time-edit-btn {
        padding: 2px;
        font-size: 10px;
    }
    
    .user-icon-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .user-icon-btn i {
        width: 18px;
        height: 18px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .kpi-card {
        padding: 12px;
    }
    
    .kpi-value {
        font-size: 20px;
    }
    
    .kpi-label {
        font-size: 10px;
    }
    
    .production-table th,
    .production-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .stock-input {
        width: 50px;
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .sidebar-content {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) 16px;
    }
    
    .setup-progress {
        padding: 16px;
    }
    
    .primary-action-btn {
        height: 52px; /* Keep height consistent on small screens */
        padding: 0 20px; /* No vertical padding when height is fixed */
        font-size: 14px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px 20px 24px 20px;
    }

    .summary-item-value {
        font-size: 24px;
    }
    
    /* Responsive para imagen de selección de restaurante - móvil pequeño */
    .restaurant-selection-container {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .restaurant-selection-image {
        width: 250px;
        height: 250px;
        max-width: 80%;
    }
}

/* --- MOBILE SPECIFIC COMPONENTS --- */

/* Mobile datetime controls */

/* Mobile user menu */
.user-menu-container {
    position: relative;
    z-index: 100;
}

.user-icon-btn {
    background: var(--always-red) !important;
    color: var(--fresh-white) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all var(--transition-medium);
    box-shadow: 0 3px 10px rgba(200, 16, 46, 0.3) !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 101 !important;
}

.user-icon-btn:hover {
    background: var(--warm-red);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(200, 16, 46, 0.4);
}

.user-icon-btn i {
    width: 22px;
    height: 22px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 220px;
    z-index: 1000;
    display: none;
    animation: dropdownFadeIn 0.2s ease;
}

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

.user-dropdown.show {
    display: block;
}

.user-dropdown .user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
}

.user-dropdown .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
}

.user-dropdown .user-name {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    font-family: var(--font-family);
}

.user-dropdown .logout-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    background: var(--bg-accent);
    color: var(--always-red);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.user-dropdown .logout-btn:hover {
    background: var(--always-red);
    color: var(--fresh-white);
    border-color: var(--always-red);
}

/* Sidebar title for mobile */
.sidebar-title {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    margin-bottom: 20px;
    padding: 0 20px;
    text-align: center;
    font-family: var(--font-family);
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Mobile responsive adjustments for smaller screens */
@media screen and (max-width: 480px) {
    
    .user-icon-btn {
        width: 38px;
        height: 38px;
    }
    
    .user-icon-btn i {
        width: 20px;
        height: 20px;
    }
    
    .user-dropdown {
        min-width: 200px;
        padding: 12px;
    }
    
    .sidebar-title {
        font-size: 20px;
        padding: 0 15px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
}

/* --- Estilos de Autenticación --- */
.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

/* Base user-info style - horizontal layout by default */
.user-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
    color: #333;
    height: 100%;
}

/* Ensure all user-info instances maintain horizontal layout */
.auth-section .user-info,
.user-dropdown .user-info,
.context-item .user-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center; /* Center text vertically */
    line-height: 1;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content */
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #555;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    height: 36px; /* Consistent height */
    min-height: 36px;
}

.auth-btn:hover {
    background-color: #f7f7f7;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-panel-btn {
    gap: 10px;
    background-color: var(--always-red) !important;
    border-color: var(--always-red) !important;
    color: var(--fresh-white) !important;
}

.admin-panel-btn:hover {
    background-color: var(--warm-red) !important;
    border-color: var(--warm-red) !important;
    color: var(--fresh-white) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.admin-panel-btn i {
    width: 18px;
    height: 18px;
    color: var(--fresh-white);
}

.logout-btn {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.logout-btn:hover {
    background-color: #f4c2c7;
}

/* --- WEEK SELECTION VALIDATION STYLES --- */
.week-highlight-valid {
    background: rgba(22, 163, 74, 0.1) !important;
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2) !important;
}

.week-highlight-invalid {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.checkbox-item.week-highlight-valid .checkbox-label {
    color: var(--success-color) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.checkbox-item.week-highlight-invalid .checkbox-label {
    color: #ef4444 !important;
    font-weight: var(--font-weight-semibold) !important;
}

.week-validation-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md, 12px);
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    font-size: 14px;
    font-weight: var(--font-weight-regular);
    animation: fadeInError 0.3s ease-in-out;
}

.week-validation-error i {
    font-size: 16px;
    flex-shrink: 0;
}

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

/* --- New Styles for Summary Item Image --- */
.summary-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-item-image, .summary-item-image-placeholder {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-accent); /* Fallback color */
}

.summary-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.summary-item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: var(--spacing-lg);
}

.summary-item .summary-item-body {
    flex-grow: 1;
}

/* --- New Styles for Summary Item Image --- */
.summary-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-item-image {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: transparent; /* Sin fondo gris */
}

.summary-item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 16px; /* var(--spacing-lg) */
}

.summary-item .summary-item-body {
    flex-grow: 1;
}


/* --- PROCESS CATEGORIZATION STYLES --- */
.process-type-section {
    margin-bottom: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.process-type-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 16px 20px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-light);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.process-type-title i {
    font-size: 18px;
    color: var(--always-red);
}

.process-type-content {
    padding: 12px;
}

.process-type-content .checkbox-grid {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* Process container improvements */
.processes-container {
    max-height: none;
    overflow-y: visible;
}

#procesos-container {
    max-height: none;
    overflow-y: visible;
}

/* Enhanced checkbox items for process sections */
.process-type-content .checkbox-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.process-type-content .checkbox-item:hover {
    background: var(--bg-accent);
    border-color: var(--always-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.process-type-content .checkbox-item:last-child {
    margin-bottom: 0;
}

/* --- New Styles for index.html Redesign --- */

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h2 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-section p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    white-space: nowrap;
}

/* Mobile: Single column layout */
@media screen and (max-width: 768px) {
    .welcome-section p {
        white-space: normal;
        columns: 1;
        text-align: center;
    }
}

.main-feature-container {
    display: flex;
    align-items: center;
    gap: 40px;
    background-color: #EDDDCD;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.feature-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.feature-text-content h3 {
    font-size: 40px;
    font-weight: var(--font-weight-semibold);
    color: #5D0622;
    margin-bottom: 16px;
    line-height: 1.2;
}

.feature-text-content p {
    font-size: 18px;
    color: #3F2021;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.feature-tags {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
}

.feature-tag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
}

.tag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.feature-image-container {
    flex: 1;
    max-width: 50%;
}

.image-slideshow {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background-color: #EDDDCD;
}

.image-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    animation: elegant-ken-burns 40s infinite;
}

.image-slideshow .slide.active {
    opacity: 1;
}

@keyframes elegant-ken-burns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.1) translate(-5px, 5px);
    }
    100% {
        transform: scale(1) translate(0, 0);
    }
}

.simplified-process-section {
    width: 100%;
    text-align: center;
    margin-top: 0px;
}

.simplified-process-section h2 {
    font-size: 28px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 40px;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

/* Desktop: 2 columns layout for process steps */
@media (min-width: 769px) {
    .process-steps {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        max-width: 800px;
        margin: 0 auto;
    }
}

.process-step-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.step-number-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #90102D;
    color: var(--fresh-white);
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-text h4 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    margin: 0 0 4px 0;
}

.step-text p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .main-feature-container {
        flex-direction: column;
        padding: 24px;
        width: 100%; /* Ocupar todo el ancho en móvil */
    }

    .feature-text-content h3 {
        font-size: 28px; /* Reducir tamaño de fuente del título */
    }

    .feature-text-content p {
        font-size: 16px; /* Reducir tamaño de fuente del párrafo */
    }

    .feature-tags {
        flex-direction: column;
        align-items: center;
    }

    .feature-image-container {
        max-width: 100%;
        width: 100%;
    }

    .process-steps {
        padding: 0 16px;
    }
}

/* --- FORECAST MODAL STYLES (Jonathan Ive Design) --- */
.forecast-modal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.forecast-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.2), transparent);
}

.forecast-header {
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    /* Fix Safari mobile blur issue */
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
    z-index: 1003;
}

.forecast-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.forecast-body {
    padding: 32px;
}

.forecast-info-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.forecast-metric-card {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(250, 250, 250, 0.6));
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forecast-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.forecast-metric-display {
    font-size: 28px;
    font-weight: 700;
    color: var(--always-red);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.forecast-metric-label {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.forecast-form-section {
    margin-bottom: 24px;
}

.forecast-form-section .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forecast-form-section .form-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.forecast-form-section .form-input:focus {
    border-color: var(--always-red);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.1);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.modal-actions.forecast-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-detail.forecast-btn-detail {
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.forecast-btn-cancel {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.forecast-btn-cancel:hover {
    background: rgba(108, 117, 125, 0.15);
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.forecast-btn-save {
    background: linear-gradient(135deg, var(--always-red), var(--warm-red));
    color: var(--fresh-white);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.3);
}

.forecast-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 16, 46, 0.4);
}

.forecast-btn-save:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .forecast-info-card {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-actions.forecast-actions {
        flex-direction: column-reverse;
    }
    
    .forecast-btn-cancel,
    .forecast-btn-save {
        width: 100%;
    }
}


/* --- Fixes for 1366x768 Resolution --- */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    /* Optimized styles for 1366x768 and similar resolutions */
    .header-action-btn.admin-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 15px;
        height: 36px;
        min-height: 36px;
        line-height: 1;
        vertical-align: middle;
    }
    
    .auth-section .user-info {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px;
    }
}

/* --- NEW HOURS CONTROL STYLES (JONY IVE INSPIRED) --- */
.new-hours-control {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(200, 16, 46, 0.08);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.04),
        0 1px 4px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.new-hours-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.1), transparent);
}

.new-hours-control:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(200, 16, 46, 0.12);
}

.new-hours-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.input-wrapper:focus-within {
    border-color: var(--always-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #6c757d;
    width: 16px;
    height: 16px;
    transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--always-red);
}

.new-hours-input {
    width: 140px;
    padding: 12px 16px 12px 36px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
}

.new-hours-input:focus {
    outline: none;
}

.new-hours-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-action-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 44px;
}

.new-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.new-action-btn:hover::before {
    left: 100%;
}

.new-action-btn.primary {
    background: var(--always-red);
    color: var(--fresh-white);
}

.new-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 16, 46, 0.4);
}

.new-action-btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.new-action-btn.secondary {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(248, 249, 250, 0.6));
    color: #6c757d;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px;
    min-width: 44px;
    backdrop-filter: blur(5px);
}

.new-action-btn.secondary:hover {
    background: linear-gradient(145deg, rgba(248, 249, 250, 0.9), rgba(243, 244, 246, 0.8));
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

.new-action-btn.secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Responsive Design for Mobile and Tablet */
@media (max-width: 768px) {
    .new-hours-control {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
        border-radius: 20px;
        width: 90%;
        margin: 0 auto;
    }
    
    .new-hours-label {
        text-align: center;
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .input-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .new-hours-input {
        width: 100%;
        text-align: center;
        padding: 14px 16px 14px 40px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .new-action-btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
        min-height: 52px;
    }
    
    .new-action-btn.secondary {
        padding: 16px 20px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .new-hours-control {
        padding: 12px;
        border-radius: 16px;
        gap: 10px;
    }
    
    .new-hours-label {
        font-size: 14px;
    }
    
    .new-hours-input {
        padding: 12px 16px 12px 36px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .button-group {
        gap: 10px;
    }
    
    .new-action-btn {
        padding: 14px 18px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* Tablet landscape optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .new-hours-control {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px;
        padding: 14px 18px;
    }
    
    .new-hours-label {
        font-size: 15px;
    }
    
    .input-wrapper {
        min-width: 160px;
    }
    
    .new-hours-input {
        width: 160px;
        padding: 12px 16px 12px 38px;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .new-action-btn {
        padding: 12px 18px;
        min-height: 46px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .new-hours-control {
        border-width: 0.5px;
    }
    
    .input-wrapper {
        border-width: 0.5px;
    }
    
    .new-action-btn.secondary {
        border-width: 0.5px;
    }
}

/* --- FORECAST SAVE BUTTON STYLES --- */
.forecast-save-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    padding: 16px;
    animation: fadeInUp 0.5s ease-out;
    flex-wrap: wrap;
}

.export-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.save-forecast-btn {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.save-forecast-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.save-forecast-btn:hover::before {
    left: 100%;
}

.save-forecast-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.save-forecast-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.save-forecast-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.save-forecast-btn:disabled::before {
    display: none;
}

.save-forecast-btn .btn-icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.save-forecast-btn:hover .btn-icon {
    transform: scale(1.1);
}

/* Animation for save button appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .forecast-save-container {
        flex-direction: column;
        padding: 12px;
        margin: 20px 0;
        gap: 12px;
    }
    
    .save-forecast-btn {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 180px;
        order: 1;
    }
    
    .export-actions {
        order: 2;
        justify-content: center;
        width: 100%;
        gap: 8px;
    }
    
    .export-actions .new-action-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Additional mobile responsive for smaller screens */
@media (max-width: 480px) {
    .forecast-save-container {
        padding: 8px;
        margin: 16px 0;
        gap: 10px;
    }
    
    .save-forecast-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 160px;
    }
    
    .export-actions {
        gap: 6px;
    }
    
    .export-actions .new-action-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 110px;
    }
}

/* --- EXPORT BUTTON ENHANCEMENTS --- */
.export-enabled {
    background: linear-gradient(135deg, var(--always-red) 0%, var(--warm-red) 100%) !important;
    color: var(--fresh-white) !important;
    border-color: var(--always-red) !important;
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.3);
}

.export-enabled:hover {
    background: linear-gradient(135deg, var(--warm-red) 0%, #A00E28 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 16, 46, 0.4);
}

.processing {
    position: relative;
    pointer-events: none;
    color: var(--fresh-white) !important;
    overflow: hidden;
}

.processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: processingSweep 1.5s infinite;
}

.processing .btn-text::after {
    /* Append only animated dots to avoid duplicate word */
    content: ' ...';
    animation: processingDots 1.5s infinite;
}

@keyframes processingSweep {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes processingDots {
    0%, 20% { content: ' '; }
    40% { content: ' .'; }
    60% { content: ' ..'; }
    80%, 100% { content: ' ...'; }
}

.processing-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--fresh-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* ===== Export Document (A4 Portrait) ===== */
#export-document {
    position: fixed;
    top: -99999px; /* keep offscreen */
    left: -99999px;
    /* Carta ~ 8.5x11 in @ ~150dpi */
    width: 1275px;   /* 8.5in * 150dpi */
    height: 1650px;  /* 11in  * 150dpi */
    background: #fff;
    color: #2D2D2D;
    font-family: var(--font-family);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.export-page {
    width: 100%;
    height: 100%;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
}

.export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--always-red);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.export-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.export-brand img { height: 48px; width: auto; }

.export-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--always-red);
    margin: 0;
}

.export-meta {
    text-align: right;
    font-size: 12px;
    color: #555;
}

.firme-stamp {
    display: inline-block;
    color: var(--always-red);
    border: 2px solid var(--always-red);
    padding: 4px 8px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 1px;
}

.export-section-title {
    font-size: 16px;
    margin: 16px 0 8px;
    font-weight: 700;
}

.export-table { width: 100%; border-collapse: collapse; }
.export-table th, .export-table td { border-bottom: 1px solid #eee; padding: 8px 10px; font-size: 12px; }
.export-table th { background: #fafafa; text-align: left; font-weight: 700; }
.export-table .qty { text-align: right; font-weight: 700; }
.export-table .center { text-align: center; }
.export-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; }

.export-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.export-sign {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.export-sign .line { height: 1px; background: #bbb; margin-top: 32px; }
.export-sign .label { color: #666; }

.export-group-title {
    margin-top: 18px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.export-totals {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.export-qr {
    margin-top: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #777;
}

.export-badge {
    display: inline-block;
    background: #f3f3f3;
    border: 1px solid #e8e8e8;
    color: #444;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
}

.export-subtle { color: #777; font-size: 11px; }

.export-actions { display: inline-flex; gap: 8px; margin-left: 8px; }

/* ===== ESTILOS PARA PÁGINA DE HISTORIAL ===== */
/* Inspirado en Jonathan Ive - Diseño minimalista y funcional para Tim Hortons */

/* --- LAYOUT BASE HISTORIAL --- */
.history-page {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #f8f9fa 100%);
    min-height: 100vh;
}

.history-main {
    padding-top: calc(var(--header-height) + 24px);
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;
}

/* --- HEADER ENHANCEMENTS --- */
.page-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-accent);
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.back-btn {
    background: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1;
    height: 36px;
    min-height: 36px;
    padding: 8px 15px;
    vertical-align: middle;
}

.back-btn,
.back-btn * {
    display: flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

.back-btn:hover {
    background: var(--text-secondary) !important;
    transform: translateX(-2px);
}

/* User Profile Compact */
.user-profile-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.user-avatar-compact {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
}

.user-details-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name-compact {
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1;
}

.user-role-compact {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* --- MOBILE NAVIGATION --- */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-accent);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

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

.mobile-nav-content {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-primary);
    padding: 24px;
    transform: translateX(100%);
    transition: transform var(--transition-medium);
    box-shadow: var(--shadow-lg);
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav-logo {
    height: 32px;
}

.mobile-nav-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
}

.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.mobile-nav-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.mobile-nav-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.mobile-nav-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.mobile-nav-item:hover {
    background: var(--bg-accent);
    color: var(--always-red);
}

/* --- HERO SECTION --- */
.history-hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-xl);
    padding: 48px 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.hero-content {
    flex: 1;
}

.hero-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--always-red), var(--warm-red));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.hero-icon i {
    width: 28px;
    height: 28px;
}

.hero-title {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.hero-stats {
    display: flex;
    gap: 24px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-semibold);
}

/* --- FILTERS PANEL --- */
.filters-panel {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.filters-container {
    max-width: 100%;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.filters-reset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-accent);
    border: 1px solid var(--border-light);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filters-reset-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: 24px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.filter-label i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.filter-select,
.filter-date,
.filter-search {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    width: 100%;
}

.filter-select:focus,
.filter-date:focus,
.filter-search:focus {
    outline: none;
    border-color: var(--always-red);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-separator {
    color: var(--text-muted);
    font-weight: var(--font-weight-semibold);
}

.search-input-wrapper {
    position: relative;
    display: flex;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--always-red);
    border: none;
    padding: 8px;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-btn:hover {
    background: var(--warm-red);
    transform: translateY(-50%) scale(1.05);
}

/* --- RESULTS SECTION --- */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    min-height: 400px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.results-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.results-title {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-number {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
}

.count-label {
    font-size: 14px;
    color: var(--text-muted);
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggle {
    display: flex;
    background: var(--bg-accent);
    border-radius: var(--radius-lg);
    padding: 4px;
    border: 1px solid var(--border-light);
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.toggle-btn.active {
    background: var(--bg-primary);
    color: var(--always-red);
    box-shadow: var(--shadow-sm);
}

.refresh-btn {
    background: var(--bg-accent);
    border: 1px solid var(--border-light);
    padding: 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.refresh-btn:hover {
    background: var(--bg-secondary);
    color: var(--always-red);
    transform: rotate(90deg);
}

/* --- CARDS VIEW --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.history-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: var(--transition-medium);
    cursor: pointer;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--always-red);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-folio {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    background: rgba(200, 16, 46, 0.1);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.card-content {
    margin-bottom: 20px;
}

.card-location {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-location i {
    color: var(--text-muted);
    width: 16px;
}

.card-user {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-user i {
    color: var(--text-muted);
    width: 16px;
}

.card-comment {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.card-action-btn {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.card-action-btn:hover {
    background: var(--always-red);
    color: white;
    border-color: var(--always-red);
    transform: translateY(-1px);
}

.card-action-btn.primary {
    background: var(--always-red);
    color: white;
    border-color: var(--always-red);
}

.card-action-btn.primary:hover {
    background: var(--warm-red);
}

/* --- TABLE VIEW --- */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

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

.history-table th {
    background: var(--bg-accent);
    padding: 16px 20px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-medium);
    white-space: nowrap;
}

.sort-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-btn:hover {
    color: var(--always-red);
}

.history-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.history-table tr:hover {
    background: var(--bg-primary);
}

/* --- STATES --- */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--text-muted);
}

.empty-icon i {
    width: 32px;
    height: 32px;
}

.empty-title {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.empty-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.4;
}

.empty-action-btn {
    background: var(--always-red);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.empty-action-btn:hover {
    background: var(--warm-red);
    transform: translateY(-2px);
}

.loading-state {
    text-align: center;
    padding: 80px 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--always-red);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

/* --- PAGINATION --- */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 24px 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-details {
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
    background: var(--always-red);
    color: white;
    border-color: var(--always-red);
    transform: translateY(-1px);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.modal-overlay[style*="block"] {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-medium);
}

.modal-overlay[style*="block"] .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border-light);
    /* Additional Safari mobile blur fix */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
    position: relative;
    z-index: 1002;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--always-red), var(--warm-red));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-sm);
}

.modal-title {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.modal-close-btn {
    background: var(--bg-accent);
    border: 1px solid var(--border-light);
    padding: 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--critical-color);
    color: white;
    border-color: var(--critical-color);
}

.modal-body {
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 32px;
    border-top: 1px solid var(--border-light);
    gap: 16px;
}

.modal-actions-left,
.modal-actions-right {
    display: flex;
    gap: 12px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

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

.modal-btn.secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--always-red);
    color: var(--always-red);
    transform: translateY(-1px);
}

.modal-btn.primary {
    background: var(--always-red);
    color: white;
}

.modal-btn.primary:hover {
    background: var(--warm-red);
    transform: translateY(-1px);
}

/* --- RESPONSIVE DESIGN --- */
@media screen and (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .date-range-group .date-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-separator {
        display: none;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }
}

@media screen and (max-width: 768px) {
    /* Mobile utilities */
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .user-profile-compact {
        display: none;
    }
    
    /* Layout adjustments */
    .history-main {
        padding-left: 16px;
        padding-right: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }
    
    .history-hero {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
        gap: 24px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-stats {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 16px;
    }
    
    .filters-panel,
    .results-section,
    .pagination-section {
        padding: 24px;
        margin-bottom: 24px;
    }
    
    .filters-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .results-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .results-controls {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .history-card {
        padding: 20px;
    }
    
    .pagination-section {
        flex-direction: column;
        gap: 16px;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Modal adjustments */
    .modal-overlay {
        padding: 16px;
    }
    
    .modal-container {
        max-height: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 16px;
    }
    
    .modal-actions-left,
    .modal-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .modal-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        min-width: auto;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .card-action-btn {
        padding: 8px;
        font-size: 12px;
    }
    
    .modal-header {
        padding: 24px 20px 20px;
    }
    
    .modal-body {
        padding: 24px 20px;
    }
    
    .modal-footer {
        padding: 20px 20px 24px;
    }
}

/* --- ACCESSIBILITY ENHANCEMENTS --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.filter-select:focus,
.filter-date:focus,
.filter-search:focus,
.card-action-btn:focus,
.modal-btn:focus,
.page-btn:focus {
    outline: 2px solid var(--always-red);
    outline-offset: 2px;
}

/* Safari specific modal header blur fix */
@supports (-webkit-backdrop-filter: blur(1px)) {
    .modal-header,
    .ive-modal-header,
    .forecast-header {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    
    .modal-header {
        background: rgba(255, 255, 255, 0.98) !important;
    }
    
    @media (max-width: 768px) {
        .modal-header,
        .ive-modal-header,
        .forecast-header {
            -webkit-backdrop-filter: saturate(180%) blur(0px) !important;
            backdrop-filter: saturate(180%) blur(0px) !important;
            -webkit-transform: translate3d(0, 0, 0) !important;
            transform: translate3d(0, 0, 0) !important;
        }
        
        .ive-modal-header::before {
            -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
            background: transparent !important;
        }
        
        .ive-header-content,
        .ive-header-title-row,
        .ive-title-content,
        .ive-header-content h2,
        .ive-subtitle {
            -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
            -webkit-transform: translate3d(0, 0, 0) !important;
            transform: translate3d(0, 0, 0) !important;
        }
    }
}


/* --- HERO SECTION --- */
/* ============================================================
   LANDING PAGE — COMPLETE REDESIGN
   ============================================================ */

/* --- Scroll Reveal Animations --- */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes revealScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes growWidth {
    from { width: 0; }
    to   { width: 100%; }
}

.anim-reveal {
    opacity: 0;
    transform: translateY(32px);
}

.anim-reveal.visible {
    animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Stagger delays for sequential reveals */
.anim-reveal.visible:nth-child(1) { animation-delay: 0s; }
.anim-reveal.visible:nth-child(2) { animation-delay: 0.1s; }
.anim-reveal.visible:nth-child(3) { animation-delay: 0.2s; }
.anim-reveal.visible:nth-child(4) { animation-delay: 0.3s; }
.anim-reveal.visible:nth-child(5) { animation-delay: 0.4s; }

/* --- Header CTA Button --- */
.header-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background-color: var(--always-red);
    color: var(--fresh-white);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: var(--transition-medium);
    border: 2px solid var(--always-red);
}

.header-cta-btn:hover {
    background-color: var(--warm-red);
    border-color: var(--warm-red);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height) + 60px) 24px 80px;
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* Subtle geometric background pattern */
.hero-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, rgba(200, 16, 46, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 60% 80%, rgba(200, 16, 46, 0.02) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 56px;
    max-width: 1200px;
    width: 100%;
    animation: fadeIn 0.6s ease forwards;
}

.hero-text {
    flex: 1;
    max-width: 520px;
    animation: slideInLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.confidential-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(200, 16, 46, 0.06);
    color: var(--always-red);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 28px;
    border: 1px solid rgba(200, 16, 46, 0.12);
    letter-spacing: 0.3px;
}

.hero-text h1 {
    font-size: 60px;
    font-weight: var(--font-weight-light);
    color: var(--text-primary);
    margin: 0 0 20px 0;
    line-height: 1.08;
    letter-spacing: -1.5px;
}

.hero-text h1 .highlight {
    font-weight: var(--font-weight-bold);
    color: var(--always-red);
    position: relative;
}

.hero-text p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 440px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: var(--transition-medium);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--always-red);
    color: var(--fresh-white);
    border-color: var(--always-red);
}

.btn-primary:hover {
    background-color: var(--warm-red);
    border-color: var(--warm-red);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.3);
}

.btn-secondary {
    background-color: var(--fresh-white);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-secondary:hover {
    border-color: var(--always-red);
    color: var(--always-red);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-medium);
    cursor: pointer;
}

.btn-ghost:hover {
    color: var(--always-red);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    width: 100%;
    justify-content: center;
}

/* --- Hero Image --- */
.hero-image-section {
    flex: 1;
    position: relative;
    max-width: 560px;
    animation: slideInRight 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
    opacity: 0;
}

.hero-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.06);
    height: 420px;
}

.hero-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 30%;
}

.confidential-card {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: auto;
    max-width: 320px;
    animation: revealUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
    opacity: 0;
}

.confidential-card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(200, 16, 46, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confidential-card-icon i,
.confidential-card-icon [data-lucide] {
    color: var(--always-red);
    width: 22px;
    height: 22px;
}

.confidential-card div {
    display: flex;
    flex-direction: column;
}

.confidential-card strong {
    font-size: 15px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: 1.3;
}

.confidential-card span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Hero responsive */
@media (max-width: 992px) {
    .hero-container {
        padding: calc(var(--header-height) + 40px) 24px 60px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-text h1 {
        font-size: 46px;
    }

    .hero-text p {
        max-width: 500px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image-section {
        max-width: 480px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .hero-container {
        padding: calc(var(--header-height) + 24px) 16px 48px;
    }

    .hero-text h1 {
        font-size: 36px;
        letter-spacing: -0.8px;
    }

    .hero-text p {
        font-size: 15px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-image {
        height: 280px;
    }

    .confidential-card {
        padding: 12px 16px;
    }
}

/* ============================================================
   TRUST STATS SECTION
   ============================================================ */
.trust-stats-section {
    background: var(--text-primary);
    padding: 0;
    position: relative;
}

.trust-stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 0;
}

.trust-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    justify-content: center;
    padding: 0 24px;
}

.trust-stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(200, 16, 46, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trust-stat-icon i,
.trust-stat-icon [data-lucide] {
    color: var(--always-red);
}

.trust-stat-content {
    display: flex;
    flex-direction: column;
}

.trust-stat-number {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--fresh-white);
    line-height: 1.2;
}

.trust-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

.trust-stat-divider {
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .trust-stats-container {
        flex-wrap: wrap;
        gap: 24px;
        padding: 32px 24px;
    }

    .trust-stat {
        flex: 1 1 calc(50% - 24px);
        min-width: 200px;
        padding: 0;
    }

    .trust-stat-divider {
        display: none;
    }
}

@media (max-width: 576px) {
    .trust-stats-container {
        flex-direction: column;
        gap: 20px;
        padding: 28px 20px;
    }

    .trust-stat {
        flex: 1 1 100%;
        justify-content: flex-start;
        padding: 0 8px;
    }
}

/* ============================================================
   COMMITMENT SECTION (Redesigned with Pillars)
   ============================================================ */
.commitment-section {
    text-align: center;
    padding: 88px 24px;
    background-color: var(--bg-primary);
    position: relative;
}

.commitment-container {
    max-width: 1100px;
    margin: 0 auto;
}

.commitment-section h2 {
    font-size: 36px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.commitment-intro {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 56px auto;
    line-height: 1.7;
}

.commitment-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.commitment-pillar {
    padding: 40px 32px;
    border-radius: var(--radius-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: var(--transition-medium);
}

.commitment-pillar:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(200, 16, 46, 0.2);
}

.pillar-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    background: rgba(200, 16, 46, 0.06);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pillar-icon i,
.pillar-icon [data-lucide] {
    color: var(--always-red);
    width: 28px;
    height: 28px;
}

.commitment-pillar h3 {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.commitment-pillar p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

@media (max-width: 992px) {
    .commitment-pillars {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .commitment-section {
        padding: 64px 16px;
    }

    .commitment-section h2 {
        font-size: 28px;
    }

    .commitment-intro {
        font-size: 15px;
        margin-bottom: 40px;
    }
}

/* ============================================================
   HOW IT WORKS (Redesigned with connectors + numbers)
   ============================================================ */
.how-it-works-section {
    text-align: center;
    padding: 88px 24px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #f0efed 100%);
    position: relative;
}

.how-it-works-section h2 {
    font-size: 36px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.how-it-works-section > p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 56px auto;
    line-height: 1.7;
}

.process-steps-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto;
}

.process-step {
    background-color: var(--fresh-white);
    padding: 40px 32px 36px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    transition: var(--transition-medium);
    flex: 1;
    max-width: 320px;
    position: relative;
}

.process-step:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--always-red);
}

.step-number {
    position: absolute;
    top: -14px;
    left: 32px;
    background: var(--always-red);
    color: var(--fresh-white);
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    padding: 4px 14px;
    border-radius: 100px;
    letter-spacing: 1px;
}

.step-icon {
    width: 68px;
    height: 68px;
    background: rgba(200, 16, 46, 0.06);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    transition: var(--transition-medium);
}

.process-step:hover .step-icon {
    background: var(--always-red);
}

.step-icon i,
.step-icon [data-lucide] {
    color: var(--always-red);
    width: 32px;
    height: 32px;
    transition: var(--transition-medium);
}

.process-step:hover .step-icon i,
.process-step:hover .step-icon [data-lucide] {
    color: var(--fresh-white) !important;
}

.process-step h3 {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.process-step .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-weight: var(--font-weight-regular);
}

.process-step .description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* Step Connectors */
.step-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-width: 56px;
    padding-top: 72px;
    position: relative;
}

.connector-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--border-light), var(--always-red), var(--border-light));
    border-radius: 1px;
}

.step-connector i,
.step-connector [data-lucide] {
    position: absolute;
    color: var(--always-red);
    width: 20px;
    height: 20px;
    right: 0;
}

@media (max-width: 992px) {
    .process-steps-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .process-step {
        max-width: 480px;
        width: 100%;
    }

    .step-connector {
        width: 2px;
        min-width: 2px;
        height: 32px;
        padding-top: 0;
    }

    .connector-line {
        width: 2px;
        height: 100%;
        background: linear-gradient(180deg, var(--border-light), var(--always-red), var(--border-light));
    }

    .step-connector i,
    .step-connector [data-lucide] {
        display: none;
    }
}

@media (max-width: 768px) {
    .how-it-works-section {
        padding: 64px 16px;
    }

    .how-it-works-section h2 {
        font-size: 28px;
    }

    .how-it-works-section > p {
        font-size: 15px;
    }
}

/* ============================================================
   FAQ + CTA SECTION
   ============================================================ */
.faq-cta-section {
    padding: 88px 24px;
    background: var(--bg-primary);
}

.faq-cta-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 56px;
    align-items: start;
}

.faq-column h2 {
    font-size: 32px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 32px 0;
    letter-spacing: -0.5px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-medium);
}

.faq-item:hover {
    border-color: rgba(200, 16, 46, 0.2);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    text-align: left;
    gap: 12px;
    transition: var(--transition-medium);
}

.faq-question:hover {
    color: var(--always-red);
}

.faq-question i,
.faq-question [data-lucide] {
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-question i,
.faq-item.open .faq-question [data-lucide] {
    transform: rotate(180deg);
    color: var(--always-red);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1), padding 0.35s ease;
    padding: 0 20px;
}

.faq-item.open .faq-answer {
    max-height: 200px;
    padding: 0 20px 18px;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* CTA Card */
.cta-column {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.cta-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    padding: 44px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 0%, rgba(200, 16, 46, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.cta-card-icon {
    width: 64px;
    height: 64px;
    background: rgba(200, 16, 46, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    position: relative;
}

.cta-card-icon i,
.cta-card-icon [data-lucide] {
    color: var(--always-red);
    width: 28px;
    height: 28px;
}

.cta-card h3 {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--fresh-white);
    margin: 0 0 12px 0;
    position: relative;
}

.cta-card p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.65;
    margin: 0 0 28px 0;
    position: relative;
}

.cta-card .btn-primary {
    margin-bottom: 12px;
    position: relative;
}

.cta-card .btn-ghost {
    color: rgba(255, 255, 255, 0.5);
    position: relative;
}

.cta-card .btn-ghost:hover {
    color: var(--fresh-white);
}

@media (max-width: 992px) {
    .faq-cta-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .cta-column {
        position: static;
    }

    .cta-card {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .faq-cta-section {
        padding: 64px 16px;
    }

    .faq-column h2 {
        font-size: 26px;
    }
}

/* ============================================================
   FOOTER (Fixed 4-column grid)
   ============================================================ */
.main-footer {
    background-color: var(--bg-secondary);
    padding: 60px 24px 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: color var(--transition-fast);
}

.footer-column ul a:hover {
    color: var(--always-red);
}

.brand-column .footer-logo {
    height: 36px;
    margin-bottom: 14px;
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
    }

    .brand-column .footer-logo {
        margin: 0 auto 14px;
    }
}
