/* ============================================================
   TECNOMEDIC – Hoja de estilos unificada
   Archivos que la usan: form.html · confirmacion.html · admin.html
   ============================================================ */

/* ─── 1. VARIABLES ─────────────────────────────────────────── */
:root {
    /* ── Paleta de marca TECNOMEDIC ── */
    --navy:        #0d1b2a;            /* dark base — se mantiene oscuro */
    --navy-mid:    #122236;
    --navy-light:  #193349;
    --teal:        #1aa5a5;            /* teal secundario de marca */
    --teal-bright: #30c5c5;
    --teal-glow:   rgba(26, 165, 165, 0.14);
    --green:       #98c544;            /* lima — color "MEDIC" del logo */
    --green-dk:    #7aad2e;
    --green-glow:  rgba(152, 197, 68, 0.13);
    --amber:       #f59e0b;
    --violet:      #1aa5a5;            /* reutiliza teal para edición */
    --violet-light:#30c5c5;
    --white:       #edf1f0;            /* blanco de marca */
    --muted:       #8aada9;
    --border:      rgba(26, 165, 165, 0.22);
    --card-bg:     rgba(18, 34, 54, 0.72);
    /* extras de marca */
    --brand-text:  #454545;
    --brand-bg:    #edf1f0;
}

/* ─── 2. RESET & BASE ───────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', 'DM Sans', sans-serif;
    background: var(--navy);
    color: var(--white);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 5%  10%, rgba(26,165,165,.07) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 95% 90%, rgba(152,197,68,.06) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* ─── 3. ANIMACIONES COMPARTIDAS ───────────────────────────── */
@keyframes blink    { 0%,100%{ opacity:1; } 50%{ opacity:.3; } }
@keyframes fadeUp   { from{ opacity:0; transform:translateY(30px); } to{ opacity:1; transform:translateY(0); } }
@keyframes slideUp  { from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from{ opacity:0; transform:scale(.5); } to{ opacity:1; transform:scale(1); } }
@keyframes bgPulse  { from{ opacity:1; } to{ opacity:.85; } }
@keyframes floatCircle { 0%{ transform:rotate(0deg) translateY(0); } 100%{ transform:rotate(360deg) translateY(-20px); } }
@keyframes ringPop  { from{ transform:scale(0); opacity:0; } to{ transform:scale(1); opacity:1; } }
@keyframes ringExpand { 0%{ transform:scale(1); opacity:.5; } 100%{ transform:scale(1.4); opacity:0; } }
@keyframes modalIn  { from{ transform:scale(.9); opacity:0; } to{ transform:scale(1); opacity:1; } }

/* ─── 4. LOGO / ÍCONO (compartido) ─────────────────────────── */
.logo-icon {
    background: linear-gradient(135deg, var(--teal), var(--green-dk));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(26,165,165,.28);
}

/* Imagen de logo real — filter invert la hace blanca sobre fondo oscuro */
.logo-img {
    display: block;
    object-fit: contain;
    /* filter: brightness(0) invert(1); */
}

/* Header (form.html) */
.site-header .logo-img {
    height: 12rem;
    width: auto;
    max-width: 20rem;
}

/* Sidebar (admin.html) */
.sidebar .logo-img {
    height: 12rem;
    width: auto;
    max-width: 150px;
    margin-bottom: 10px;
    display: block;
}

/* Confirmación */
.confirm-logo {
    display: flex;
    justify-content: center;
}
.confirm-logo .logo-img {
    height: 15rem;
    width: auto;
    max-width: 20rem;
    opacity: .9;
}

/* ─── 5. BADGES (compartido, usado en admin y confirmacion) ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
}
.badge-dot-sm { width: 5px; height: 5px; border-radius: 50%; }
.badge.confirmed { background: rgba(152,197,68,.13); color: var(--green); border: 1px solid rgba(152,197,68,.28); }
.badge.confirmed .badge-dot-sm { background: var(--green); }
.badge.pending   { background: rgba(245,158,11,.12);  color: var(--amber); border: 1px solid rgba(245,158,11,.25); }
.badge.pending   .badge-dot-sm { background: var(--amber); }

/* ─── 6. BOTONES COMPARTIDOS ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, filter .2s;
    border: none;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: linear-gradient(135deg, var(--teal), var(--green-dk)); color: #fff; box-shadow: 0 6px 20px rgba(26,165,165,.28); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(26,165,165,.42); filter: brightness(1.08); }

.btn-outline { background: transparent; color: var(--white); border: 1px solid var(--border); }
.btn-outline:hover { background: rgba(255,255,255,.05); }

.btn-ghost { background: rgba(152,197,68,.1); color: var(--green); border: 1px solid rgba(152,197,68,.28); }
.btn-ghost:hover { background: rgba(152,197,68,.18); }


/* ════════════════════════════════════════════════════════════
   SECCIÓN A — FORM.HTML (formulario de solicitud de turno)
   ════════════════════════════════════════════════════════════ */

/* Fondo animado específico de la página de formulario */
body.page-form::before {
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(26,165,165,.09) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 90% 80%, rgba(152,197,68,.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(13,27,42,1)     0%, transparent 100%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

/* Círculos flotantes decorativos */
.bg-circles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.circle { position: absolute; border-radius: 50%; border: 1px solid rgba(0,180,216,.10); animation: floatCircle linear infinite; }
.circle:nth-child(1) { width:400px; height:400px; top:-100px;   left:-100px;  animation-duration:30s; }
.circle:nth-child(2) { width:600px; height:600px; bottom:-200px; right:-150px; animation-duration:40s; border-color:rgba(0,180,216,.06); }
.circle:nth-child(3) { width:200px; height:200px; top:40%;      left:60%;     animation-duration:20s; }

/* Wrapper */
.wrapper-form {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    padding: 28px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: rgba(7,24,48,.5);
}
.site-header .logo { display: flex; align-items: center; gap: 14px; }
.site-header .logo-icon { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.logo-text { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; letter-spacing: .04em; color: var(--white); }
.logo-sub  { font-size: 11px; color: var(--teal); letter-spacing: .15em; text-transform: uppercase; margin-top: 1px; }

.header-badge {
    display: flex; align-items: center; gap: 8px;
    background: var(--teal-glow); border: 1px solid var(--border);
    padding: 7px 14px; border-radius: 30px;
    font-size: 12px; color: var(--teal-bright); letter-spacing: .05em;
}
.badge-dot { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; animation: blink 2s ease-in-out infinite; }

/* Main content */
.form-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 50px 20px; }

.form-content { width: 100%; max-width: 520px; animation: fadeUp .8s ease both; }

.hero-label {
    font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
    color: var(--teal); margin-bottom: 10px;
    display: flex; align-items: center; gap: 10px;
}
.hero-label::before { content: ''; width: 28px; height: 1px; background: var(--teal); }

.form-content h1 { font-family: 'Playfair Display', serif; font-size: 38px; line-height: 1.2; font-weight: 600; margin-bottom: 10px; }
.form-content h1 span { color: var(--teal); }
.form-subtitle { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 36px; font-weight: 300; }

/* Card form */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 36px 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(0,180,216,.05);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }

label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: var(--muted); pointer-events: none; transition: color .2s;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="time"] {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(0,180,216,.18);
    border-radius: 10px;
    padding: 12px 14px 12px 42px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--white);
    outline: none;
    transition: border-color .25s, background .25s, box-shadow .25s;
    -webkit-appearance: none;
}
input:focus { border-color: var(--teal); background: rgba(0,180,216,.07); box-shadow: 0 0 0 3px rgba(0,180,216,.12); }
.input-wrap:focus-within .input-icon { color: var(--teal); }

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(.6) sepia(1) saturate(2) hue-rotate(170deg);
    cursor: pointer;
}

.form-divider { height: 1px; background: var(--border); margin: 24px 0; }

.submit-btn {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, var(--teal), var(--green-dk));
    border: none; border-radius: 12px;
    font-family: 'Montserrat', 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
    color: #fff; letter-spacing: .04em; cursor: pointer;
    transition: transform .2s, box-shadow .2s, filter .2s;
    box-shadow: 0 6px 24px rgba(26,165,165,.32);
    position: relative; overflow: hidden;
}
.submit-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg,rgba(255,255,255,.1),transparent); opacity: 0; transition: opacity .2s; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(26,165,165,.42); filter: brightness(1.08); }
.submit-btn:hover::after { opacity: 1; }
.submit-btn:active { transform: translateY(0); }

.form-note { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }

/* Features strip */
.features { display: flex; margin-top: 24px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.feature { flex: 1; padding: 16px 14px; text-align: center; border-right: 1px solid var(--border); transition: background .2s; }
.feature:last-child { border-right: none; }
.feature:hover { background: var(--teal-glow); }
.feature-icon { font-size: 20px; margin-bottom: 5px; }
.feature-text { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* Footer */
.site-footer { text-align: center; padding: 20px; font-size: 11px; color: rgba(127,168,201,.4); letter-spacing: .05em; position: relative; z-index: 1; }

/* Responsive form */
@media (max-width: 560px) {
    .site-header { padding: 20px; }
    .form-content h1 { font-size: 28px; }
    .form-card { padding: 24px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full { grid-column: 1; }
    .features { flex-direction: column; }
    .feature { border-right: none; border-bottom: 1px solid var(--border); }
    .feature:last-child { border-bottom: none; }
}


/* ════════════════════════════════════════════════════════════
   SECCIÓN B — CONFIRMACION.HTML (pantalla post-solicitud)
   ════════════════════════════════════════════════════════════ */

body.page-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    overflow-x: hidden;
}

body.page-confirm::before {
    background:
        radial-gradient(ellipse 70% 60% at 20% 30%, rgba(45,212,191,.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 70% at 80% 80%, rgba(0,180,216,.08)  0%, transparent 60%);
}

.confirm-page { position: relative; z-index: 1; width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 24px; }

/* Success ring */
.success-ring {
    width: 90px; height: 90px;
    border-radius: 50%;
    border: 2px solid var(--green);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    animation: ringPop .6s cubic-bezier(.175,.885,.32,1.275) both;
    box-shadow: 0 0 40px rgba(45,212,191,.2);
}
.success-ring::before {
    content: ''; position: absolute; inset: -8px; border-radius: 50%;
    border: 1px solid rgba(45,212,191,.2);
    animation: ringExpand 2s ease-out infinite;
}
.checkmark { font-size: 36px; animation: fadeIn .4s .4s ease both; }

/* Heading */
.confirm-heading { text-align: center; animation: slideUp .5s .2s ease both; }
.label-tag { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--green); margin-bottom: 8px; }
.confirm-heading h1 { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.confirm-subtitle { font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 340px; margin: 0 auto; }
.confirm-subtitle strong { color: var(--teal-bright); }

/* Turno card */
.turno-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    animation: slideUp .5s .35s ease both;
}
.turno-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.turno-card-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.status-pill { background: var(--green-glow); border: 1px solid rgba(45,212,191,.3); padding: 4px 12px; border-radius: 20px; font-size: 11px; color: var(--green); font-weight: 500; }

.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.data-item { display: flex; flex-direction: column; gap: 5px; }
.data-item.full { grid-column: 1 / -1; }
.data-icon  { font-size: 18px; margin-bottom: 4px; }
.data-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.data-value { font-size: 14.5px; color: var(--white); font-weight: 500; }

.highlight-box {
    margin-top: 20px; padding: 14px 16px;
    background: var(--teal-glow); border: 1px solid var(--border); border-radius: 12px;
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: var(--teal-bright);
}
.highlight-icon { font-size: 20px; flex-shrink: 0; }

/* Buttons row */
.btn-group { width: 100%; display: flex; gap: 12px; animation: slideUp .5s .5s ease both; }
.btn-group .btn { flex: 1; }


/* ════════════════════════════════════════════════════════════
   SECCIÓN C — ADMIN.HTML (dashboard de administración)
   ════════════════════════════════════════════════════════════ */

/* Layout */
.wrapper { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 230px; background: rgba(7,24,48,.92);
    border-right: 1px solid var(--border); backdrop-filter: blur(12px);
    display: flex; flex-direction: column; padding: 28px 0;
    flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0;
}
.sidebar-logo { padding: 0 24px 28px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.sidebar .logo-icon { width: 40px; height: 40px; font-size: 20px; margin-bottom: 10px; }
.sidebar-title { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; }
.sidebar-sub   { font-size: 10px; color: var(--teal); letter-spacing: .15em; text-transform: uppercase; margin-top: 2px; }
.nav-label { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); padding: 0 24px; margin-bottom: 8px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 24px; font-size: 13.5px; color: var(--muted);
    cursor: pointer; transition: color .2s, background .2s;
    border-left: 2px solid transparent; text-decoration: none;
}
.nav-item.active { color: var(--teal); background: var(--teal-glow); border-left-color: var(--teal); }
.nav-item:hover:not(.active) { color: var(--white); background: rgba(255,255,255,.04); }
.sidebar-footer { margin-top: auto; padding: 20px 24px; border-top: 1px solid var(--border); }
.status-dot  { width: 8px; height: 8px; background: var(--green); border-radius: 50%; display: inline-block; margin-right: 8px; animation: blink 2s ease-in-out infinite; }
.status-text { font-size: 12px; color: var(--muted); }

/* ── Main ── */
.main { margin-left: 230px; flex: 1; padding: 36px 40px; }

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; flex-wrap: wrap; gap: 14px; }
.page-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; }
.page-title span { color: var(--teal); }
.topbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.chip { background: var(--teal-glow); border: 1px solid var(--border); padding: 6px 14px; border-radius: 30px; font-size: 12px; color: var(--teal-bright); }

.view-toggle { display: flex; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.toggle-btn { padding: 7px 14px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--muted); background: transparent; border: none; cursor: pointer; transition: background .2s, color .2s; display: flex; align-items: center; gap: 6px; }
.toggle-btn.active { background: var(--teal-glow); color: var(--teal); }

.btn-print { display: flex; align-items: center; gap: 7px; padding: 7px 16px; background: rgba(45,212,191,.1); border: 1px solid rgba(45,212,191,.25); border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 12.5px; color: var(--green); cursor: pointer; transition: background .2s, transform .2s; }
.btn-print:hover { background: rgba(45,212,191,.18); transform: translateY(-1px); }

/* ── Stat cards ── */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; backdrop-filter: blur(16px); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.stat-card::after { content: ''; position: absolute; right: -15px; top: -15px; width: 80px; height: 80px; border-radius: 50%; background: var(--teal-glow); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.amber .stat-value { color: var(--amber); }
.stat-card.blue  .stat-value { color: var(--teal);  }

/* ── Views ── */
#tableView, #calendarView { display: none; }
#tableView.active, #calendarView.active { display: block; }

/* ── Table ── */
.table-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; backdrop-filter: blur(16px); overflow: hidden; }
.table-header { padding: 22px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-title { font-size: 14px; font-weight: 500; }

.search-wrap { position: relative; }
#searchInput { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px 8px 36px; font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--white); outline: none; width: 200px; transition: border-color .2s, background .2s; }
#searchInput::placeholder { color: var(--muted); }
#searchInput:focus { border-color: var(--teal); background: rgba(0,180,216,.07); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 13px 20px; text-align: left; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid rgba(0,180,216,.08); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,180,216,.04); }
tbody td { padding: 14px 20px; font-size: 13.5px; color: var(--white); white-space: nowrap; }
.name-cell  { font-weight: 500; }
.phone-cell, .email-cell { color: var(--muted); font-size: 13px; }
.date-cell  { color: var(--teal-bright); }

/* ── Action buttons ── */
.action-form { display: flex; align-items: center; gap: 8px; }
.action-extra { display: flex; gap: 6px; margin-top: 6px; }

.select-estado { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--white); outline: none; cursor: pointer; }
.select-estado option { background: var(--navy-mid); }

.btn-update     { background: linear-gradient(135deg, var(--teal), var(--green-dk)); border: none; border-radius: 8px; padding: 7px 14px; font-family: 'Montserrat','DM Sans',sans-serif; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.btn-update:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,165,165,.38); }

.btn-modify     { background: linear-gradient(135deg, #148080, #0d6060); border: none; border-radius: 8px; padding: 7px 14px; font-family: 'Montserrat','DM Sans',sans-serif; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.btn-modify:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20,128,128,.4); }

.btn-print-turn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 7px 11px; font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.btn-print-turn:hover { background: rgba(255,255,255,.12); color: var(--white); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* ── Calendar ── */
.calendar-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; backdrop-filter: blur(16px); overflow: hidden; }
.cal-header { padding: 22px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.cal-nav { display: flex; align-items: center; gap: 16px; }
.cal-nav-btn { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--white); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.cal-nav-btn:hover { background: var(--teal-glow); color: var(--teal); }
.cal-month-label { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; min-width: 220px; text-align: center; }
.cal-legend { display: flex; gap: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.confirmed { background: var(--green); }
.legend-dot.pending   { background: var(--amber); }
.cal-grid { padding: 24px 28px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 10px; }
.cal-weekday  { text-align: center; padding: 8px 4px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.cal-day { min-height: 84px; border-radius: 12px; padding: 8px; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.cal-day.has-turns { cursor: pointer; }
.cal-day.has-turns:hover { background: rgba(0,180,216,.07); border-color: var(--border); }
.cal-day.empty  { pointer-events: none; }
.cal-day.today  { border-color: var(--teal); background: var(--teal-glow); }
.cal-day-num    { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.cal-day.today .cal-day-num     { color: var(--teal); font-weight: 700; }
.cal-day.has-turns .cal-day-num { color: var(--white); }
.cal-turn-chip  { display: block; width: 100%; padding: 2px 6px; border-radius: 5px; font-size: 10px; line-height: 1.4; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-turn-chip.confirmed { background: rgba(152,197,68,.22); color: var(--green); }
.cal-turn-chip.pending   { background: rgba(245,158,11,.20);  color: var(--amber); }
.cal-more { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ── Day modal (calendario) ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,24,48,.85); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(6px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--navy-mid); border: 1px solid var(--border); border-radius: 20px; padding: 28px; width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto; animation: modalIn .3s cubic-bezier(.175,.885,.32,1.275); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title  { font-family: 'Playfair Display', serif; font-size: 18px; }
.modal-close  { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-close:hover { color: var(--white); }
.modal-turn   { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.modal-turn-name { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.modal-turn-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ── Edit modal (violeta) ── */
.edit-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(7,24,48,.88); z-index: 300; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.edit-modal-overlay.open { display: flex; }
.edit-modal { background: var(--navy-mid); border: 1px solid rgba(26,165,165,.35); border-radius: 22px; padding: 32px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: modalIn .3s cubic-bezier(.175,.885,.32,1.275); box-shadow: 0 30px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(26,165,165,.1); }
.edit-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid rgba(26,165,165,.2); }
.edit-modal-title span { color: var(--teal-bright); }
.edit-input  { width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(26,165,165,.25); border-radius: 10px; padding: 11px 13px 11px 40px; font-family: 'Montserrat','DM Sans',sans-serif; font-size: 13.5px; color: var(--white); outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
.edit-input:focus { border-color: var(--teal); background: rgba(26,165,165,.08); box-shadow: 0 0 0 3px rgba(26,165,165,.15); }
.edit-select { width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(26,165,165,.25); border-radius: 10px; padding: 11px 13px; font-family: 'Montserrat','DM Sans',sans-serif; font-size: 13.5px; color: var(--white); outline: none; cursor: pointer; transition: border-color .2s; }
.edit-select:focus { border-color: var(--teal); }
.edit-select option { background: var(--navy-mid); }
.btn-edit-save  { flex: 2; padding: 12px; background: linear-gradient(135deg, var(--teal), var(--green-dk)); border: none; border-radius: 11px; font-family: 'Montserrat','DM Sans',sans-serif; font-size: 13.5px; font-weight: 600; color: #fff; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 6px 20px rgba(26,165,165,.32); }
.btn-edit-save:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(26,165,165,.45); }

/* ── Ticket de impresión individual ── */
#turnTicket {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: #fff; color: #000;
    padding: 40px; font-family: 'DM Sans', sans-serif;
}
#turnTicket .ticket-logo { font-family: 'Playfair Display', serif; font-size: 26px; margin-bottom: 4px; color: var(--navy); }
#turnTicket .ticket-sub  { font-size: 12px; color: #555; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 2px solid var(--teal); }
#turnTicket .ticket-title { font-size: 14px; color: #555; margin-bottom: 20px; letter-spacing: .1em; text-transform: uppercase; }
#turnTicket .ticket-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
#turnTicket .ticket-field label { display: block; font-size: 10px; color: #888; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
#turnTicket .ticket-field span  { font-size: 16px; font-weight: 500; color: var(--navy); }
#turnTicket .ticket-note { font-size: 12px; color: #555; border-top: 1px solid #ddd; padding-top: 16px; text-align: center; }

/* ── Cabecera para impresión de planilla ── */
.print-header { display: none; text-align: center; margin-bottom: 20px; }
.print-header h2 { font-family: 'Playfair Display', serif; font-size: 22px; margin-bottom: 4px; }
.print-header p  { font-size: 12px; color: #555; }

/* ── Responsive admin ── */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .sidebar-logo, .nav-label, .sidebar-footer { display: none; }
    .nav-item span:last-child { display: none; }
    .nav-item { justify-content: center; padding: 14px; }
    .main { margin-left: 60px; padding: 24px 16px; }
    .stats { grid-template-columns: 1fr; }
    .cal-day { min-height: 60px; }
}

/* ════════════════════════════════════════════════════════════
   SECCIÓN D — ESTILOS DE IMPRESIÓN
   ════════════════════════════════════════════════════════════ */

/* Impresión de planilla completa (admin) */
@media print {
    body { background: #fff !important; color: #000 !important; }
    body::before { display: none !important; }

    /* El logo se ve natural en papel blanco — sin invertir */
    .logo-img { filter: none !important; }

    /* Ocultar elementos de UI */
    .sidebar, .topbar, .stats, .view-toggle, .btn-print,
    .search-wrap, .action-extra, #calendarView,
    .modal-overlay, .edit-modal-overlay { display: none !important; }

    .main { margin-left: 0 !important; padding: 20px !important; }
    #tableView { display: block !important; }

    /* Estilos de tabla */
    .table-card { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; }
    thead th { background: #e0f4ff !important; color: #000 !important; print-color-adjust: exact; }
    tbody td { color: #000 !important; }
    .date-cell, .phone-cell, .email-cell { color: #333 !important; }

    /* Badges */
    .badge.confirmed { background: #e0fdf4 !important; color: #059669 !important; print-color-adjust: exact; }
    .badge.pending   { background: #fffbeb !important; color: #d97706 !important; print-color-adjust: exact; }

    /* Cabecera de planilla */
    .print-header { display: block !important; }

    /* Impresión de turno individual (confirmacion.html) */
    .btn-group { display: none; }
    .turno-card { background: #fff !important; border: 2px solid var(--teal) !important; box-shadow: none !important; color: #000 !important; print-color-adjust: exact; }
    .data-label { color: #555 !important; }
    .data-value { color: #111 !important; }
    .turno-card-title { color: #555 !important; }
    .highlight-box { background: #e0f7fa !important; border-color: var(--teal) !important; color: #006080 !important; }
    .status-pill { background: #e0fdf4 !important; color: #059669 !important; border-color: #a7f3d0 !important; }
    .confirm-heading h1 { color: var(--navy) !important; }
    .label-tag { color: #059669 !important; }
}

/* ════════════════════════════════════════════════════════════
   SECCIÓN E — CORRECCIONES Y NUEVOS COMPONENTES
   ════════════════════════════════════════════════════════════ */

/* ── Fix sidebar z-index (siempre visible) ── */
.sidebar {
    z-index: 50;
}

/* ── Sidebar overlay para móvil ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 49;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── Hamburger btn (solo móvil) ── */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    gap: 0;
    flex-direction: column;
    flex-shrink: 0;
}
.hamburger-btn span {
    display: block;
    width: 18px; height: 2px;
    background: var(--white);
    border-radius: 2px;
    margin: 2px 0;
    transition: all .3s;
}

/* ── Carousel dentro de la sidebar ── */
.sidebar-carousel {
    margin: 16px 12px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    height: 160px;
    position: relative;
    border: 1px solid var(--border);
}
.sidebar-carousel .carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
}
.sidebar-carousel .carousel-slide.active { opacity: 1; }
.sidebar-carousel img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Carousel en form (sidebar lateral) ── */
.sidebar-form {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 0 20px 20px 0;
}
.sidebar-carousel-form {
    position: relative;
    flex: 1;
    overflow: hidden;
}
.sidebar-carousel-form .carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.sidebar-carousel-form .carousel-slide.active { opacity: 1; }
.sidebar-carousel-form img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Botón volver/home en admin ── */
.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: none;
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.btn-home:hover { background: rgba(255,255,255,.12); color: var(--white); }

/* ── Botón cerrar en form ── */
.form-close-btn {
    position: fixed;
    top: 18px; right: 18px;
    width: 38px; height: 38px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--muted);
    cursor: pointer;
    z-index: 99;
    text-decoration: none;
    transition: background .2s, color .2s, transform .2s;
}
.form-close-btn:hover {
    background: rgba(248,113,113,.15);
    border-color: rgba(248,113,113,.3);
    color: #f87171;
    transform: scale(1.1);
}

/* ══ RESPONSIVE ADMIN MEJORADO ══════════════════════════════ */
@media (max-width: 900px) {
    /* Sidebar: oculto por defecto, slide-in al abrir */
    .sidebar {
        width: 240px;
        left: -240px;
        transition: left .3s ease;
        z-index: 50;
    }
    .sidebar.open { left: 0; }

    /* El carousel de la sidebar se muestra en móvil */
    .sidebar-carousel { height: 130px; }

    /* Main sin margen lateral */
    .main { margin-left: 0; padding: 20px 16px; }

    /* Hamburger visible */
    .hamburger-btn { display: flex; }

    /* Stats en columna */
    .stats { grid-template-columns: 1fr 1fr; }

    /* Topbar ajustado */
    .topbar { padding-bottom: 8px; }
    .page-title { font-size: 20px; }

    /* Toggle y botones más pequeños */
    .toggle-btn { padding: 6px 10px; font-size: 11px; }
    .btn-print { padding: 6px 12px; font-size: 11px; }

    /* Tabla scrolleable */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Calendario días más pequeños */
    .cal-day { min-height: 56px; padding: 5px; }
    .cal-day-num { font-size: 11px; }
    .cal-turn-chip { font-size: 9px; padding: 1px 4px; }
    .cal-month-label { font-size: 15px; min-width: 160px; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .topbar-right { gap: 6px; }
    .chip { display: none; }
    .view-toggle { display: none; }
    .btn-print { font-size: 11px; padding: 6px 10px; }
}

/* ── Responsive form con carousel lateral ── */
@media (max-width: 900px) {
    .sidebar-form { display: none; }
    .wrapper-form .form-main { padding: 0; }
}

/* ════════════════════════════════════════════════════════════
   SECCIÓN F — TABLA RESPONSIVA PARA MÓVIL
   En pantallas < 640px la tabla se convierte en cards apiladas
   ════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {

    /* Ocultar encabezados de la tabla */
    .table-wrap table thead { display: none; }

    /* Cada fila se convierte en una card */
    .table-wrap table,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap tbody tr {
        background: rgba(26,165,165,.06);
        border: 1px solid var(--border);
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 16px;
        position: relative;
        transition: background .2s;
    }

    .table-wrap tbody tr:hover {
        background: rgba(26,165,165,.10);
    }

    /* Cada celda muestra su etiqueta como data-label */
    .table-wrap tbody td {
        padding: 5px 0;
        font-size: 13px;
        white-space: normal;
        border: none;
        display: flex;
        align-items: flex-start;
        gap: 8px;
    }

    /* Etiqueta generada desde data-label */
    .table-wrap tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--muted);
        min-width: 80px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    /* Celda de acciones: bloque separado debajo */
    .table-wrap tbody td.actions-cell {
        display: block;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .table-wrap tbody td.actions-cell::before {
        display: none;
    }

    /* Las acciones en columna */
    .action-form {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .select-estado {
        flex: 1;
        min-width: 130px;
    }

    .btn-update, .btn-modify, .btn-print-turn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
        text-align: center;
    }

    .action-extra {
        margin-top: 6px;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Topbar: apilar elementos en móvil */
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    /* Stats en 2 col pequeñas en 640 */
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-value { font-size: 26px; }

    /* Búsqueda full-width */
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }
    #searchInput { width: 100%; }
    .search-wrap { width: 100%; }

    /* Calendario: días más compactos */
    .cal-grid { padding: 12px; }
    .cal-day  { min-height: 44px; padding: 4px; border-radius: 8px; }
    .cal-day-num { font-size: 10px; margin-bottom: 3px; }
    .cal-turn-chip { display: none; }  /* solo puntos en móvil */
    .cal-day.has-turns::after {
        content: '';
        display: block;
        width: 6px; height: 6px;
        border-radius: 50%;
        background: var(--green);
        margin: 2px auto 0;
    }
    .cal-day.has-turns.has-pending::after { background: var(--amber); }
    .cal-weekday { font-size: 9px; padding: 4px 2px; }
    .cal-month-label { font-size: 14px; min-width: 130px; }
    .cal-legend { display: none; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
    .main  { padding: 14px 12px; }
}