/* ============================================================
   VARIABLES Y RESET
   ============================================================ */
:root {
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-light:  #eff6ff;
    --success:        #059669;
    --success-light:  #f0fdf4;
    --warning:        #d97706;
    --warning-light:  #fffbeb;
    --danger:         #dc2626;
    --danger-light:   #fef2f2;
    --gray-50:        #f8fafc;
    --gray-100:       #f1f5f9;
    --gray-200:       #e2e8f0;
    --gray-300:       #cbd5e1;
    --gray-400:       #94a3b8;
    --gray-500:       #64748b;
    --gray-600:       #475569;
    --gray-700:       #334155;
    --gray-800:       #1e293b;
    --gray-900:       #0f172a;
    --white:          #ffffff;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:      0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --sidebar-width:  260px;
    --topbar-height:  64px;
    --transition:     all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--gray-800);
    background: var(--gray-100);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.login-footer {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
}

/* ============================================================
   LAYOUT ADMIN
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon { font-size: 28px; }

.sidebar-brand-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.sidebar-brand-text span {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    padding: 8px 24px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(37,99,235,0.3);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar-link .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* TOPBAR */
.topbar {
    background: var(--white);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

.topbar-title p {
    font-size: 13px;
    color: var(--gray-500);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* PAGE CONTENT */
.page-content {
    padding: 32px;
    flex: 1;
}

/* ============================================================
   COMPONENTES: CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body { padding: 24px; }

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-light); }
.stat-icon.green  { background: var(--success-light); }
.stat-icon.yellow { background: var(--warning-light); }
.stat-icon.red    { background: var(--danger-light); }

.stat-info { flex: 1; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================================
   COMPONENTES: FORMULARIOS
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-group:last-child { margin-bottom: 0; }

label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.required-mark { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

input.error,
select.error,
textarea.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

textarea { resize: vertical; min-height: 100px; }

.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: var(--gray-400);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
}

.form-error {
    font-size: 12px;
    color: var(--danger);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

/* COLOR PICKER */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-wrapper input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 2px;
    border-radius: var(--radius);
    cursor: pointer;
}

/* CHECKBOX Y RADIO */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.checkbox-item input,
.radio-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ============================================================
   COMPONENTES: BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-success   { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-success:hover { background: #047857; }

.btn-danger    { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-warning   { background: var(--warning); color: var(--white); border-color: var(--warning); }
.btn-warning:hover { background: #b45309; }

.btn-outline   { background: transparent; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }

.btn-ghost     { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-lg  { padding: 12px 24px; font-size: 16px; }
.btn-full { width: 100%; }

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   COMPONENTES: ALERTAS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: var(--primary-light); color: #1e40af; border: 1px solid #93c5fd; }

/* ============================================================
   COMPONENTES: BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--primary-light); color: var(--primary); }
.badge-gray    { background: var(--gray-100);      color: var(--gray-600); }

/* ============================================================
   COMPONENTES: TABLA
   ============================================================ */
.table-wrapper { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

.table-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}

.table-empty .empty-icon { font-size: 40px; margin-bottom: 12px; }
.table-empty p { font-size: 14px; }

/* ============================================================
   COMPONENTES: MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}

.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   COMPONENTES: CALENDARIO VISUAL
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    padding: 8px 4px;
    text-transform: uppercase;
}

.calendar-day {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px;
    min-height: 80px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    position: relative;
}

.calendar-day:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

.calendar-day.today { border-color: var(--primary); background: var(--primary-light); }

.calendar-day.disabled {
    background: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-day.other-month { opacity: 0.35; }

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number { color: var(--primary); }

.calendar-day-slots {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slot-pill {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--success-light);
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-pill.full { background: var(--danger-light); color: var(--danger); }
.slot-pill.partial { background: var(--warning-light); color: var(--warning); }

/* CALENDARIO NAVEGACIÓN */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-nav h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    text-transform: capitalize;
}

/* ============================================================
   PÁGINA PÚBLICA DE RESERVAS
   ============================================================ */
.public-page {
    background: var(--gray-100);
    min-height: 100vh;
}

.public-header {
    background: var(--white);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.public-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.public-cover {
    height: 180px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    background-size: cover;
    background-position: center;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

.public-identity {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 0 24px;
    margin-top: -40px;
    position: relative;
}

.public-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
    background: var(--white);
    object-fit: contain;
    flex-shrink: 0;
}

.public-logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.public-info h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.public-info p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.public-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* STEPS DE RESERVA */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-500);
    flex-shrink: 0;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary);
    color: var(--white);
}

.step.done .step-number {
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.step.active .step-label { color: var(--primary); font-weight: 600; }
.step.done .step-label   { color: var(--success); }

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 4px;
}

/* SELECTOR DE FECHA */
.date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.date-btn {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.date-btn:hover  { border-color: var(--primary); background: var(--primary-light); }
.date-btn.selected { border-color: var(--primary); background: var(--primary); color: var(--white); }
.date-btn.disabled { opacity: 0.4; cursor: not-allowed; background: var(--gray-100); }

.date-btn .date-day   { font-size: 11px; text-transform: uppercase; opacity: 0.7; }
.date-btn .date-num   { font-size: 22px; font-weight: 700; line-height: 1; }
.date-btn .date-month { font-size: 11px; opacity: 0.7; }

/* SELECTOR DE HORA */
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.time-btn {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    font-size: 15px;
    font-weight: 600;
}

.time-btn:hover   { border-color: var(--primary); background: var(--primary-light); }
.time-btn.selected { border-color: var(--primary); background: var(--primary); color: var(--white); }

.time-btn .time-avail {
    font-size: 11px;
    font-weight: 400;
    margin-top: 3px;
    opacity: 0.7;
}

/* MODALIDADES */
.modalidad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.modalidad-btn {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
}

.modalidad-btn:hover   { border-color: var(--primary); }
.modalidad-btn.selected { border-color: var(--primary); background: var(--primary-light); }

.modalidad-icon { font-size: 28px; margin-bottom: 6px; }
.modalidad-label { font-size: 13px; font-weight: 600; color: var(--gray-700); }

/* RESUMEN DE RESERVA */
.reserva-resumen {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.reserva-resumen h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.reserva-resumen p {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

/* ============================================================
   GESTIÓN DE CAMPOS (drag & drop visual)
   ============================================================ */
.campos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campo-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: grab;
}

.campo-item:active { cursor: grabbing; }
.campo-item.dragging { opacity: 0.5; border: 2px dashed var(--primary); }

.campo-drag { color: var(--gray-400); font-size: 16px; cursor: grab; }
.campo-info { flex: 1; }
.campo-nombre { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.campo-tipo   { font-size: 12px; color: var(--gray-400); }
.campo-actions { display: flex; gap: 6px; }

/* ============================================================
   HORARIOS / FRANJAS
   ============================================================ */
.franjas-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.franja-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.franja-row input[type="time"],
.franja-row input[type="number"] {
    width: auto;
    min-width: 0;
}

.franja-row input[type="time"] { width: 120px; }
.franja-row input[type="number"] { width: 70px; }

.franja-separator { color: var(--gray-400); font-size: 12px; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    position: sticky;
    top: var(--topbar-height);
    z-index: 40;
    background: var(--gray-100);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    scroll-margin-top: calc(var(--topbar-height) + 12px);
}

.tab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    background: var(--white);
    color: var(--gray-700);
    transition: var(--transition);
}

.page-btn:hover  { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 13px; }
.text-xs     { font-size: 12px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex  { display: flex; }
.gap-1   { gap: 8px; }
.gap-2   { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1  { flex: 1; }
.w-full  { width: 100%; }

.hidden  { display: none !important; }

.divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }

    .form-row,
    .form-row-3 { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .calendar-grid { gap: 2px; }
    .calendar-day  { min-height: 60px; padding: 4px; }

    .date-grid { grid-template-columns: repeat(4, 1fr); }
    .time-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .date-grid  { grid-template-columns: repeat(3, 1fr); }
    .time-grid  { grid-template-columns: repeat(2, 1fr); }
    .login-card { padding: 24px; }
}