/* ==========================================================
   SAO-Agent · Kiosko Claro (UI basada en mock SAO Kiosko UI)
   ========================================================== */

:root {
    --claro-red: #DA291C;
    --claro-red-dark: #A31E13;
    --claro-black: #111111;
    --claro-grey: #f4f4f5;
    --claro-grey-2: #e4e4e7;
    --claro-text: #1c1c1e;
    --claro-muted: #6b7280;
    --kiosk-bg: #FAF8F7;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-tile: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius: 18px;
    font-size: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #0a0a0a;
    color: var(--claro-text);
    user-select: none;
    -webkit-user-select: none;
}

/* ---------- Viewport + stage (1280×800, escalado) ---------- */
#kiosk-viewport {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.kiosk-stage {
    width: 1280px;
    height: 800px;
    position: relative;
    overflow: hidden;
    background: var(--kiosk-bg);
    transform-origin: center center;
}

body.kiosk-page {
    overflow: hidden;
    background: #0a0a0a;
}
body.kiosk-page #kiosk-viewport {
    width: 100vw;
    height: 100dvh;
    display: block;
}
body.kiosk-page .kiosk-stage {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    transform: none !important;
}

.kiosk-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* ---------- Standby ---------- */
.standby {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: row;
    cursor: pointer;
    background: #fff;
    overflow: hidden;
}
.standby--hidden {
    display: none !important;
}

.standby-left {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
    position: relative;
    z-index: 2;
    gap: 44px;
}
.standby-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--claro-red);
}

.standby-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}
.standby-right iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    border: none;
    pointer-events: none;
}
.standby-right::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to right, rgba(255,255,255,0.18) 0%, transparent 20%);
    pointer-events: none;
}

.standby-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
    width: 100%;
}

.standby-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.02); }
}

.standby-claro-logo { display: flex; align-items: center; }
.standby-claro-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--claro-red);
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(218, 41, 28, 0.35);
}
.standby-claro-name {
    font-size: 62px;
    font-weight: 800;
    color: var(--claro-red);
    letter-spacing: -3px;
    line-height: 1;
}
.standby-claro-tagline {
    font-size: 13px;
    color: #aaa;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.standby-sao-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    padding: 9px 18px;
    border-radius: 50px;
    border: 1px solid #eee;
}
.standby-sao-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}
.standby-sao-label { font-size: 13px; font-weight: 600; color: #666; }

.standby-cta { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.standby-tap-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid rgba(218, 41, 28, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(218, 41, 28, 0.04);
    animation: ringPulse 2.5s ease-in-out infinite;
}
.standby-tap-ring::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 1.5px solid rgba(218, 41, 28, 0.18);
    animation: ringPulse 2.5s ease-in-out infinite 0.4s;
}
.standby-tap-ring::after {
    content: '';
    position: absolute;
    inset: -28px;
    border-radius: 50%;
    border: 1px solid rgba(218, 41, 28, 0.09);
    animation: ringPulse 2.5s ease-in-out infinite 0.8s;
}
@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.7; }
}

.standby-tap-icon { width: 38px; height: 38px; }
.standby-tap-label { font-size: 20px; font-weight: 700; color: #111; }
.standby-tap-sub { font-size: 13px; color: #bbb; font-weight: 500; margin-top: -8px; }

.standby-time {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.standby-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 520px;
    text-align: center;
    font-size: 11px;
    color: #ccc;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ---------- Top bar + main (kiosko activo) ---------- */
.kiosk-topbar {
    height: 68px;
    background: #111;
    display: flex;
    align-items: center;
    padding: 0 32px;
    flex-shrink: 0;
    gap: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.header-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--claro-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}
.header-logo-text { margin-left: 2px; }
.header-title { font-size: 16px; font-weight: 700; color: #fff; }
.header-sub { font-size: 11px; color: rgba(255, 255, 255, 0.45); font-weight: 500; }
.header-spacer { flex: 1; }
.header-clock {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.kiosk-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

/* Pantallas */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}
.screen.is-active { display: flex; }

.screen-home {
    padding: 48px 56px 32px;
    background: var(--kiosk-bg);
    overflow: hidden;
}

.screen-detail {
    padding: 36px 56px 40px;
    overflow-y: auto;
    background: var(--kiosk-bg);
    max-width: 100%;
}

.screen-detail--call .call-stage {
    margin-top: 8px;
}

.call-doc-row {
    margin-bottom: 14px;
    max-width: 760px;
}

.inline-doc-input {
    display: flex;
    gap: 10px;
}

.inline-doc-input input {
    flex: 1;
}

.screen-language {
    justify-content: center;
    align-items: center;
    padding: 32px;
    background: var(--kiosk-bg);
}

.language-card {
    width: min(680px, 100%);
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 36px 32px;
    text-align: center;
}

.language-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.home-heading { margin-bottom: 28px; }
.home-title {
    font-size: 36px;
    font-weight: 800;
    color: #111;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0;
}
.home-subtitle {
    font-size: 16px;
    color: #888;
    font-weight: 500;
    margin: 8px 0 0;
}

.screen-title {
    font-size: clamp(26px, 3vw, 38px);
    margin: 0 0 8px;
    color: var(--claro-black);
}
.screen-sub {
    color: var(--claro-muted);
    margin: 0 0 24px;
    font-size: 17px;
}

/* ---------- Tiles (menú) ---------- */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 16px;
    flex: 1;
    align-content: start;
}

.menu-tile {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-tile);
    color: inherit;
    font: inherit;
    text-align: left;
}
.menu-tile:hover,
.menu-tile:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--claro-red);
    outline: none;
}
.menu-tile:active { transform: translateY(0); }

.tile-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--claro-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tile-icon-wrap--lg {
    width: 64px;
    height: 64px;
    border-radius: 18px;
}
.tile-svg {
    width: 26px;
    height: 26px;
}
.tile-svg--lg {
    width: 32px;
    height: 32px;
}

.tile-body { display: flex; flex-direction: column; gap: 5px; }
.tile-name { font-size: 17px; font-weight: 700; color: #111; line-height: 1.2; }
.tile-desc { font-size: 13px; color: #888; font-weight: 500; line-height: 1.4; }

.menu-tile--agent {
    grid-column: span 2;
    background: #111;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
}
.menu-tile--agent:hover,
.menu-tile--agent:focus {
    border-color: var(--claro-red);
    background: #1a1a1a;
}
.menu-tile--agent .tile-icon-wrap { background: var(--claro-red); }
.menu-tile--agent .tile-name { font-size: 20px; color: #fff; }
.menu-tile--agent .tile-desc { font-size: 14px; color: rgba(255, 255, 255, 0.5); }
.menu-tile--agent .tile-body { flex: 1; }

.tile-agent-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(218, 41, 28, 0.15);
    color: var(--claro-red);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tile-agent-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(218, 41, 28, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s;
}
.menu-tile--agent:hover .tile-agent-arrow { background: rgba(218, 41, 28, 0.3); }

@media (max-width: 900px) {
    .tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .menu-tile--agent {
        grid-column: span 2;
    }
}

/* ---------- Footer kiosko ---------- */
.kiosk-footer {
    height: 44px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.kiosk-footer-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.kiosk-footer-link:hover {
    color: rgba(255, 255, 255, 0.45);
}

/* ---------- Formularios ---------- */
.form-row { display: grid; gap: 8px; margin-bottom: 18px; }
.form-row label { font-weight: 600; color: var(--claro-black); }
.form-row input,
.form-row select,
.form-row textarea {
    padding: 16px 18px;
    border: 2px solid var(--claro-grey-2);
    border-radius: 14px;
    font-size: 18px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--claro-red);
}

.actions-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
    padding: 16px 28px;
    border-radius: 14px;
    border: none;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.btn-primary { background: var(--claro-red); color: #fff; box-shadow: 0 10px 24px rgba(218, 41, 28, 0.25); }
.btn-primary:hover { background: var(--claro-red-dark); }
.btn-secondary { background: var(--claro-black); color: #fff; }
.btn-ghost { background: transparent; color: var(--claro-black); border: 2px solid var(--claro-grey-2); }
.btn-danger { background: #d72525; color: #fff; }
.btn-primary:disabled,
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Resultados / cards ---------- */
.result-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-top: 18px;
}
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 18px; font-size: 17px; }
.kv dt { color: var(--claro-muted); }
.kv dd { margin: 0; font-weight: 600; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.plan-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: border-color 0.15s;
    cursor: pointer;
}
.plan-card:hover { border-color: var(--claro-red); }
.plan-card h4 { margin: 0 0 6px; font-size: 22px; }
.plan-card .price { font-size: 28px; color: var(--claro-red); font-weight: 800; }
.plan-card p { color: var(--claro-muted); margin: 6px 0 0; }

/* ---------- Llamada con agente ---------- */
.call-stage {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) {
    .call-stage { grid-template-columns: 1fr; }
}

.video-wrap {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
    box-shadow: var(--shadow);
}
.video-wrap [id^="agora-video-player-"] {
    background: #000 !important;
}
.agora_video_player {
    object-fit: cover !important;
    mix-blend-mode: normal !important;
    filter: none !important;
    image-rendering: auto !important;
    background: #000 !important;
}
.video-wrap .placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    opacity: 0.6;
    font-size: 18px;
    text-align: center;
    padding: 20px;
}
.video-local {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 200px;
    height: 130px;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #fff;
}

.id-capture-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: grid;
    place-items: center;
    padding: 18px;
    z-index: 4;
}
.id-capture-overlay[hidden] {
    display: none !important;
}

.keypad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 20px;
}
.keypad-overlay[hidden] {
    display: none !important;
}

.transfer-ticket-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 16px;
}
.transfer-ticket-overlay[hidden] {
    display: none !important;
}
.transfer-ticket-card {
    width: min(460px, 96vw);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding: 18px;
    text-align: center;
}
.transfer-ticket-data {
    text-align: left;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    display: grid;
    gap: 6px;
}
.transfer-qr-wrap {
    display: grid;
    place-items: center;
    min-height: 120px;
    margin-bottom: 8px;
}
.transfer-qr-wrap img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.keypad-card {
    width: min(380px, 96vw);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    padding: 16px;
}

.keypad-card h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

.keypad-display {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.keypad-grid button {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px;
    background: #fafafa;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.keypad-grid button:hover {
    background: #f3f4f6;
}

.id-capture-card {
    width: min(520px, 96%);
    background: rgba(17, 17, 17, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    text-align: center;
}

.id-capture-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.id-capture-card p {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.id-guide-rect {
    width: 100%;
    aspect-ratio: 1.6 / 1;
    border: 3px dashed #f87171;
    border-radius: 14px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.03);
}

.id-capture-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    background: #000;
}

.id-guide-label {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.62);
    border: 1px solid rgba(248, 113, 113, 0.7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.call-side {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    background: #fff7e6;
    color: #b54708;
}
.status-pill.is-connected { background: #ecfdf5; color: #057a55; }
.status-pill.is-error { background: #fef2f2; color: #b91c1c; }
.status-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.6); opacity: 0.4; }
}

/* ---------- Alertas ---------- */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 10px 0;
    font-weight: 600;
}
.alert-ok { background: #ecfdf5; color: #047857; }
.alert-error { background: #fef2f2; color: #b91c1c; }
.alert ul { margin: 6px 0 0 18px; }

/* ---------- Install ---------- */
body.install-page { overflow: auto; }
.install-page { display: grid; place-items: center; min-height: 100vh; padding: 40px; }
.install-card {
    background: #fff;
    padding: 32px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 640px;
    width: 100%;
}
.muted { color: var(--claro-muted); }

/* ---------- Operador (panel) ---------- */
.operator-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100dvh;
}
.operator-sidebar {
    background: var(--claro-black);
    color: #fff;
    padding: 24px 20px;
    overflow-y: auto;
}
.operator-sidebar h2 { color: #fff; }
.operator-main {
    padding: 28px 32px;
    background: var(--claro-grey);
    height: 100dvh;
    overflow-y: auto;
}
body.operator-page {
    overflow: auto;
    background: var(--claro-grey);
}

/* Marca compacta en panel operador */
.operator-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.operator-sidebar .brand-mark {
    width: 64px;
    height: 64px;
    background: var(--claro-red);
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 1px;
}
.operator-sidebar .brand-text { line-height: 1.1; }
.operator-sidebar .brand-text small { color: #d1d5db; font-weight: 400; }

.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.queue-item {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.queue-item:hover { background: var(--claro-red); }
.queue-item small { color: #d1d5db; display: block; }

.operator-main .screen-title { margin-top: 0; }

.operator-video-column {
    display: grid;
    gap: 14px;
}

.operator-doc-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.operator-doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.operator-doc-item {
    margin: 0;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
}

.operator-doc-item figcaption {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.operator-doc-item img {
    width: 100%;
    aspect-ratio: 1.6 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    display: block;
}

.operator-doc-placeholder {
    width: 100%;
    aspect-ratio: 1.6 / 1;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 13px;
}

.quick-actions {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fafafa;
    display: grid;
    gap: 8px;
}

@media (max-width: 1200px) {
    .operator-shell {
        grid-template-columns: 1fr;
        height: auto;
    }
    .operator-sidebar {
        padding: 16px;
        overflow: visible;
    }
    .operator-main {
        padding: 16px;
        height: auto;
        overflow: visible;
    }
    .operator-main .call-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .operator-doc-grid {
        grid-template-columns: 1fr;
    }
    .video-local {
        width: 140px;
        height: 94px;
    }
}

/* ---------- Login ---------- */
body.login-page { overflow: auto; }
.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #111 0%, #DA291C 100%);
}
.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 8px; }
.login-card .muted { margin: 0 0 18px; }

/* ---------- Responsive tuning (no functional changes) ---------- */
@media (max-width: 1100px) {
    .screen-home { padding: 28px 24px 20px; }
    .screen-detail { padding: 24px 24px 26px; }
    .kiosk-topbar { padding: 0 16px; }
    .header-clock { font-size: 20px; }
    .home-title { font-size: 30px; }
}

@media (max-width: 900px) {
    .standby { flex-direction: column; }
    .standby-left,
    .standby-footer {
        width: 100%;
    }
    .standby-left {
        padding: 24px 18px;
        gap: 20px;
    }
    .standby-right {
        min-height: 40dvh;
    }
    .standby-claro-name {
        font-size: 48px;
        letter-spacing: -2px;
    }
}

@media (max-width: 700px) {
    :root { font-size: 16px; }
    .kiosk-topbar {
        height: auto;
        min-height: 60px;
        padding: 10px 12px;
    }
    .header-logo { gap: 8px; }
    .header-badge {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        font-size: 12px;
    }
    .header-title { font-size: 14px; }
    .header-sub { display: none; }
    .header-clock { font-size: 18px; }

    .kiosk-main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .home-title { font-size: 26px; }
    .home-subtitle { font-size: 15px; }
    .screen-title { font-size: 24px; }
    .screen-sub { font-size: 15px; margin-bottom: 16px; }

    .screen-home {
        height: 100%;
        max-height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    .tiles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-bottom: 10px;
    }
    .menu-tile {
        padding: 18px 16px;
        gap: 12px;
        border-radius: 16px;
    }
    .menu-tile--agent {
        grid-column: span 1;
        padding: 20px 16px;
        gap: 14px;
    }
    .menu-tile--agent .tile-name { font-size: 18px; }
    .menu-tile--agent .tile-desc { font-size: 13px; }
    .tile-agent-badge {
        top: 12px;
        right: 12px;
        font-size: 10px;
        padding: 3px 8px;
    }
    .tile-agent-arrow {
        width: 34px;
        height: 34px;
    }

    .screen-language { padding: 20px 12px; }
    .language-card {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .inline-doc-input {
        flex-direction: column;
        align-items: stretch;
    }
    .inline-doc-input .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        font-size: 16px;
        padding: 13px 14px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .btn-danger {
        font-size: 16px;
        padding: 12px 16px;
    }

    .actions-row {
        gap: 10px;
    }
    .actions-row > .btn-primary,
    .actions-row > .btn-secondary,
    .actions-row > .btn-ghost,
    .actions-row > .btn-danger,
    .actions-row > a.btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .call-stage { gap: 12px; }
    .call-side { padding: 14px; }
    .video-local {
        width: 128px;
        height: 84px;
        right: 10px;
        bottom: 10px;
    }

    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .plans-grid { grid-template-columns: 1fr; }
    .result-card { padding: 16px; }

    .kiosk-footer {
        height: auto;
        min-height: 44px;
        padding: 8px 12px;
        text-align: center;
        flex-wrap: wrap;
    }

    .operator-sidebar .brand {
        gap: 10px;
    }
    .operator-sidebar .brand-mark {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .screen-home { padding: 20px 12px 14px; }
    .screen-detail { padding: 18px 12px 20px; }
    .home-heading { margin-bottom: 18px; }
    .home-title { font-size: 24px; }
    .screen-title { font-size: 22px; }

    .standby-time { top: 12px; font-size: 12px; }
    .standby-footer {
        bottom: 12px;
        font-size: 10px;
    }
    .standby-claro-name { font-size: 42px; }
    .standby-tap-ring {
        width: 76px;
        height: 76px;
    }
    .standby-tap-icon {
        width: 30px;
        height: 30px;
    }

    .login-page { padding: 14px; }
    .login-card {
        padding: 20px 14px;
        border-radius: 14px;
    }
}
