/* ============================================================
   Sistema de Registro de Turnos para Cajeras
   Tema visual  ·  Paleta: teal (marca) + neutros + ámbar (acento)
   ============================================================ */

:root {
    --brand:        #0f766e;   /* teal 700 */
    --brand-dark:   #115e59;   /* teal 800 */
    --brand-light:  #ccfbf1;   /* teal 100 */
    --accent:       #d97706;   /* amber 600 */
    --ink:          #0f172a;   /* slate 900 */
    --muted:        #64748b;   /* slate 500 */
    --line:         #e2e8f0;   /* slate 200 */
    --bg:           #f1f5f9;   /* slate 100 */
    --surface:      #ffffff;
    --success:      #16a34a;
    --danger:       #dc2626;
    --warning:      #d97706;
    --radius:       12px;
    --shadow:       0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg:    0 10px 30px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    line-height: 1.5;
}

/* ---------------- Layout de administración ---------------- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 260px;
    background: var(--ink);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
}

.brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1.25rem 1.25rem;
    font-size: 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand i { color: var(--brand-light); font-size: 1.5rem; }
.brand strong { color: var(--brand-light); }

.admin-nav { display: flex; flex-direction: column; padding: 1rem .75rem; gap: .25rem; flex: 1; }
.admin-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .85rem;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .95rem;
    transition: background .15s, color .15s;
}
.admin-nav a i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }

.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.link-public { color: #94a3b8; text-decoration: none; font-size: .85rem; display: flex; gap: .5rem; align-items: center; }
.link-public:hover { color: #fff; }

.admin-main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; }

.admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .85rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: .85rem; }
.user-name { color: var(--muted); font-size: .9rem; }
.btn-menu { display: none; background: none; border: none; font-size: 1.5rem; color: var(--ink); cursor: pointer; }

.admin-content { padding: 1.5rem; max-width: 1200px; width: 100%; }

/* ---------------- Tarjetas / KPIs ---------------- */
.card-v {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-v .card-v-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.card-v .card-v-head h2 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.card-v .card-v-body { padding: 1.25rem; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 1rem;
}
.kpi-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.5rem;
    background: var(--brand-light); color: var(--brand-dark);
    flex-shrink: 0;
}
.kpi-icon.amber { background: #fef3c7; color: #b45309; }
.kpi-icon.slate { background: #e2e8f0; color: #334155; }
.kpi-icon.green { background: #dcfce7; color: #15803d; }
.kpi-data .kpi-num { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.kpi-data .kpi-label { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

/* ---------------- Tablas ---------------- */
.table-v { width: 100%; border-collapse: collapse; }
.table-v th, .table-v td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .9rem; }
.table-v th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; background: #f8fafc; }
.table-v tbody tr:hover, .table-v tr:hover { background: #f8fafc; }

/* ---------------- Badges ---------------- */
.badge-v { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-muted   { background: #e2e8f0; color: #475569; }

/* Barra de cupos */
.cupo-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.cupo-bar > span { display: block; height: 100%; background: var(--brand); }
.cupo-bar.full > span { background: var(--danger); }
.cupo-bar.mid > span { background: var(--accent); }

/* ---------------- Botones (extiende Bootstrap) ---------------- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background:
    radial-gradient(1200px 600px at 100% 0, rgba(15,118,110,.12), transparent),
    var(--bg); padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-head { background: var(--ink); color: #fff; padding: 1.75rem; text-align: center; }
.login-head i { font-size: 2.25rem; color: var(--brand-light); }
.login-head h1 { font-size: 1.15rem; margin: .5rem 0 0; }
.login-head p { color: #94a3b8; font-size: .85rem; margin: .25rem 0 0; }
.login-body { padding: 1.75rem; }

/* ---------------- Formulario público ---------------- */
.public-body { background:
    radial-gradient(1000px 500px at 0 0, rgba(15,118,110,.10), transparent),
    var(--bg); min-height: 100vh; }
.public-wrap { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.public-header { text-align: center; margin-bottom: 1.75rem; }
.public-header .chip { display: inline-flex; gap: .4rem; align-items: center; background: var(--brand-light); color: var(--brand-dark); padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.public-header h1 { font-size: 1.75rem; margin: .75rem 0 .35rem; }
.public-header p { color: var(--muted); margin: 0; }
.public-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 1.75rem; margin-bottom: 1.5rem; }
.public-card h2 { font-size: 1.1rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }

.turno-option { border: 2px solid var(--line); border-radius: 12px; padding: 1rem; cursor: pointer; transition: border-color .15s, background .15s; display: block; margin-bottom: .75rem; }
.turno-option:hover { border-color: var(--brand); }
.turno-option.selected { border-color: var(--brand); background: var(--brand-light); }
.turno-option.disabled { opacity: .55; cursor: not-allowed; }
.turno-option input { display: none; }
.turno-option .to-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.turno-option .to-date { font-weight: 600; }
.turno-option .to-meta { color: var(--muted); font-size: .85rem; margin-top: .35rem; }

.form-label { font-weight: 600; font-size: .9rem; }
.req-mark { color: var(--danger); }

/* Estado vacío */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; opacity: .4; }

/* Constructor de formulario */
.field-row { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: .6rem; }
.field-row.is-disabled { opacity: .55; }
.field-drag { cursor: grab; color: var(--muted); font-size: 1.15rem; }
.field-info { flex: 1; }
.field-info .fi-label { font-weight: 600; }
.field-info .fi-meta { color: var(--muted); font-size: .8rem; }
.field-type-chip { background: var(--brand-light); color: var(--brand-dark); padding: .15rem .55rem; border-radius: 6px; font-size: .72rem; font-weight: 600; }

/* Selección de turnos en enlaces */
.enlace-turnos-list { max-height: 460px; overflow-y: auto; padding-right: .25rem; }
.turno-check { display: flex; align-items: flex-start; gap: .75rem; border: 2px solid var(--line); border-radius: 10px; padding: .75rem .9rem; margin-bottom: .6rem; cursor: pointer; transition: border-color .15s, background .15s; }
.turno-check:hover { border-color: var(--brand); }
.turno-check.selected { border-color: var(--brand); background: var(--brand-light); }
.turno-check input { margin-top: .25rem; accent-color: var(--brand); }
.turno-check .tc-body { flex: 1; }
.turno-check .tc-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 600; }
.turno-check .tc-meta { color: var(--muted); font-size: .82rem; margin-top: .3rem; }

/* Impresión de reportes */
@media print {
    .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
    .admin-main { margin-left: 0; }
    body { background: #fff; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
    .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .btn-menu { display: block; }
}
