:root {
    --bg-dark: #12141f;
    --bg-card: rgba(30, 33, 45, 0.7);
    --accent: #4e7cfe;
    --accent-glow: rgba(78, 124, 254, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a8c0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    --error: #ff4d4d;
    --success: #00e676;
    --warning: #ffbf00;

    /* Turnos Colors */
    --color-manana: #4fc3f7;
    --color-tarde: #ffb74d;
    --color-noche: #9575cd;
    --color-holiday: #f06292;
    --color-vacation: #81c784;
}

body.light-theme {
    --bg-dark: #e8ecf0;
    --bg-card: rgba(255, 255, 255, 0.95);
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.3);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --glass-border: rgba(0, 0, 0, 0.15);
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    background-color: #e8ecf0 !important;
}

body.light-theme .day-cell.other-month {
    color: rgba(0, 0, 0, 0.12);
}

body.light-theme .day-cell.today {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .nav-btn, 
body.light-theme .icon-btn {
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

body.light-theme input[type="time"], 
body.light-theme input[type="number"] {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

body.light-theme .type-selector label {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

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

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    margin-top: 10px;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.accent {
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pill {
    background: var(--glass-grad);
    border: 1px solid var(--glass-border);
    padding: 10px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    backdrop-filter: blur(10px);
}

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

.pill .value {
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}

.balance-pill.positive .value { color: var(--success); }
.balance-pill.negative .value { color: var(--error); }

.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Calendario */
.calendar-section {
    padding: 24px;
    animation: fadeIn 0.8s ease-out;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-btn, .icon-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover, .icon-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 12px;
}

.calendar-days-header span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
    padding: 2px;
}

.day-cell:hover:not(.other-month) {
    background: rgba(255, 255, 255, 0.05);
}

.day-cell.other-month {
    color: rgba(255, 255, 255, 0.15);
    cursor: default;
}

.day-cell.today {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border);
}

.day-cell.is-holiday .day-number {
    color: var(--color-holiday);
    font-weight: 600;
}

.day-number {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
}

.shift-label {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.3;
    color: #fff;
}

.type-manana  .shift-label { background: var(--color-manana); color: #000; }
.type-tarde   .shift-label { background: var(--color-tarde);   color: #000; }
.type-noche   .shift-label { background: var(--color-noche);   color: #fff; }
.type-vacation .shift-label { background: var(--color-vacation); color: #000; }
.type-holiday .shift-label { background: var(--color-holiday);  color: #fff; }
.type-work    .shift-label { background: rgba(255,255,255,0.2); color: #fff; }

/* Línea de color debajo */
.day-cell.has-shift::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 16px;
    height: 2px;
    border-radius: 10px;
    background: var(--accent);
}

.day-cell.type-manana::after  { background: var(--color-manana); }
.day-cell.type-tarde::after   { background: var(--color-tarde); }
.day-cell.type-noche::after   { background: var(--color-noche); }
.day-cell.type-holiday::after { background: var(--color-holiday); }
.day-cell.type-vacation::after { background: var(--color-vacation); }

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon { font-size: 1.4rem; }
.stat-label { display: block; font-size: 0.7rem; color: var(--text-secondary); }
.stat-value { font-weight: 700; font-size: 1.1rem; }

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}

.hidden { display: none !important; }

.modal-content {
    width: 92%; max-width: 380px;
    padding: 24px;
    display: flex; flex-direction: column; gap: 18px;
    max-height: 90vh; overflow-y: auto;
}

.modal-content h3 { font-size: 1.3rem; }
.modal-content .desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: -10px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 0.8rem; color: var(--text-secondary); }

input[type="time"], input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white; padding: 12px; border-radius: 12px;
    font-size: 1rem; outline: none;
}

.type-selector.wrap {
    display: flex; flex-wrap: wrap; gap: 6px;
}

.type-selector input { display: none; }
.type-selector label {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer; font-size: 0.85rem;
    transition: all 0.2s;
}

.type-selector input:checked + label { border-color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }

/* Specific Shift Labels */
.type-selector input:checked + label.m-label { background: var(--color-manana); color: black; border-color: var(--color-manana); }
.type-selector input:checked + label.t-label { background: var(--color-tarde); color: black; border-color: var(--color-tarde); }
.type-selector input:checked + label.n-label { background: var(--color-noche); color: white; border-color: var(--color-noche); }

.time-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-primary, .btn-outline, .btn-secondary {
    padding: 14px; border-radius: 14px; border: none;
    font-weight: 600; cursor: pointer; transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-primary { background: var(--accent); color: white; }
.btn-outline { background: none; border: 1px solid var(--glass-border); color: var(--text-primary); }
.btn-secondary { background: rgba(255, 77, 77, 0.1); color: var(--error); border: 1px solid rgba(255, 77, 77, 0.1); }

.w-full { width: 100%; }
.mt-10 { margin-top: 10px; }

/* Animaciones */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.header-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.header-actions .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
    padding: 0;
}

/* Textarea para festivos */
.holidays-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    min-height: 100px;
    resize: vertical;
    font-family: monospace;
}

body.light-theme .holidays-textarea {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

/* Input file */
input[type="file"] {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

body.light-theme input[type="file"] {
    color: var(--text-primary);
}

/* Select */
select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

body.light-theme select {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Input text */
input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

body.light-theme input[type="text"] {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Checkbox */
.type-selector input[type="checkbox"] {
    display: none;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.toast-info {
    background: var(--accent);
    color: white;
}

.toast-success {
    background: var(--success);
    color: #000;
}

.toast-error {
    background: var(--error);
    color: white;
}

/* Regional Holidays List */
.region-holidays-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.holiday-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.holiday-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
}

body.light-theme .holiday-item {
    background: rgba(0, 0, 0, 0.05);
}

.holiday-date {
    color: var(--accent);
    font-weight: 600;
}

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

/* Help Modal */
.help-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.help-content p {
    margin: 0;
}

.help-content strong {
    color: var(--accent);
}

.help-content hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 8px 0;
}

.help-note {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.help-link a {
    color: var(--accent);
    text-decoration: none;
}

.help-link a:hover {
    text-decoration: underline;
}

.help-install {
    background: var(--accent);
    color: white !important;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.help-install strong {
    color: white !important;
}

.help-install-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
