/* BMM Notaría · Registro de jornada
   Paleta tomada del logotipo (grafito #53575A). Tipografía: Jost, geométrica como «NOTARIA».
   Un único gesto expresivo: el reloj en peso fino, como los trazos de «bmm». El resto, sobrio. */

@font-face {
    font-family: "Jost";
    src: url("../fonts/jost-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Jost";
    src: url("../fonts/jost-latin-ext.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --graphite: #53575A;      /* logotipo */
    --text: #2B2E30;
    --muted: #747A7E;
    --bg: #F1F2F0;
    --surface: #FFFFFF;
    --line: #E2E4E1;
    --line-strong: #CDD0CC;
    --in: #0E7A64;
    --in-soft: #E1F1EC;
    --warn: #A86400;
    --warn-soft: #FBF0DC;
    --err: #B3261E;
    --err-soft: #FBE9E7;

    --r-lg: 20px;
    --r-md: 12px;
    --side-w: 248px;
    --tab-h: 64px;
    --font: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0;
    font: 400 16px/1.5 var(--font);
    color: var(--text);
    background: var(--bg);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { margin: 0; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.15rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-warn { color: var(--warn) !important; }
.ip { font-size: .85em; color: var(--muted); }
:focus-visible { outline: 2px solid var(--graphite); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; }

/* ------------------------------------------------------------------ Estructura */
.shell { min-height: 100vh; }
.side { display: none; }
.mtop {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
    background: rgba(241, 242, 240, .92);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.mtop__logo img { height: 34px; width: auto; }
.mtop__user { display: flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; padding: 4px; }
.main {
    max-width: 1080px; margin: 0 auto;
    padding: 8px 16px calc(var(--tab-h) + var(--safe-b) + 32px);
}

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(2, 1fr);
    height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
}
.tabbar--5 { grid-template-columns: repeat(5, 1fr); }
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 500;
}
.tabbar a.is-active { color: var(--text); }
.tabbar a.is-active .ico { stroke-width: 2.1; }

@media (min-width: 1024px) {
    .shell { display: grid; grid-template-columns: var(--side-w) 1fr; }
    .mtop, .tabbar { display: none; }
    .side {
        display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh;
        padding: 32px 18px 20px;
        background: var(--surface);
        border-right: 1px solid var(--line);
    }
    .side__logo { padding: 0 10px 36px; }
    .side__logo img { width: 112px; height: auto; }
    .side__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
    .side__nav a {
        display: flex; align-items: center; gap: 12px;
        padding: 10px 12px; border-radius: var(--r-md);
        color: var(--muted); text-decoration: none; font-weight: 500;
    }
    .side__nav a:hover, .side__nav a.is-active { color: var(--text); background: var(--bg); }
    .side__nav a.is-active .ico { stroke-width: 2.1; }
    .side__group { margin: 24px 12px 6px; font-size: .82rem; color: var(--muted); }
    .side__user { display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid var(--line); }
    .side__name { flex: 1; font-size: .9rem; font-weight: 500; line-height: 1.25; }
    .main { padding: 40px 40px 64px; width: 100%; }
}

/* ------------------------------------------------------------------ Piezas comunes */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin: 12px 0 20px; }
.page-head .muted { margin-top: 4px; }
.page-head--sub { margin-top: 36px; margin-bottom: 14px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -6px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.back .ico { width: 18px; height: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.block > h2 { margin-bottom: 16px; }
.block--flush { padding: 4px 0; overflow: hidden; }
.block--narrow { max-width: 640px; }
.block__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.note { color: var(--muted); font-size: .85rem; margin-top: 14px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    font: 500 .98rem var(--font);
    border-radius: var(--r-md); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}
.btn .ico { width: 20px; height: 20px; }
.btn--primary { background: var(--text); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--graphite); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn--lg { min-height: 52px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    color: var(--text); text-decoration: none;
    border: 1px solid var(--line-strong); background: var(--surface);
}
.icon-btn:hover { border-color: var(--graphite); }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }
.side__user .icon-btn { border: none; background: none; color: var(--muted); }

.toast { padding: 14px 16px; border-radius: var(--r-md); margin: 0 0 16px; font-weight: 500; line-height: 1.4; }
.toast--success { background: var(--in-soft); color: #0A5A4A; }
.toast--error { background: var(--err-soft); color: var(--err); }
.toast--warning { background: var(--warn-soft); color: #7A4A00; font-weight: 400; }
.main > .toast { animation: toast-in .35s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

.avatar {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--graphite);
    font-weight: 500; font-size: .9rem; letter-spacing: .02em;
    border: 1px solid var(--line);
}
.avatar--sm { width: 32px; height: 32px; font-size: .78rem; }
.avatar--in { background: var(--in); color: #fff; border-color: var(--in); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot--in { background: var(--in); box-shadow: 0 0 0 4px var(--in-soft); }
.dot--out { background: var(--line-strong); }

.badge, .tag {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 999px;
    font-size: .8rem; font-weight: 500; line-height: 1.5; white-space: nowrap;
    background: var(--bg); color: var(--graphite);
}
.badge--entrada { background: var(--in-soft); color: var(--in); }
.badge--salida { background: #E8E9E7; color: var(--text); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--in { background: var(--in-soft); color: var(--in); }
.tag--admin { background: var(--text); color: #fff; }

.geo { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; white-space: nowrap; }
.geo svg { width: 15px; height: 15px; color: var(--in); }
.geo small { color: var(--muted); }
.geo--ko { color: var(--warn); text-decoration: none; }

/* ------------------------------------------------------------------ Login */
.page-login { background: var(--surface); }
.login {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: calc(env(safe-area-inset-top, 0px) + 32px) 24px calc(var(--safe-b) + 32px);
    gap: 40px;
}
.login__top { text-align: center; }
.login__logo { width: 150px; height: auto; margin: 0 auto 36px; }
.login__clock { font-size: 3.4rem; font-weight: 200; line-height: 1; letter-spacing: -.02em; color: var(--graphite); }
.login__date { color: var(--muted); margin-top: 8px; }
.login__form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login__form h1 { font-size: 1.25rem; text-align: center; margin-bottom: 4px; }
.login__form .btn { margin-top: 8px; }
@media (min-width: 900px) {
    .login { flex-direction: row; gap: 0; padding: 0; align-items: stretch; }
    .login__top {
        flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
        background: var(--bg); border-right: 1px solid var(--line);
    }
    .login__logo { width: 220px; margin-bottom: 56px; }
    .login__clock { font-size: 6rem; }
    .login__form { flex: 0 0 auto; width: 460px; max-width: none; padding: 0 64px; justify-content: center; }
}

/* ------------------------------------------------------------------ Formularios */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field label { font-size: .9rem; font-weight: 500; color: var(--text); }
.field input, .field select,
.form input[type=text], .form input[type=email], .form input[type=password] {
    width: 100%; min-height: 50px; padding: 0 14px;
    font: 400 1rem var(--font); color: var(--text);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
    -webkit-appearance: none; appearance: none;
}
.field select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747A7E' stroke-width='2'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 20px;
}
.field input:focus, .field select:focus, .form input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(43, 46, 48, .1); }
.form { display: flex; flex-direction: column; gap: 18px; }
.form ul { list-style: none; margin: 0; padding: 0; color: var(--err); font-size: .88rem; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form .btn { align-self: flex-start; margin-top: 6px; }

.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--text); }

.switches { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.switch { display: flex; align-items: center; gap: 14px; min-height: 48px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 46px; height: 28px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background-color .2s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .switch__ui { background: var(--in); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--graphite); outline-offset: 2px; }

/* ------------------------------------------------------------------ Fichar */
.punch-card {
    text-align: center;
    padding: 28px 20px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
}
.punch-card__hello { font-size: 1.1rem; font-weight: 500; }
.punch-card__date { color: var(--muted); font-size: .95rem; }
.clock {
    display: inline-flex; align-items: flex-start;
    margin: 18px 0 12px;
    font-weight: 200;
    font-size: clamp(5rem, 25vw, 9.5rem);
    line-height: .9;
    letter-spacing: -.035em;
    color: var(--graphite);
}
.clock__s { font-size: .26em; font-weight: 300; letter-spacing: 0; margin: .3em 0 0 .25em; color: var(--muted); min-width: 1.3em; text-align: left; }
.punch-card__state { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); margin-bottom: 26px; min-height: 1.5em; }
.punch-card.is-in .punch-card__state { color: var(--in); font-weight: 500; }

.punch {
    width: 100%; max-width: 440px; min-height: 84px;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 12px 20px;
    border: none; border-radius: 18px; cursor: pointer;
    font-family: var(--font); color: #fff;
    transition: transform .12s ease, background-color .2s;
    touch-action: manipulation;
}
.punch--entrada { background: var(--in); }
.punch--entrada:hover { background: #0B6955; }
.punch--salida { background: var(--text); }
.punch--salida:hover { background: #000; }
.punch:active { transform: scale(.98); }
.punch:disabled { cursor: progress; }
.punch__label { font-size: 1.4rem; font-weight: 500; }
.punch__sub { font-size: .85rem; opacity: .75; }
.punch.is-loading .punch__sub { animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.geo-status { max-width: 440px; margin: 14px auto 0; font-size: .9rem; color: var(--muted); }
.geo-status--warn { color: var(--warn); }
.geo-status--error { color: var(--err); font-weight: 500; }
.punch-card .toast { margin: 18px auto 0; max-width: 440px; text-align: left; }
@media (min-width: 1024px) { .punch-card { padding: 44px 32px 36px; } }

.today {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg);
    overflow: hidden; margin-bottom: 16px;
}
.today__item { background: var(--surface); padding: 16px 20px; display: flex; flex-direction: column; }
.today__label { color: var(--muted); font-size: .88rem; }
.today__value { font-size: 1.7rem; font-weight: 400; letter-spacing: -.01em; }
.today__tramos { grid-column: 1 / -1; background: var(--surface); list-style: none; margin: 0; padding: 12px 20px 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Tramos (entrada → salida) */
.tramo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tramo__horas { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tramo__horas sup { font-size: .65em; color: var(--muted); }
.tramo__horas em { font-style: normal; color: var(--in); }
.tramo__arrow { width: 16px; height: 1px; background: var(--muted); position: relative; }
.tramo__arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left: 5px solid var(--muted); border-right: 0; }
.tramo__dur { color: var(--muted); font-size: .9rem; }
.tramo__detalle { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; font-size: .85rem; }
.tramo__detalle > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tramo__detalle .badge { font-size: .72rem; padding: 0 8px; }

/* Últimos fichajes */
.log { list-style: none; margin: 0 -20px -20px; padding: 0; }
.log__item {
    display: grid; grid-template-columns: 64px 1fr; gap: 2px 12px; align-items: center;
    padding: 12px 20px; border-top: 1px solid var(--line);
}
.log__time { grid-row: span 2; font-size: 1.25rem; }
.log__main { display: flex; align-items: center; gap: 10px; }
.log__date { color: var(--muted); font-size: .9rem; }
.log__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
@media (min-width: 760px) {
    .log__item { grid-template-columns: 72px 1fr auto; }
    .log__time { grid-row: auto; }
}

/* ------------------------------------------------------------------ Cifras */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; }
.kpis--4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .kpis--4 { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi__value { font-size: clamp(1.35rem, 4.5vw, 1.9rem); font-weight: 400; letter-spacing: -.015em; line-height: 1.15; }
.kpi__label { color: var(--muted); font-size: .86rem; line-height: 1.3; }
.kpi--warn .kpi__value { color: var(--warn); }
.kpis--inline { margin: 16px 0 0; border-radius: var(--r-md); }
.kpis--inline .kpi { padding: 12px 14px; }
.kpis--inline .kpi__value { font-size: 1.35rem; }
@media (max-width: 520px) {
    .kpis:not(.kpis--4) { grid-template-columns: 1fr 1fr; }
    .kpis:not(.kpis--4) .kpi:first-child { grid-column: 1 / -1; }
}

.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav strong { min-width: 150px; text-align: center; font-weight: 500; }

/* ------------------------------------------------------------------ Historial por días */
.days { list-style: none; margin: -8px -20px; padding: 0; }
.day { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--line); }
.day:first-child { border-top: none; }
.day--warn { background: #FFFBF3; }
.day__date { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: 2px; }
.day__num { font-size: 1.5rem; }
.day__dow { font-size: .78rem; color: var(--muted); }
.day__tramos { list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day__total { font-weight: 500; white-space: nowrap; padding-top: 4px; }

/* ------------------------------------------------------------------ Personas */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); text-decoration: none; }
.person:hover { border-color: var(--line-strong); }
.person__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person__body strong { font-weight: 500; }
.person__body span { color: var(--muted); font-size: .86rem; }
.person--in .avatar { background: var(--in); color: #fff; border-color: var(--in); }
.person--in .person__body span { color: var(--in); }
.person--warn { background: var(--warn-soft); border-color: transparent; }
.person--warn .avatar { background: var(--warn); color: #fff; border-color: var(--warn); }
.person--warn .person__body span { color: var(--warn); }

.team { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.member:first-child { border-top: none; }
.member__main { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; text-decoration: none; }
.member__body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.member__body strong { font-weight: 500; }
.member__body .muted { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.member--off { opacity: .6; }
@media (max-width: 560px) {
    .member__main { flex-basis: calc(100% - 90px); }
    .member__tags { order: 3; flex-basis: 100%; padding-left: 54px; }
    .member__tags:empty { display: none; }
}

/* ------------------------------------------------------------------ Tablas */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 500; font-size: .85rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table .ua { color: var(--muted); font-size: .85rem; max-width: 240px; }
.block:not(.block--flush) .table th:first-child, .block:not(.block--flush) .table td:first-child { padding-left: 0; }
.block:not(.block--flush) .table th:last-child, .block:not(.block--flush) .table td:last-child { padding-right: 0; }
.block--flush .table th:first-child, .block--flush .table td:first-child { padding-left: 20px; }
.block--flush .table th:last-child, .block--flush .table td:last-child { padding-right: 20px; }
.meter { display: inline-block; width: 64px; height: 4px; border-radius: 2px; background: var(--bg); vertical-align: middle; margin-right: 10px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--graphite); }

/* En móvil cada fila se convierte en una ficha */
@media (max-width: 760px) {
    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
    .block--flush .table--stack tr { padding: 14px 20px; }
    .table--stack tbody tr:last-child { border-bottom: none; }
    .table--stack td { border: none !important; padding: 3px 0 !important; text-align: left !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .table--stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .88rem; }
    .table--stack .table__title { font-size: 1.05rem; padding-bottom: 6px !important; justify-content: flex-start; flex-wrap: wrap; gap: 6px 10px; }
    .table--stack .ua, .meter { display: none; }
}

/* ------------------------------------------------------------------ Filtros */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; }
.filters summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; cursor: pointer; font-weight: 500; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters__form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 20px 20px; }
.filters__form .field:first-child { grid-column: 1 / -1; }
.filters__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
@media (min-width: 1100px) {
    .filters__form { grid-template-columns: 1.6fr 1fr 1fr 1.1fr 1.1fr; align-items: end; }
    .filters__form .field:first-child { grid-column: auto; }
}
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 16px; color: var(--muted); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ Gráficos (CSS puro) */
.split { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.split > .block { margin: 0; }
@media (min-width: 1000px) { .split { grid-template-columns: 1.5fr 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 190px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.bars__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.bars__bar { width: 100%; max-width: 18px; background: var(--graphite); border-radius: 3px 3px 0 0; }
.bars__col.is-weekend .bars__bar { background: var(--line-strong); }
.bars__col.is-today .bars__bar { background: var(--in); }
.bars__col:hover .bars__bar { background: var(--text); }
.bars__x { position: absolute; bottom: -22px; font-size: .7rem; color: var(--muted); }
.bars__col:not(:nth-child(5n+1)) .bars__x { visibility: hidden; }
.hbars { display: flex; flex-direction: column; gap: 5px; }
.hbars__row { display: grid; grid-template-columns: 34px 1fr 24px; gap: 10px; align-items: center; font-size: .85rem; }
.hbars__label { color: var(--muted); }
.hbars__row.is-zero .hbars__label { color: var(--line-strong); }
.hbars__track { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.hbars__bar { display: block; height: 100%; background: var(--in); border-radius: 5px; }
.hbars__val { text-align: right; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ajustes móvil */
@media (max-width: 760px) {
    .page-head .month-nav, .page-head--sub .month-nav { width: 100%; justify-content: space-between; }
    .page-head--sub h2 + .month-nav { margin-top: 2px; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; }
}
.tramo__detalle > span { flex-wrap: nowrap; }
.tramo__detalle .ip { white-space: nowrap; }
@media (min-width: 1024px) { .side { align-self: start; } }
@media (max-width: 640px) { .form .btn { align-self: stretch; } }

/* Dispositivo */
.disp { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; color: var(--text); white-space: nowrap; }
.disp .ico { width: 16px; height: 16px; color: var(--muted); }
.tramo__detalle .disp { font-size: .85rem; }
.tramo__detalle > span { flex-wrap: wrap; }
.disp-id { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--bg); color: var(--muted) !important; font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-decoration: none !important; }
.disp-id:hover { color: var(--text) !important; }
@media (min-width: 1100px) { .filters__form { grid-template-columns: 1.6fr 1fr 1fr 1.1fr 1.1fr 1.1fr; } }
.block--warn { border-color: #EED9B0; background: #FFFCF6; }
.note--top { margin: -6px 0 14px; }
.shared, .devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.shared__item, .devices__item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.shared__item:first-child, .devices__item:first-child { border-top: none; padding-top: 0; }
.shared__disp { display: inline-flex; align-items: center; gap: 6px; }
.shared__disp .ico { width: 18px; height: 18px; color: var(--muted); }
.shared__disp strong { font-weight: 500; }
.shared__who a { font-weight: 500; text-decoration: none; }
.shared__who a:hover { text-decoration: underline; }
.devices__item .disp { font-size: .95rem; font-weight: 500; }
.devices__item .muted { font-size: .88rem; }
.table .disp { white-space: normal; align-items: flex-start; }
.table .disp .ico { margin-top: 2px; }
@media (min-width: 761px) { .table td[data-label="Persona"] a { white-space: nowrap; } }
