/* =========================================================
   TITANIUM V43 - ESTILOS COMPLETOS
   Apple Human Interface Guidelines - iOS Style
   Mobile-first PWA Design v4.3.0
   ========================================================= */

:root {
    /* Colores iOS */
    --primary: #007AFF;
    --primary-dark: #0056CC;
    --primary-light: #4DA2FF;
    --secondary: #5856D6;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --info: #5AC8FA;
    
    /* Grises iOS */
    --gray: #8E8E93;
    --gray-2: #AEAEB2;
    --gray-3: #C7C7CC;
    --gray-4: #D1D1D6;
    --gray-5: #E5E5EA;
    --gray-6: #F2F2F7;
    
    /* Fondos */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F2F2F7;
    --bg-tertiary: #FFFFFF;
    
    /* Texto */
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    
    /* Otros */
    --dark: #1C1C1E;
    --dark-light: #2C2C2E;
    --white: #FFFFFF;
    --border: #C6C6C8;
    --separator: rgba(60, 60, 67, 0.12);
    
    /* Sombras iOS */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Radios iOS */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Tipografía SF */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-title-1: 28px;
    --font-title-2: 22px;
    --font-title-3: 20px;
    --font-headline: 17px;
    --font-body: 17px;
    --font-callout: 16px;
    --font-subhead: 15px;
    --font-footnote: 13px;
    --font-caption-1: 12px;
    --font-caption-2: 11px;
    
    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    
    /* Touch target mínimo */
    --touch-target: 44px;
    
    /* Safe areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Modo oscuro automático */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #000000;
        --bg-secondary: #1C1C1E;
        --bg-tertiary: #2C2C2E;
        --text-primary: #FFFFFF;
        --text-secondary: #EBEBF5;
        --text-tertiary: #8E8E93;
        --border: #38383A;
        --separator: rgba(84, 84, 88, 0.65);
        --gray-6: #1C1C1E;
        --gray-5: #2C2C2E;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
   LOGIN - iOS Style
   ========================================================= */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--gray-5) 100%);
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-top));
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 36px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.login-title { 
    color: var(--text-primary); 
    font-size: var(--font-title-1); 
    font-weight: 700; 
    margin-bottom: 5px; 
    letter-spacing: -0.5px;
}

.login-subtitle { 
    color: var(--text-tertiary); 
    font-size: var(--font-subhead); 
    margin-bottom: 30px; 
}

.login-version {
    color: var(--text-tertiary);
    font-size: var(--font-caption-1);
    margin-top: 30px;
}

.login-form { width: 100%; max-width: 340px; }

.form-group { margin-bottom: 16px; }

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

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-body);
    transition: none;
    box-shadow: var(--shadow-sm);
    min-height: var(--touch-target);
}

.form-control:focus { 
    outline: none; 
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2), var(--shadow-sm);
}

.form-control::placeholder { color: var(--text-tertiary); }

.login-error {
    background: rgba(255, 59, 48, 0.1);
    border: none;
    border-left: 4px solid var(--danger);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--font-footnote);
    margin-bottom: 16px;
    display: none;
}

/* =========================================================
   BUTTONS - iOS Style
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: none;
    gap: 8px;
    min-height: var(--touch-target);
    -webkit-appearance: none;
}

.btn-primary { 
    background: var(--primary); 
    color: white; 
}
.btn-primary:active { 
    background: var(--primary-dark); 
    transform: scale(0.97); 
}

.btn-success { background: var(--success); color: white; }
.btn-success:active { transform: scale(0.97); opacity: 0.9; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:active { transform: scale(0.97); opacity: 0.9; }

.btn-warning { background: var(--warning); color: var(--text-primary); }

.btn-dark { background: var(--dark); color: white; }

.btn-outline { 
    background: transparent; 
    border: 1.5px solid var(--primary); 
    color: var(--primary); 
}
.btn-outline:active { background: rgba(0, 122, 255, 0.1); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
}
.btn-ghost:active { background: rgba(0, 122, 255, 0.1); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: var(--font-footnote); min-height: 36px; }
.btn-lg { padding: 16px 32px; font-size: var(--font-headline); }

.btn-icon {
    background: var(--bg-primary);
    border: none;
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: none;
    box-shadow: var(--shadow-sm);
}

.btn-icon:active { background: var(--gray-5); transform: scale(0.95); }
.btn-icon.text-danger { color: var(--danger); }

/* =========================================================
   HEADER - iOS Style with Blur
   ========================================================= */
.app-header {
    background: rgba(249, 249, 249, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    padding: 12px 16px;
    padding-top: calc(12px + var(--safe-area-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 0.5px solid var(--separator);
}

@media (prefers-color-scheme: dark) {
    .app-header {
        background: rgba(28, 28, 30, 0.94);
    }
}

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

.btn-menu {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.btn-menu:active { background: var(--gray-5); }

.header-logo { 
    width: 36px; 
    height: 36px; 
    background: var(--primary); 
    border-radius: var(--radius-sm); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    color: white; 
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.header-title { 
    color: var(--text-primary); 
    font-size: var(--font-headline); 
    font-weight: 600; 
}

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

.user-badge { 
    background: var(--gray-5); 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: var(--font-caption-2); 
    font-weight: 600; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    letter-spacing: 0.3px;
}

.btn-logout { 
    background: rgba(255, 59, 48, 0.1); 
    border: none; 
    color: var(--danger); 
    width: 40px; 
    height: 40px; 
    border-radius: var(--radius-sm); 
    cursor: pointer;
    font-size: 16px;
}
.btn-logout:active { background: rgba(255, 59, 48, 0.2); }

/* =========================================================
   BOTTOM NAV - iOS Tab Bar Style
   ========================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(249, 249, 249, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--separator);
    display: flex;
    z-index: 100;
}

@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: rgba(28, 28, 30, 0.94);
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-tertiary);
    font-size: var(--font-caption-2);
    font-weight: 500;
    cursor: pointer;
    transition: none;
    position: relative;
    min-height: var(--touch-target);
}

.nav-item i { font-size: 24px; }
.nav-item.active { color: var(--primary); }
.nav-item:active { opacity: 0.7; }

/* Badge de notificación */
.nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* =========================================================
   VIEWS
   ========================================================= */
.view { display: none; padding: 15px; padding-bottom: 80px; animation: fadeIn 0.3s; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   CARDS
   ========================================================= */
.card { background: white; border-radius: var(--radius); padding: 15px; margin-bottom: 15px; box-shadow: var(--shadow); }
.card.compact { padding: 12px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 14px; font-weight: 700; color: var(--dark); }

/* Card Backgrounds */
.bg-success { background: rgba(6, 214, 160, 0.15) !important; border: 1px solid var(--success); }
.bg-danger { background: rgba(239, 71, 111, 0.15) !important; border: 1px solid var(--danger); color: var(--danger); }
.bg-warning { background: #fff3cd !important; border: 1px solid #ffc107; }
.bg-warning-gradient { background: linear-gradient(135deg, #ffd166 0%, #ffb347 100%) !important; color: var(--dark); }
.bg-dark { background: var(--dark) !important; color: white; }
.bg-gradient { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important; color: white; }

/* =========================================================
   STATS
   ========================================================= */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 15px; }
.stat-card { background: white; border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.stat-icon.blue { background: rgba(67, 97, 238, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(6, 214, 160, 0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(255, 209, 102, 0.15); color: #e6a700; }
.stat-icon.red { background: rgba(239, 71, 111, 0.15); color: var(--danger); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--dark); }
.stat-label { font-size: 11px; color: var(--gray); text-transform: uppercase; font-weight: 600; }

/* =========================================================
   PAGE HEADER
   ========================================================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

/* =========================================================
   LOTTERY
   ========================================================= */
.lottery-list { margin-bottom: 15px; }
.lottery-item { background: white; border: 2px solid var(--border); border-radius: var(--radius); padding: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: none; }
.lottery-item:active { transform: scale(0.98); border-color: var(--primary); }
.lottery-info h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.lottery-info span { font-size: 12px; color: var(--gray); }
.lottery-time { font-size: 12px; font-weight: 600; }
.lottery-time.urgente { color: var(--danger); }
.lottery-time.pronto { color: var(--warning); }
.lottery-time.abierto { color: var(--success); }
.lottery-badge { background: rgba(67, 97, 238, 0.1); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; margin-top: 5px; display: inline-block; }

/* =========================================================
   KEYPAD
   ========================================================= */
.keypad-container { background: white; border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.display-row { display: flex; gap: 10px; margin-bottom: 15px; }
.display-box { flex: 1; background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; cursor: pointer; transition: none; }
.display-box.active { border-color: var(--primary); background: rgba(67, 97, 238, 0.05); }
.display-label { font-size: 10px; color: var(--gray); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.display-value { font-size: 28px; font-weight: 800; color: var(--dark); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.key { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; font-size: 24px; font-weight: 600; color: var(--dark); cursor: pointer; transition: none; }
.key:active { background: var(--border); transform: scale(0.95); }
.key-del { background: rgba(239, 71, 111, 0.1); color: var(--danger); }
.key-half { background: rgba(67, 97, 238, 0.1); color: var(--primary); font-size: 20px; }

/* =========================================================
   TICKET PREVIEW
   ========================================================= */
.ticket-preview { background: white; border-radius: var(--radius); padding: 15px; margin-top: 15px; box-shadow: var(--shadow); }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.preview-list { max-height: 180px; overflow-y: auto; }
.preview-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.preview-num { font-size: 18px; font-weight: 800; }
.preview-amount { font-weight: 700; }
.preview-delete { color: var(--danger); margin-left: 10px; cursor: pointer; padding: 5px; }
.preview-total { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; margin-top: 12px; border-top: 2px solid var(--dark); }

/* =========================================================
   LISTS
   ========================================================= */
.list-group { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-item { padding: 15px; border-bottom: 1px solid var(--bg); display: flex; justify-content: space-between; align-items: center; }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-info span { font-size: 12px; color: var(--gray); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-actions { display: flex; align-items: center; gap: 8px; margin-left: 10px; }

/* =========================================================
   BADGES
   ========================================================= */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-success { background: rgba(6, 214, 160, 0.15); color: var(--success); }
.badge-warning { background: rgba(255, 209, 102, 0.2); color: #c99700; }
.badge-danger { background: rgba(239, 71, 111, 0.15); color: var(--danger); }

/* =========================================================
   SWITCH TOGGLE
   ========================================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-light);
    transition: none;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: none;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(22px); }

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: var(--radius); width: 100%; max-width: 340px; padding: 25px; text-align: center; animation: modalIn 0.3s; }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 28px; }
.modal-icon.success { background: rgba(6, 214, 160, 0.15); color: var(--success); }
.modal-icon.error { background: rgba(239, 71, 111, 0.15); color: var(--danger); }
.modal-icon.warning { background: rgba(255, 209, 102, 0.15); color: #e6a700; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.modal-text { font-size: 14px; color: var(--gray); margin-bottom: 20px; line-height: 1.5; }
.modal-btn { width: 100%; padding: 14px; border: none; border-radius: var(--radius); font-size: 16px; font-weight: 600; cursor: pointer; background: var(--primary); color: white; }

/* =========================================================
   LOADING
   ========================================================= */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); display: none; align-items: center; justify-content: center; z-index: 2000; }
.loading-overlay.active { display: flex; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   TABLES
   ========================================================= */
.info-table { width: 100%; }
.info-table tr { border-bottom: 1px solid var(--bg); }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: 10px 0; font-size: 14px; }

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.progress-bar { background: var(--border); height: 8px; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress-fill { background: var(--primary); height: 100%; transition: width 0.3s; }

/* =========================================================
   RESULTS DISPLAY
   ========================================================= */
.results-display { display: flex; gap: 8px; }
.result-number { background: var(--primary); color: white; padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 16px; }
.result-number.secondary { background: var(--gray-light); color: var(--dark); }

/* =========================================================
   FORMS
   ========================================================= */
.form-control-light {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--dark);
    font-size: 16px;
    transition: none;
}

.form-control-light:focus { outline: none; border-color: var(--primary); }

textarea.form-control-light { resize: vertical; min-height: 80px; }

select.form-control-light {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.form-row { display: flex; gap: 10px; margin-bottom: 15px; }
.form-row input, .form-row select { flex: 1; }

/* =========================================================
   EMPTY STATES
   ========================================================= */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-state i { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }
.empty-state p { font-size: 14px; }
.empty-state.small { padding: 20px; }
.empty-state.small i { font-size: 24px; margin-bottom: 8px; }
.empty-state.small p { font-size: 12px; }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: #e6a700 !important; }
.text-gray { color: var(--gray) !important; }
.text-white { color: white !important; }
.text-white-70 { color: rgba(255,255,255,0.7) !important; }
.text-primary { color: var(--primary) !important; }

.text-bold { font-weight: 700; }
.text-xl { font-size: 20px; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mr-10 { margin-right: 10px; }
.ml-10 { margin-left: 10px; }

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

.back-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--gray); font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 15px; }
.back-btn:active { color: var(--primary); }

.section-title { font-size: 13px; font-weight: 700; color: var(--gray); text-transform: uppercase; margin-bottom: 12px; }

/* =========================================================
   INSTALL BUTTONS
   ========================================================= */
.btn-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--success);
    color: var(--dark);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    animation: pulse 2s infinite;
}

.btn-install:active { transform: scale(0.95); }

.btn-install-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--success);
    color: var(--dark);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(6, 214, 160, 0); }
}

/* =========================================================
   iOS BANNER
   ========================================================= */
.ios-banner {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 999;
    animation: slideUp 0.3s;
}

.ios-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
}

.ios-banner-content > i { font-size: 24px; color: var(--primary); }
.ios-banner-content div { flex: 1; }
.ios-banner-content strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ios-banner-content p { font-size: 12px; color: var(--gray); margin: 0; }
.ios-banner-content button { background: none; border: none; font-size: 24px; color: var(--gray); cursor: pointer; }

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 18px; }
    .display-value { font-size: 24px; }
    .key { padding: 14px; font-size: 20px; }
}

.key-half {
    background: var(--warning);
    color: var(--dark);
    font-size: 24px;
    font-weight: bold;
}

.key-half:active {
    background: #e6a800;
}

.btn-add-jugada {
    margin-top: 10px;
    font-size: 16px;
    padding: 15px;
}

/* =========================================================
   TICKET VISUAL (Estilo Recibo)
   ========================================================= */
.ticket-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.ticket-receipt {
    background: white;
    width: 100%;
    max-width: 320px;
    padding: 20px 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #000;
    border-radius: 4px;
}

.ticket-header {
    text-align: center;
}

.ticket-banca {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ticket-line {
    border-bottom: 1px dashed #000;
    margin: 10px 0;
}

.ticket-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
}

.ticket-body {
    margin: 10px 0;
}

.ticket-lottery {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin: 5px 0;
}

.ticket-evento {
    text-align: center;
    font-size: 12px;
    color: #555;
}

.ticket-jugadas {
    margin: 10px 0;
}

.ticket-jugada-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.ticket-num {
    font-weight: 700;
    width: 40%;
}

.ticket-tiempos {
    text-align: center;
    width: 20%;
    color: #555;
}

.ticket-monto {
    text-align: right;
    width: 40%;
}

.ticket-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 800;
    padding: 10px 0;
}

.ticket-total {
    font-size: 18px;
}

.ticket-footer {
    text-align: center;
    margin-top: 10px;
}

.ticket-vendedor {
    font-size: 12px;
    margin-bottom: 10px;
}

.ticket-suerte {
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0;
}

.ticket-validez {
    font-size: 10px;
    color: #555;
    font-style: italic;
}

.ticket-actions {
    width: 100%;
    max-width: 320px;
    margin-top: 15px;
}

.ticket-actions .btn {
    margin-bottom: 10px;
}

/* =========================================================
   TOGGLE SWITCH
   ========================================================= */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--light);
    border-radius: 13px;
    margin-right: 10px;
    transition: none;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: none;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--success);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(24px);
}

/* =========================================================
   FORM ROW (Columnas)
   ========================================================= */
.form-row {
    display: flex;
    gap: 10px;
}

.form-col {
    flex: 1;
}

.section-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

.mt-15 { margin-top: 15px; }

.key-add {
    background: var(--primary);
    color: white;
    font-size: 28px;
    font-weight: bold;
}

.key-add:active {
    background: var(--primary-dark);
}

.preview-tiempos {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
}

/* =========================================================
   GRID DE NUMEROS (5 COLUMNAS)
   ========================================================= */
.number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.grid-num {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: none;
}

.grid-num small {
    display: block;
    font-size: 9px;
    color: var(--gray);
    margin-top: 2px;
}

.grid-num.sold {
    background: rgba(67, 97, 238, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.grid-num.hot {
    background: rgba(239, 71, 111, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

.grid-num.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.grid-legend {
    display: flex;
    gap: 10px;
    font-size: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
}

.dot.sold { background: rgba(67, 97, 238, 0.3); border-color: var(--primary); }
.dot.hot { background: rgba(239, 71, 111, 0.3); border-color: var(--danger); }

/* Grid de venta (vendedor) */
.number-grid-venta {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.grid-num-venta {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: none;
}

.grid-num-venta:active {
    transform: scale(0.95);
}

.grid-num-venta.selected {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: white;
}

/* =========================================================
   TABS
   ========================================================= */
.tabs {
    display: flex;
    background: white;
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* =========================================================
   TICKET RECEIPT (Estilo recibo)
   ========================================================= */
.ticket-receipt {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    font-family: 'Courier New', monospace;
}

.receipt-header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--border);
}

.receipt-header h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

.receipt-header p {
    font-size: 14px;
    color: var(--gray);
    margin: 0;
}

.receipt-header .text-sm {
    font-size: 12px;
}

.receipt-info {
    padding: 15px 0;
    font-size: 12px;
}

.receipt-info .flex-between {
    margin-bottom: 5px;
}

.receipt-divider {
    border-top: 1px dashed var(--border);
    margin: 10px 0;
}

.receipt-jugadas {
    padding: 10px 0;
}

.jugada-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.jugada-num {
    font-weight: 700;
}

.jugada-monto {
    color: var(--gray);
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding-top: 10px;
    border-top: 2px solid var(--dark);
}

.receipt-status {
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.receipt-status.active {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success);
}

.receipt-status.cancelled,
.receipt-status.anulado {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

/* =========================================================
   BOTON IMPERSONAR
   ========================================================= */
.btn-impersonate {
    background: rgba(114, 9, 183, 0.1) !important;
    border-color: var(--secondary) !important;
    color: var(--secondary) !important;
}

.btn-impersonate:active {
    background: rgba(114, 9, 183, 0.2) !important;
}

/* =========================================================
   ACTION ROW
   ========================================================= */
.action-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.action-row .btn {
    flex: 1;
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 18px; }
    .display-value { font-size: 24px; }
    .key { padding: 14px; font-size: 20px; }
    .number-grid { grid-template-columns: repeat(5, 1fr); }
    .grid-num { font-size: 10px; padding: 6px 2px; }
}

@media (min-width: 768px) {
    .view { max-width: 600px; margin: 0 auto; }
    .login-form { max-width: 400px; }
}

/* =========================================================
   HEATMAP DE NUMEROS
   ========================================================= */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    padding: 5px;
}

.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: none;
    padding: 2px;
}

.heatmap-cell:active {
    transform: scale(0.92);
}

.heatmap-num {
    font-size: 11px;
    font-weight: 700;
}

.heatmap-val {
    font-size: 8px;
    opacity: 0.8;
}

/* Niveles de calor */
.heatmap-cell.level-0 {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--gray);
}

.heatmap-cell.level-1 {
    background: rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #1a7f44;
}

.heatmap-cell.level-2 {
    background: rgba(255, 183, 77, 0.4);
    border: 1px solid rgba(255, 183, 77, 0.6);
    color: #cc7a00;
}

.heatmap-cell.level-3 {
    background: rgba(239, 71, 111, 0.4);
    border: 1px solid rgba(239, 71, 111, 0.6);
    color: #c1224c;
}

.heatmap-cell.level-blocked {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    color: white;
}

/* Leyenda del heatmap */
.heatmap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.legend-dot.level-0 { background: var(--bg); border: 1px solid var(--border); }
.legend-dot.level-1 { background: rgba(46, 204, 113, 0.5); }
.legend-dot.level-2 { background: rgba(255, 183, 77, 0.6); }
.legend-dot.level-3 { background: rgba(239, 71, 111, 0.6); }
.legend-dot.level-blocked { background: #333; }

/* Tags para numeros bloqueados */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 3px;
}

.tag-danger {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger);
}

.tag i {
    cursor: pointer;
    opacity: 0.7;
}

.tag i:hover {
    opacity: 1;
}

/* =========================================================
   RESULTADOS DEL VENDEDOR
   ========================================================= */
.resultado-card {
    border-left-color: var(--warning);
}

.resultados-numeros {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px 0;
}

.resultado-premio {
    text-align: center;
}

.resultado-premio.primer-premio .premio-numero {
    font-size: 28px;
    background: var(--warning);
    color: white;
}

.premio-label {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 5px;
    font-weight: 600;
}

.premio-numero {
    display: inline-block;
    font-size: 20px;
    font-weight: 800;
    padding: 8px 15px;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--dark);
    min-width: 50px;
}

.resultado-hora {
    text-align: center;
    font-size: 12px;
    color: var(--gray);
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* =========================================================
   TEMA OSCURO
   ========================================================= */
body.dark-mode {
    --bg: #1a1a2e;
    --dark: #e0e0e0;
    --gray: #888;
    --border: #333;
}

body.dark-mode .login-container {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
}

body.dark-mode .app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .list-item {
    background: #16213e;
    border-color: #333;
}

body.dark-mode .form-control-light {
    background: #1a1a2e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .bottom-nav {
    background: #1a1a2e;
    border-color: #333;
}

body.dark-mode .key {
    background: #16213e;
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .heatmap-cell.level-0 {
    background: #1a1a2e;
    border-color: #333;
}

body.dark-mode .modal {
    background: #16213e;
}

body.dark-mode .ticket-receipt,
body.dark-mode .ticket-overlay {
    background: rgba(0, 0, 0, 0.95);
}

body.dark-mode .ticket-receipt {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* =========================================================
   PADDING Y UTILIDADES ADICIONALES
   ========================================================= */
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.text-white-70 {
    color: rgba(255, 255, 255, 0.7);
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.bg-warning-gradient {
    background: linear-gradient(135deg, var(--warning) 0%, #f59f00 100%);
    color: white;
}

.compact {
    padding: 10px 15px;
}

/* =========================================================
   TITANIUM v4.4.0 - ESTILOS ADICIONALES
   ========================================================= */

/* Acciones Rápidas Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-action-btn {
    background: var(--card-bg, #16213e);
    border: 1px solid var(--border, #2d3748);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: none;
    color: var(--text, #ecf0f1);
}

.quick-action-btn:hover {
    border-color: var(--primary, #3498db);
    transform: translateY(-2px);
}

.quick-action-btn:active {
    transform: scale(0.95);
}

.quick-action-btn i {
    font-size: 24px;
    color: var(--primary, #3498db);
    display: block;
    margin-bottom: 8px;
}

.quick-action-btn span {
    font-size: 11px;
    color: var(--text-muted, #a0aec0);
    display: block;
}

/* Premio Item especial */
.premio-item {
    border-left: 4px solid var(--success, #2ecc71);
}

/* Info Table mejorada */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border, #2d3748);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 12px 5px;
}

.info-table td:first-child {
    color: var(--text-muted, #a0aec0);
}

.info-table td:last-child {
    text-align: right;
}

.info-table tr.text-danger td {
    color: var(--danger, #e74c3c);
}

.info-table tr.text-success td:last-child {
    color: var(--success, #2ecc71);
}

.info-table tr.text-gray td {
    color: var(--gray, #95a5a6);
}

/* Animación pulse para alertas urgentes */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive para acciones rápidas */
@media (max-width: 400px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Búsqueda de premios */
#busqueda-premio {
    background: var(--input-bg, #0f0f23);
    border: 1px solid var(--border, #2d3748);
    color: var(--text, #ecf0f1);
}

#busqueda-premio:focus {
    border-color: var(--primary, #3498db);
    outline: none;
}

/* Badge en número ganador */
.premio-item .badge {
    font-size: 14px;
    padding: 5px 10px;
}

/* Gradiente para card de premios */
.bg-warning-gradient {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.bg-warning-gradient .stat-value {
    color: white;
}

/* Card oscuro mejorado */
.bg-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}

/* Responsive para tabla info */
@media (max-width: 400px) {
    .info-table td {
        padding: 10px 3px;
        font-size: 13px;
    }
}
/* =========================================================
   TITANIUM V42 - PARCHE DE CORRECCIONES CSS
   Agregar al final de app.css
   ========================================================= */

/* =========================================================
   FIX 1: Variable --light faltante para toggle-switch
   ========================================================= */
:root {
    --light: #e9ecef;  /* Agregar esta variable que faltaba */
}

/* =========================================================
   FIX 2: Toggle Switch mejorado (Medio Tiempo)
   ========================================================= */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--gray-light); /* Cambiar de var(--light) a var(--gray-light) */
    border-radius: 13px;
    margin-right: 10px;
    transition: none;
    flex-shrink: 0; /* Evitar que se comprima */
}

/* Asegurar que el toggle-label se vea bien */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    gap: 10px;
    padding: 8px 0;
}

.toggle-label input {
    display: none;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: none;
}

.toggle-label input:checked + .toggle-switch {
    background: var(--success);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(24px);
}

/* =========================================================
   FIX 3: Línea blanca superior (safe-area para PWA/móvil)
   ========================================================= */
html {
    background: var(--dark); /* Mismo color que header para evitar línea blanca */
}

body {
    padding-top: env(safe-area-inset-top, 0); /* Para notch de iPhone */
    background: var(--bg);
}

.app-header {
    padding-top: calc(15px + env(safe-area-inset-top, 0)); /* Ajuste para safe-area */
}

/* Alternativa: Si hay un contenedor #app */
#app {
    min-height: 100vh;
    background: var(--bg);
}

/* =========================================================
   FIX 4: Asegurar que Config se vea bien en móvil
   ========================================================= */
.section-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    margin: 15px 0 10px;
    letter-spacing: 0.5px;
}

/* Form group con toggle alineado */
.form-group.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* FIX DEFINITIVO: Línea blanca/azul superior */
html, body {
    background: var(--dark) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Estilo para el Switch de Delegación */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: none;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: none;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2196F3; /* Azul cuando está activo */
}
input:checked + .slider:before {
  transform: translateX(24px);
}(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: none;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-4);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   PWA INSTALL BUTTONS
   ========================================================= */
.btn-install {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--bg-primary);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-subhead);
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-install:active {
    transform: scale(0.97);
}

.btn-install-small {
    background: rgba(0, 122, 255, 0.1);
    border: none;
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* iOS Banner */
.ios-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-area-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
}

.ios-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ios-banner-content i {
    font-size: 24px;
    color: var(--primary);
}

.ios-banner-content div {
    flex: 1;
}

.ios-banner-content strong {
    display: block;
    font-size: var(--font-subhead);
    margin-bottom: 2px;
}

.ios-banner-content p {
    font-size: var(--font-footnote);
    color: var(--text-tertiary);
    margin: 0;
}

.ios-banner-content button {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 375px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .header-title {
        display: none;
    }
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-primary);
    z-index: 1001;
    transition: none;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: none;
}

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

.sidebar-header {
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-top));
    background: var(--primary);
    color: white;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-username {
    font-weight: 600;
    font-size: 16px;
}

.sidebar-role {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: none;
}

.sidebar-item:hover {
    background: var(--gray-6);
}

.sidebar-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.sidebar-item i {
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--separator);
    margin: 10px 20px;
}

.sidebar-footer {
    padding: 15px 20px;
    padding-bottom: calc(15px + var(--safe-area-bottom));
    border-top: 1px solid var(--separator);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
}

.sidebar-version {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-tertiary);
}

@media (min-width: 768px) {
    .sidebar {
        left: 0;
        box-shadow: none;
        border-right: 0.5px solid var(--separator);
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    #main-content {
        margin-left: 280px;
    }
    
    .bottom-nav {
        left: 280px;
    }
}

/* =========================================================
   FIN DE ESTILOS TITANIUM V43
   ========================================================= */
