:root {
    --bg: #f3efe6;
    --ink: #172033;
    --muted: #5d6572;
    --line: #e3dac8;
    --card: #fffdf8;
    --amber: #e09a2b;
    --teal: #0f6e6a;
    --teal-deep: #0c4f4c;
    --red: #a33b32;
    --ok: #2c7a45;
    --shadow: 0 20px 50px rgba(23, 32, 51, .08);
    --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--bg);
    font-size: 16px;
}
a { color: var(--teal-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 560; letter-spacing: -.03em; margin: 0; }
h1 { font-size: 2.1rem; line-height: 1.05; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--muted); margin: 0 0 .4rem; }
.flash { padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.flash.ok { background: #e5f4ea; color: #1d5c32; }
.flash.err { background: #fde8e4; color: #8a2b24; }
.btn, button.btn {
    border: 0; border-radius: 999px; padding: .75rem 1.1rem; background: transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.solid { background: var(--ink); color: white; }
.btn.ghost { border: 1px solid var(--line); background: white; }
.btn.light { background: white; color: var(--ink); }
.btn.danger { background: var(--red); color: white; }
.btn.xl { padding: 1rem 1.4rem; font-size: 1.15rem; }
.linkish { background: none; border: 0; color: var(--red); padding: 0; cursor: pointer; }
.empty { color: var(--muted); }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #f4efe4; padding: 22px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; }
.brand small { color: #b7c0cc; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--amber); color: var(--ink); font-family: var(--display); font-size: 1.4rem; }
.side nav, .side-links { display: flex; flex-direction: column; gap: 4px; }
.side nav a, .side-links a { color: #d5dbe3; text-decoration: none; padding: .55rem .7rem; border-radius: 10px; }
.side nav a.is-active, .side nav a:hover { background: rgba(255,255,255,.08); color: white; }
.side-links { margin-top: auto; }
.side-links a { font-size: .92rem; }
.side-user { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.side-user strong, .side-user small { display: block; }
.side-user small { color: #b7c0cc; margin: .2rem 0 .5rem; }
.side-user .linkish { color: #f0c27a; }
.main { padding: 32px 36px 64px; }
.page-head, .head-actions, .filters, .row-actions, .desk-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.page-head { margin-bottom: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stats article, .card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.stats article { padding: 16px 18px; }
.stats span, .stats small { color: var(--muted); display: block; }
.stats strong { font-family: var(--display); font-size: 2.4rem; }
.public-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.public-links div { background: white; border-radius: 14px; padding: 12px 14px; border: 1px dashed var(--line); }
.public-links span { display: block; color: var(--muted); font-size: .8rem; }
.public-links code { font-size: .82rem; word-break: break-all; }
.card { padding: 18px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tag { font-style: normal; background: #f8e7c8; color: #7a5410; border-radius: 999px; padding: .1rem .45rem; font-size: .75rem; }
.estado { font-size: .85rem; }
.estado-finalizado { color: var(--ok); }
.estado-ausente, .estado-cancelado { color: var(--red); }
.estado-llamado, .estado-atencion { color: var(--teal-deep); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.narrow { max-width: 560px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
input, select, textarea { background: white; border: 1px solid #d9d0c0; border-radius: 12px; padding: .7rem .8rem; }
.check { flex-direction: row; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 14px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swatch { width: 14px; height: 14px; border-radius: 99px; display: inline-block; }
.row-actions form { display: inline; }
.module-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.module-row small, .module-row p { display: block; color: var(--muted); margin: .2rem 0; }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; margin: .45rem 0; }
.bars i { display: block; height: 10px; background: var(--teal); border-radius: 99px; }
.filters label { font-size: .85rem; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-hero { background: var(--ink); color: #f6f1e7; padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; }
.login-hero h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); max-width: 12ch; }
.login-hero p { max-width: 38ch; color: #c9d1db; }
.hero-ticket { margin-top: 28px; width: 220px; background: #f4efe4; color: var(--ink); border-radius: 16px; padding: 18px 18px 22px; }
.hero-ticket span, .hero-ticket em { display: block; color: var(--muted); font-style: normal; }
.hero-ticket strong { font-family: var(--display); font-size: 3.2rem; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.fineprint { color: var(--muted); }
.center-note { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 24px; }

.kiosk-body { background: radial-gradient(circle at top left, #fff 0, transparent 28%), var(--bg); }
.kiosk-top, .screen-top { display: flex; justify-content: space-between; gap: 16px; align-items: end; padding: 28px 32px 0; }
.kiosk-lead { padding: 8px 32px 0; color: var(--muted); }
.clock { font-family: var(--display); font-size: 2rem; }
.kiosk-tools { display: flex; gap: 18px; align-items: end; padding: 18px 32px; }
.kiosk-tools label { min-width: 280px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 8px 32px 40px; }
.service-card { min-height: 210px; border: 0; border-radius: 24px; padding: 20px; text-align: left; color: white; background: var(--card, var(--teal)); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; box-shadow: var(--shadow); cursor: pointer; }
.service-card .prefix { font-family: var(--display); font-size: 1.4rem; opacity: .8; }
.service-card strong { font-size: 1.7rem; }
.service-card em { font-style: normal; opacity: .85; }
.service-card small { margin-top: auto; background: rgba(0,0,0,.18); border-radius: 999px; padding: .25rem .6rem; }

.print-page { background: #efeae1; }
.ticket { width: 80mm; margin: 24px auto; background: white; color: #1a1a1a; padding: 18px 16px 22px; text-align: center; }
.ticket h1 { font-size: 64px; margin: 4px 0; }
.ticket-brand { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 0; }
.ticket-city, .ticket-label, .ticket-msg, .ticket-ahead { color: #555; }
.ticket-service { font-size: 1.2rem; margin: 0; }
.ticket-pref { color: var(--red); font-weight: 700; }
.ticket-actions { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; }
@media print {
    .no-print { display: none !important; }
    .print-page { background: white; }
    .ticket { margin: 0; box-shadow: none; }
    @page { size: 80mm auto; margin: 4mm; }
}

.screen { background: #050505; color: #1c1c1c; min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.board { width: min(1180px, 100%); background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.board-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px 6px; }
.board-top strong { font-size: .95rem; letter-spacing: .04em; }
.board-top .clock { font-family: var(--sans); font-weight: 700; font-size: 1.7rem; }
.board-main { display: grid; grid-template-columns: 1.25fr .75fr; min-height: 62vh; }
.board-media { position: relative; background: #f6b5a4; min-height: 360px; }
.board-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #f6b5a4; }
.board-media-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #7a3b32; }
.board-media-empty[hidden] { display: none !important; }
.board-media-empty strong { font-family: var(--display); font-size: 2.4rem; }
.board-calls { background: #f15a29; color: white; padding: 18px 16px; }
.board-calls table { border-collapse: separate; border-spacing: 0 8px; }
.board-calls th { font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; border: 0; padding: 0 8px 4px; color: white; }
.board-calls td { border: 0; background: transparent; font-weight: 700; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; padding: 8px; }
.board-calls tbody tr { background: rgba(255,255,255,.08); }
.board-calls tbody td { border-top: 3px solid #fff; }
.board-wait { font-size: 1.3rem !important; font-weight: 600; }
.board-foot { background: #e24b1c; color: white; text-align: center; padding: 10px 16px; font-weight: 700; }
.voice-btn { position: fixed; right: 24px; bottom: 24px; border: 0; border-radius: 999px; padding: .8rem 1rem; background: #fff; color: var(--ink); cursor: pointer; }

.rate-body { background: #f7f1e6; }
.rate-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px; }
.rate-wrap h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); max-width: 14ch; }
.rate-code { font-family: var(--display); font-size: 4rem; margin: 0; }
.rate-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 18px; }
.rate-grid button { min-height: 120px; border: 0; border-radius: 20px; color: white; font-size: 1.15rem; cursor: pointer; }
.rate-5 { background: #2c7a45; }
.rate-4 { background: #0f6e6a; }
.rate-3 { background: #c4892a; }
.rate-2 { background: #b8612d; }
.rate-1 { background: #a33b32; }
.module-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.module-pick a { background: white; border-radius: 20px; padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.module-pick span { color: var(--muted); }

.desk { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.now-desk { background: var(--ink); color: white; border-radius: 28px; padding: 28px; min-height: 360px; }
.now-desk strong { display: block; font-family: var(--display); font-size: 6rem; line-height: .9; }
.now-desk span, .now-desk em { color: #f0c27a; font-style: normal; }
.desk-actions { margin: 18px 0; }
.transfer { display: flex; gap: 8px; align-items: center; }
.transfer select { background: #243044; color: white; border-color: #243044; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { background: var(--card, var(--teal)); color: white; border-radius: 999px; padding: .25rem .7rem; }
.queue { list-style: none; padding: 0; margin: 0; }
.queue li { display: flex; gap: 10px; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.queue b { font-family: var(--display); font-size: 1.4rem; }
.queue small { margin-left: auto; color: var(--muted); }

@media (max-width: 980px) {
    .app, .login-shell, .split, .desk, .board-main, .stats, .public-links, .rate-grid { grid-template-columns: 1fr; }
    .side { position: relative; height: auto; }
    .main, .login-hero, .login-panel { padding: 22px; }
    .now-call strong, .now-desk strong { font-size: 5rem; }
}
