/* ==========================================================
   Fichajes · diseño compartido (web, MAUI BlazorWebView)
   ========================================================== */

.status-bar-safe-area { height: env(safe-area-inset-top); }
.loading-progress { display: block; width: 7rem; height: 7rem; margin: 22vh auto 1rem; }
.loading-progress circle { fill: none; stroke: #e2e8f0; stroke-width: 6px; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--fj-primary); stroke-linecap: round; stroke-dasharray: 90 200; animation: fj-giro 1s linear infinite; }
@keyframes fj-giro { to { transform: rotate(270deg); } }
#blazor-error-ui { display: none; background: #b91c1c; color: #fff; bottom: 0; left: 0; width: 100%; padding: .6rem 1.25rem; position: fixed; z-index: 1000; }
#blazor-error-ui .reload { color: #fff; font-weight: 700; margin-left: .5rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .5rem; }

:root {
    --fj-primary: #4f46e5;
    --fj-primary-2: #7c3aed;
    --fj-primary-soft: #eef2ff;
    --fj-ink: #0f172a;
    --fj-ink-2: #334155;
    --fj-muted: #64748b;
    --fj-line: #e2e8f0;
    --fj-bg: #f5f7fb;
    --fj-card: #ffffff;
    --fj-ok: #059669;
    --fj-ok-soft: #d1fae5;
    --fj-warn: #d97706;
    --fj-warn-soft: #fef3c7;
    --fj-danger: #e11d48;
    --fj-danger-soft: #ffe4e6;
    --fj-radius: 16px;
    --fj-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
    --fj-shadow-lg: 0 24px 60px -20px rgba(79, 70, 229, .35);
}

html, body {
    background: var(--fj-bg);
    color: var(--fj-ink);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h1:focus, h1:focus-visible { outline: none; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
code { color: var(--fj-primary); background: var(--fj-primary-soft); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.eyebrow { display: inline-block; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--fj-primary); font-weight: 700; margin-bottom: 4px; }
.text-muted { color: var(--fj-muted) !important; }
.text-success { color: var(--fj-ok) !important; }
.text-danger { color: var(--fj-danger) !important; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--fj-ink-2); margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 10px; border-color: var(--fj-line); padding: .55rem .75rem; font-size: .95rem; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99, 102, 241, .15); }
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; transition: transform .08s, box-shadow .2s, background .2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--fj-primary), var(--fj-primary-2)); border: 0; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #4338ca, #6d28d9); }
.btn-outline-secondary { border-color: var(--fj-line); color: var(--fj-ink-2); background: #fff; }
.btn-outline-secondary:hover { background: var(--fj-bg); color: var(--fj-ink); }
.btn-outline-primary { color: var(--fj-primary); border-color: #c7d2fe; }
.btn-outline-primary:hover { background: var(--fj-primary-soft); color: var(--fj-primary); }
.btn-success { background: var(--fj-ok); border: 0; }
.btn-danger { background: var(--fj-danger); border: 0; }
.btn-outline-danger { color: var(--fj-danger); border-color: #fecdd3; }
.btn-outline-danger:hover { background: var(--fj-danger-soft); color: var(--fj-danger); }
.btn-sm { border-radius: 8px; padding: .3rem .65rem; font-size: .85rem; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child { border-radius: 0 10px 10px 0; }
.btn-group .btn.active { background: var(--fj-ink); color: #fff; border-color: var(--fj-ink); }
.alert { border: 0; border-radius: 12px; box-shadow: var(--fj-shadow); }
.alert-success { background: var(--fj-ok-soft); color: #065f46; }
.alert-danger { background: var(--fj-danger-soft); color: #9f1239; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 268px; color: #c7d2fe; position: sticky; top: 0; height: 100vh;
    background: radial-gradient(120% 60% at 0% 0%, #312e81 0%, #1e1b4b 45%, #0f0d2e 100%);
    display: flex; flex-direction: column; padding: 22px 16px; flex-shrink: 0;
}
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    display: flex; align-items: center; gap: 16px; padding: 14px 28px;
    background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--fj-line); position: sticky; top: 0; z-index: 10;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title strong { font-size: 1.02rem; display: block; }
.app-page { padding: 28px; max-width: 1440px; width: 100%; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 26px; }
.brand strong { color: #fff; display: block; line-height: 1.1; font-size: 1.05rem; }
.brand small { color: #a5b4fc; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 1.1rem;
    background: linear-gradient(135deg, #818cf8, #c084fc); box-shadow: 0 8px 20px -6px rgba(192, 132, 252, .7);
}
.brand-large .brand-mark { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 16px; }
.brand-large strong { color: var(--fj-ink) !important; font-size: 1.25rem; }
.brand-large small { color: var(--fj-muted); }

.app-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #818cf8; padding: 18px 12px 8px; font-weight: 700; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    color: #c7d2fe; text-decoration: none; font-size: .93rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }
.nav-item.active::before {
    content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #a5b4fc, #e879f9);
}
.nav-icon { width: 22px; text-align: center; font-size: 1rem; }
.sidebar-footer { font-size: .75rem; color: #818cf8; display: flex; align-items: center; gap: 8px; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }

.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: .92rem; }
.user-meta span { font-size: .76rem; color: var(--fj-muted); }
.avatar {
    width: 38px; height: 38px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-weight: 800;
    background: linear-gradient(135deg, #818cf8, #c084fc);
}
.btn-icon { border: 1px solid var(--fj-line); background: #fff; border-radius: 10px; padding: 4px 10px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-subtitle { color: var(--fj-muted); margin: 6px 0 0; max-width: 720px; }
.page-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40vh; color: var(--fj-muted); }
.empty-state { padding: 36px 24px; text-align: center; color: var(--fj-muted); }

.card {
    background: var(--fj-card); border: 1px solid rgba(226, 232, 240, .7); border-radius: var(--fj-radius);
    box-shadow: var(--fj-shadow); margin-bottom: 22px; overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--fj-line); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-body { padding: 20px; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .form-group { display: flex; flex-direction: column; gap: 4px; }
.toolbar label { font-size: .78rem; color: var(--fj-muted); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
    background: var(--fj-card); border-radius: var(--fj-radius); padding: 18px 20px; box-shadow: var(--fj-shadow);
    position: relative; overflow: hidden; border: 1px solid rgba(226, 232, 240, .7);
}
.stat::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #818cf8, #c084fc); }
.stat-label { font-size: .8rem; color: var(--fj-muted); font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.ok { color: var(--fj-ok); }
.stat-value.warn { color: var(--fj-warn); }

.table-wrap { overflow-x: auto; }
.table { margin: 0; font-size: .92rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fj-muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid var(--fj-line); padding: .8rem 1rem; }
.table td, .table th { vertical-align: middle; padding: .8rem 1rem; border-color: #f1f5f9; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbff; }
.row-void td { color: #94a3b8; text-decoration: line-through; }

.badge-ok, .badge-danger, .badge-warning, .badge-neutral {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.badge-ok::before, .badge-danger::before, .badge-warning::before, .badge-neutral::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge-ok { background: var(--fj-ok-soft); color: #047857; }
.badge-danger { background: var(--fj-danger-soft); color: #be123c; }
.badge-warning { background: var(--fj-warn-soft); color: #b45309; }
.badge-neutral { background: #eef2f7; color: #475569; }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: .84rem; font-weight: 700; background: #eef2f7; color: #475569; }
.estado-trabajando { background: var(--fj-ok-soft); color: #047857; }
.estado-pausa { background: var(--fj-warn-soft); color: #b45309; }
.estado-desconexion { background: #e0e7ff; color: #4338ca; }
.estado-espera { background: #fce7f3; color: #be185d; }
.estado-fuera { background: #eef2f7; color: #475569; }
.estado-neutro { background: #eef2f7; color: #475569; }
.estado-trabajando .dot, .estado-pausa .dot, .estado-desconexion .dot, .estado-espera .dot { background: currentColor; box-shadow: none; }

.tipo-entrada { color: var(--fj-ok); }
.tipo-salida { color: var(--fj-danger); }
.tipo-pausa { color: var(--fj-warn); }
.tipo-desconexion { color: #4f46e5; }
.tipo-espera { color: #db2777; }
.tipo-neutro { color: var(--fj-muted); }

.list-group-item.active { background: var(--fj-primary-soft); color: var(--fj-ink); border-color: var(--fj-line); font-weight: 700; box-shadow: inset 4px 0 0 var(--fj-primary); }
.list-group-item { border-color: #f1f5f9; padding: .75rem 1rem; }

/* ---------- Login ---------- */
.login-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 28px;
    background: radial-gradient(900px 500px at 10% 0%, #c7d2fe 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #f5d0fe 0%, transparent 55%), #f5f7fb;
}
.login-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; max-width: 1080px; width: 100%; align-items: center; }
.login-brand h1 { font-size: 2.6rem; font-weight: 800; margin: 26px 0 14px; line-height: 1.1; letter-spacing: -.03em; }
.login-brand h1 span { background: linear-gradient(135deg, var(--fj-primary), var(--fj-primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-brand p { color: var(--fj-ink-2); font-size: 1.05rem; }
.login-list { list-style: none; padding: 0; margin: 22px 0; }
.login-list li { padding: 7px 0 7px 30px; position: relative; color: var(--fj-ink-2); }
.login-list li::before {
    content: "✓"; position: absolute; left: 0; top: 7px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
    background: var(--fj-ok-soft); color: #047857; font-weight: 800; font-size: .8rem;
}
.login-foot { color: var(--fj-muted); font-size: .85rem; }
.alta-box { margin-top: 18px; text-align: center; font-size: .92rem; }
.alta-box .btn-link { color: var(--fj-primary); text-decoration: none; }
.alta-box .btn-link:hover { text-decoration: underline; }
.registro-card .card-body { padding: 34px; }
.confirmar-card { max-width: 520px; width: 100%; }
.confirmacion { text-align: center; }
.confirmacion h2 { margin: 6px 0 10px; }
.confirmacion p { color: var(--fj-ink-2); }
.confirmacion-icono { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 20px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; background: var(--fj-primary-soft); color: var(--fj-primary); }
.confirmacion-icono.ok { background: var(--fj-ok-soft); color: #047857; }
.confirmacion-icono.error { background: var(--fj-danger-soft); color: #be123c; }
.login-shell .confirmar-card { margin: 0 auto; }
.seccion-titulo { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--fj-muted); margin: 22px 0 10px; }
.paso-lista { list-style: none; padding: 0; margin: 0; }
.paso-lista li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.paso-lista li:last-child { border-bottom: 0; }
.paso-num { width: 28px; height: 28px; border-radius: 9px; background: var(--fj-primary-soft); color: var(--fj-primary); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.paso-lista a { color: var(--fj-ink); font-weight: 600; text-decoration: none; }
.paso-lista a:hover { color: var(--fj-primary); }
.login-card { box-shadow: var(--fj-shadow-lg); border-radius: 22px; }
.login-card .card-body { padding: 36px; }
.login-card .btn-primary { padding: .7rem 1rem; font-size: 1rem; }
.demo-box { margin-top: 24px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 14px; }
.demo-title { font-size: .72rem; font-weight: 800; color: var(--fj-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.demo-line { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--fj-line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: .85rem; text-align: left; transition: border-color .15s, transform .08s; }
.demo-line:hover { border-color: var(--fj-primary); transform: translateY(-1px); }
.demo-pass { font-size: .78rem; color: var(--fj-muted); margin-top: 6px; }

/* ---------- Fichar ---------- */
.fichar-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.clock-card {
    position: relative; overflow: hidden; border-radius: 24px; padding: 30px;
    background: linear-gradient(160deg, #ffffff 0%, #f5f3ff 100%); border: 1px solid #e0e7ff; box-shadow: var(--fj-shadow-lg);
}
.clock-card::before {
    content: ""; position: absolute; width: 380px; height: 380px; right: -140px; top: -160px; border-radius: 50%;
    background: radial-gradient(circle, rgba(192, 132, 252, .35), transparent 65%); pointer-events: none;
}
.clock-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; position: relative; }
.clock-date { color: var(--fj-muted); font-weight: 600; }
.clock-time {
    font-size: 5rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; text-align: center; margin: 14px 0 2px;
    background: linear-gradient(135deg, var(--fj-ink), #4338ca); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.clock-meta { text-align: center; color: var(--fj-muted); position: relative; }
.clock-progress { margin: 24px 0 16px; position: relative; }
.progress-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--fj-muted); margin-bottom: 8px; font-weight: 600; }
.progress { height: 12px; background: #e0e7ff; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #818cf8, #c084fc); border-radius: 999px; transition: width .5s; }
.day-context { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; position: relative; }
.context-item { background: rgba(255, 255, 255, .85); border: 1px solid #ede9fe; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.context-label { font-size: .7rem; color: var(--fj-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.context-item strong { font-size: .95rem; margin-top: 2px; }
.modalidad-switch { display: inline-flex; background: #eef2ff; border-radius: 14px; padding: 4px; margin: 4px 0 20px; position: relative; }
.switch-option { border: 0; background: transparent; padding: 8px 16px; border-radius: 11px; font-weight: 700; color: var(--fj-muted); }
.switch-option.selected { background: #fff; color: var(--fj-ink); box-shadow: 0 2px 8px rgba(79, 70, 229, .18); }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; position: relative; }
.action-btn {
    border: 0; border-radius: 18px; padding: 20px 14px; font-weight: 800; font-size: 1.02rem; color: #fff; min-height: 84px;
    display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--fj-primary);
    box-shadow: 0 10px 22px -10px currentColor; transition: transform .1s, filter .2s, opacity .2s;
}
.action-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.action-btn:active:not(:disabled) { transform: translateY(1px); }
.action-btn:disabled { opacity: .5; }
.action-btn.tipo-entrada { background: linear-gradient(135deg, #10b981, #059669); }
.action-btn.tipo-salida { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.action-btn.tipo-pausa { background: linear-gradient(135deg, #f59e0b, #d97706); }
.action-btn.tipo-desconexion { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.action-btn.tipo-espera { background: linear-gradient(135deg, #ec4899, #db2777); }
.geo-note { margin: 16px 0 0; color: var(--fj-muted); font-size: .85rem; position: relative; }
.anular-box { margin-top: 18px; border-top: 1px solid #ede9fe; padding-top: 12px; position: relative; }
.anular-form { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.anular-form input { flex: 1; min-width: 200px; }
.side-stack .card:last-child { margin-bottom: 0; }
.mini-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: .92rem; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat span { color: var(--fj-muted); }
.mini-stat strong { font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 10px 20px 16px; }
.timeline-item { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 28px; bottom: -4px; width: 2px; background: #e2e8f0; }
.timeline-item.is-void { opacity: .5; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 4px rgba(148, 163, 184, .12); }
.timeline-title { font-weight: 700; }
.timeline-meta { font-size: .82rem; color: var(--fj-muted); }
.timeline-note { font-size: .82rem; color: var(--fj-ink-2); font-style: italic; }

/* ---------- Calendario mensual ---------- */
.calendar { background: var(--fj-card); border: 1px solid rgba(226, 232, 240, .7); border-radius: var(--fj-radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--fj-shadow); }
.calendar-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.calendar-month { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.calendar-sub { color: var(--fj-muted); font-size: .9rem; }
.calendar-totals { display: flex; gap: 10px; font-size: .85rem; color: var(--fj-muted); flex-wrap: wrap; }
.calendar-totals span { background: #f1f5f9; border-radius: 999px; padding: 5px 12px; }
.calendar-totals strong { color: var(--fj-ink); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-weekday { text-align: center; font-size: .7rem; font-weight: 800; color: var(--fj-muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px; }
.calendar-day {
    position: relative; min-height: 88px; border: 1px solid #eef2f7; border-radius: 14px; background: #fff; padding: 8px 9px;
    display: flex; flex-direction: column; align-items: flex-start; text-align: left; font-size: .8rem; cursor: pointer;
    border-top: 4px solid var(--day-color, #e2e8f0); transition: transform .12s, box-shadow .15s, border-color .15s;
}
.calendar-day:hover { border-color: #c7d2fe; box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .45); transform: translateY(-1px); }
.calendar-day-empty { background: transparent; border: 0; cursor: default; box-shadow: none; transform: none; }
.calendar-day.is-weekend { background: #fafafa; }
.calendar-day.has-absence { background: #fff7ed; }
.calendar-day.has-work { background: #f0fdf4; }
.day-number { font-weight: 800; font-size: .95rem; }
.day-type { color: var(--fj-muted); font-size: .7rem; }
.day-absence { color: #9a3412; font-size: .7rem; font-weight: 700; }
.day-hours { margin-top: auto; font-weight: 800; font-size: .8rem; font-variant-numeric: tabular-nums; }
.day-hours .worked { color: var(--fj-ok); }
.day-hours .planned { color: var(--fj-muted); font-weight: 600; }
.day-alert { position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 6px; background: var(--fj-danger-soft); color: var(--fj-danger); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }
.calendar-legend { display: flex; gap: 16px; margin-top: 16px; font-size: .8rem; color: var(--fj-muted); flex-wrap: wrap; }
.calendar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.legend-work { background: var(--fj-ok); }
.legend-plan { background: #cbd5e1; }
.legend-absence { background: #fb923c; }
.legend-alert { background: var(--fj-danger); }
.legend-manual { color: var(--fj-primary); font-weight: 800; margin-right: 6px; }
.day-manual { position: absolute; bottom: 7px; right: 9px; color: var(--fj-primary); font-weight: 800; font-size: .95rem; line-height: 1; }

/* ---------- Móvil / MAUI ---------- */
@media (max-width: 991px) {
    .app-sidebar { display: none; }
    .app-shell.sidebar-open .app-sidebar { display: flex; position: fixed; z-index: 50; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .app-topbar { padding: 12px 16px; }
    .app-page { padding: 16px; }
    .fichar-layout, .login-grid { grid-template-columns: 1fr; }
    .login-brand h1 { font-size: 1.9rem; }
    .clock-time { font-size: 3.6rem; }
    .clock-card { padding: 22px; }
    .calendar-day { min-height: 62px; padding: 6px; }
    .calendar-day .day-type { display: none; }
    .topbar-user .user-meta { display: none; }
    .action-btn { min-height: 76px; }
}

/* ---------- Turnos y planificaci�n ---------- */
.plan-picker { display: grid; gap: 4px; max-height: 250px; overflow: auto; border: 1px solid var(--fj-line); border-radius: 12px; padding: 8px; background: #fbfcfe; }
.plan-pick { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; font-size: .9rem; cursor: pointer; margin: 0; }
.plan-pick:hover { background: var(--fj-primary-soft); }
.plan-pick input { flex: 0 0 auto; }
.plan-weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-weekdays .btn { min-width: 38px; font-weight: 800; }
.plan-note { background: #f8fafc; border: 1px solid var(--fj-line); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.plan-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: var(--fj-muted); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-scroll { max-height: 620px; overflow: auto; border-top: 1px solid var(--fj-line); }
.plan-grid { margin-bottom: 0; border-collapse: separate; border-spacing: 0; font-size: .76rem; }
.plan-grid th, .plan-grid td { padding: 5px 4px; text-align: center; vertical-align: middle; }
.plan-grid thead th { position: sticky; top: 0; z-index: 3; background: #f8fafc; border-bottom: 1px solid var(--fj-line); font-size: .7rem; color: var(--fj-muted); min-width: 38px; }
.plan-grid thead th:first-child { z-index: 5; left: 0; }
.plan-grid tbody td { border-bottom: 1px solid #f1f5f9; }
.plan-worker-col { position: sticky; left: 0; z-index: 2; min-width: 170px; max-width: 220px; background: #fff; text-align: left !important; padding-left: 12px !important; border-right: 1px solid var(--fj-line); }
.plan-grid thead .plan-worker-col { background: #f8fafc; }
.plan-grid tbody tr:hover .plan-worker-col { background: #fafbff; }
.plan-day { display: block; font-size: .82rem; color: var(--fj-ink); }
.plan-dow { display: block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.plan-grid .is-weekend { background: #fafafa; }
.plan-grid th.is-weekend { background: #f1f5f9; }
.plan-grid .is-today { box-shadow: inset 0 0 0 2px rgba(79, 70, 229, .45); }
.plan-cell { cursor: pointer; transition: background .12s; min-width: 38px; height: 42px; }
.plan-cell:hover { background: var(--fj-primary-soft) !important; }
.plan-shift { display: inline-block; max-width: 100%; border-radius: 7px; padding: 3px 5px; font-size: .66rem; font-weight: 800; color: var(--fj-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-empty { color: #cbd5e1; font-weight: 800; }
.turno-chip { display: inline-flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid var(--fj-line); border-radius: 999px; padding: 3px 9px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.turno-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--turno-color, #2563eb); flex: 0 0 auto; }
.row-hoy { background: #eef2ff !important; }

@media (max-width: 991px) {
    .plan-worker-col { min-width: 130px; max-width: 150px; padding-left: 8px !important; }
    .plan-grid { font-size: .7rem; }
    .plan-picker { max-height: 190px; }
}

/* Modo soporte: solo lectura. Los botones de cambio se ocultan; los de navegación llevan la clase btn-soporte. */
.app-page.modo-soporte button:not(.btn-soporte) { display: none !important; }

