:root {
    color-scheme: light;
    --canvas: #f4f7f8;
    --surface: #fff;
    --ink: #19333f;
    --muted: #5e717c;
    --border: #e3eaed;
    --navy: #122c38;
    --teal: #087f70;
    --teal-dark: #056355;
    --mint: #68ddc0;
    --mint-soft: #eaf6f2;
    --error: #ad263d;
    font-family: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
    color: var(--ink);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button, input, select, a { transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
button:disabled { cursor: wait; opacity: .7; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.sidebar :focus-visible, .login-story :focus-visible { outline-color: var(--mint); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px 18px; background: var(--surface); border-radius: 6px; transform: translateY(-160%); box-shadow: 0 4px 18px #122c3820; }
.skip-link:focus { transform: translateY(0); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 30px; font-weight: 700; letter-spacing: -1.4px; line-height: 1; }
.brand-mark { color: var(--mint); width: 36px; height: 36px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-period { color: var(--mint); }
.app-body { background: var(--canvas); }
.app-shell { display: flex; min-height: 100vh; min-height: 100svh; }
.sidebar { width: 238px; padding: 36px 20px 22px; background: var(--navy); color: #d5e1e5; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; height: 100svh; overflow-y: auto; }
.sidebar > .brand { margin: 0 10px 48px; }
.workspace-label { margin: 0 12px 12px; font-size: 12px; color: #aec2cb; }
.workspace { display: flex; align-items: center; gap: 10px; padding: 13px 11px; border: 1px solid #36505d; border-radius: 9px; margin-bottom: 28px; min-width: 0; }
.workspace > div { min-width: 0; }
.workspace-icon { width: 34px; height: 36px; display: grid; place-items: center; color: var(--mint); background: #25444f; border-radius: 6px; flex-shrink: 0; }
.workspace-caption { display: block; color: #aec2cb; font-size: 11px; margin-bottom: 2px; }
.workspace-name { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.navigation { display: flex; flex-direction: column; gap: 6px; }
.nav-link { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 12px; border-radius: 7px; font-size: 13px; }
.nav-link:hover { background: #203d4a; color: #fff; }
.nav-link.is-active { color: #9aefd7; background: #234b50; box-shadow: inset 3px 0 0 var(--mint); }
.nav-chevron { margin-left: auto; width: 14px; }
.sidebar-bottom { margin-top: auto; padding-top: 48px; }
.sidebar-note { margin: 0 9px 30px; }
.sidebar-note > .icon { color: var(--mint); margin-bottom: 12px; width: 22px; height: 22px; }
.sidebar-note p { font-size: 12px; color: #d5e1e5; line-height: 1.7; }
.sidebar-note p span { display: block; margin-top: 6px; color: #aec2cb; font-size: 12px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid #36505d; padding: 20px 10px 0; font-size: 11px; color: #aec2cb; }
.small-brand { color: #e5eff2; font-size: 12px; font-weight: 600; }
.app-workspace { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topbar { min-height: 82px; padding: 16px 40px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; min-width: 0; }
.breadcrumb > .icon { width: 12px; height: 12px; }
.breadcrumb strong { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.topbar-actions { display: flex; gap: 20px; align-items: center; flex-shrink: 0; }
.topbar-actions form { margin: 0; }
.topbar-actions button { min-width: 60px; min-height: 44px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 7px; padding: 9px 15px; font-size: 12px; font-weight: 600; }
.topbar-actions button:hover { color: var(--ink); border-color: #a2b2ba; background: var(--canvas); }
.company-switch { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; font-weight: 600; color: var(--muted); }
.company-switch .icon { width: 16px; height: 16px; }
.company-switch:hover { color: var(--teal); }
.main-content { width: 100%; max-width: 1440px; padding: 40px 40px 30px; margin: 0 auto; flex: 1; }
.main-content:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -1.4px; overflow-wrap: anywhere; }
.heading-dot { color: var(--teal); }
.page-heading p { font-size: 14px; color: var(--muted); margin-top: 8px; max-width: 65ch; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 11px 17px; font-size: 12px; font-weight: 650; border-radius: 7px; border: 1px solid transparent; white-space: nowrap; }
.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--teal); color: #fff; box-shadow: 0 4px 12px #087f7018; }
.button-primary:hover { background: var(--teal-dark); }
.button-primary:active { background: #044e43; }
.button-secondary { background: var(--surface); border-color: #bdcbd1; color: var(--ink); }
.button-secondary:hover { background: #edf4f3; border-color: #7f9e9a; }
.overview { display: grid; grid-template-columns: 1.55fr repeat(3, 1fr); align-items: center; padding: 28px; margin-bottom: 30px; border: 1px solid #c9e0db; border-radius: 12px; background: var(--mint-soft); }
.overview-intro { padding-right: 24px; }
.overview-icon { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #b4d8cf; color: var(--teal); background: #f6fffc; border-radius: 10px; margin-bottom: 15px; }
.overview-intro h2 { font-size: 16px; letter-spacing: -.35px; line-height: 1.4; }
.overview-intro p { color: #506f69; font-size: 11px; max-width: 180px; margin-top: 5px; }
.metric { border-left: 1px solid #c8dfd9; padding: 0 20px; display: flex; flex-direction: column; gap: 4px; }
.metric > span:first-child { font-size: 11px; color: #41615b; font-weight: 600; }
.metric strong { font-size: 39px; font-weight: 600; line-height: 1.4; letter-spacing: -2px; color: #164b40; font-variant-numeric: tabular-nums; }
.metric > span:last-child { color: #506f69; font-size: 10px; }
.records-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px #122c3803; }
.records-toolbar { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.records-title { display: flex; align-items: center; gap: 10px; }
.records-title h2 { font-size: 16px; letter-spacing: -.35px; }
.count-badge { display: grid; place-items: center; min-width: 28px; min-height: 24px; padding: 2px 7px; border: 1px solid var(--border); background: var(--canvas); color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 6px; }
.records-search { display: flex; align-items: center; border: 1px solid #bdcbd1; border-radius: 7px; padding: 0 12px; gap: 9px; width: 248px; background: #fcfdfd; }
.records-search > .icon { width: 17px; height: 17px; color: var(--muted); }
.records-search input { border: 0; background: transparent; min-height: 44px; width: 100%; min-width: 0; color: var(--ink); outline: none; font-size: 12px; }
.records-search:focus-within { border-color: var(--teal); outline: 3px solid #087f7020; }
input::placeholder { color: #60747e; opacity: 1; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; }
.table-scroll:focus-visible { outline-offset: -3px; }
.records-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.records-table th { padding: 13px 24px; color: var(--muted); font-size: 11px; font-weight: 600; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f8fafb; white-space: nowrap; }
.records-table td { padding: 19px 24px; border-bottom: 1px solid #edf1f3; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr:hover { background: #f7fbfa; }
.sort-indicator { color: var(--teal); margin-left: 5px; }
.table-zone { font-size: 10px; padding-left: 3px; }
.pin-cell { display: flex; align-items: center; gap: 11px; }
.pin-cell strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.pin-avatar { display: grid; place-items: center; background: #edf2f5; color: #557482; border: 1px solid #e2e9ed; border-radius: 10px; width: 36px; height: 38px; flex-shrink: 0; }
.pin-avatar .icon { width: 17px; height: 17px; }
.time-primary { display: block; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-received { color: #526973; font-weight: 500; }
.time-secondary { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.device-tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 5px; padding: 5px 8px; font-size: 10px; color: #526973; background: #fcfdfd; }
.device-tag .icon { width: 14px; height: 14px; }
.device-tag > span { overflow-wrap: anywhere; }
a.device-tag { min-height: 44px; padding: 10px; border-color: #b8cbd0; color: var(--teal-dark); }
a.device-tag:hover { border-color: var(--teal); background: var(--mint-soft); }
.records-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 24px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); }
.records-footer > span:first-child { font-weight: 600; }
.data-note { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); margin: 18px 3px 0; font-size: 11px; }
.data-note .icon { width: 15px; height: 15px; margin-top: 1px; }
.data-note p { max-width: 80ch; }
.page-footer { padding: 20px 40px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 10px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 24px 70px; border-top: 1px solid var(--border); }
.empty-illustration { position: relative; width: 82px; height: 82px; background: var(--mint-soft); color: var(--teal); border-radius: 24px; display: grid; place-items: center; margin-bottom: 24px; box-shadow: 0 0 0 10px #f7fbf9; }
.empty-illustration > .icon { width: 38px; height: 38px; stroke-width: 1.3; }
.empty-check { display: grid; place-items: center; position: absolute; right: -6px; bottom: -4px; background: var(--teal); border: 4px solid #fff; color: #fff; width: 31px; height: 31px; border-radius: 50%; }
.empty-check .icon { width: 15px; height: 15px; }
.empty-state h3 { font-size: 20px; letter-spacing: -.5px; }
.empty-state > p { color: var(--muted); max-width: 42ch; font-size: 13px; line-height: 1.8; margin-top: 10px; }
.empty-state > .button { margin-top: 24px; }
.search-empty { padding: 36px 20px; text-align: center; border-top: 1px solid var(--border); }
.search-empty > .icon { color: var(--teal); margin-bottom: 12px; }
.search-empty h3 { font-size: 16px; }
.search-empty p { font-size: 13px; color: var(--muted); margin: 7px 0 16px; }
.selection-intro { padding-top: 12px; margin-bottom: 32px; max-width: 54ch; }
.section-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--teal); background: #e2efe9; border: 1px solid #c8dfd5; border-radius: 12px; margin-bottom: 24px; }
.section-icon .icon { width: 24px; height: 24px; }
.selection-intro p { color: var(--muted); font-size: 14px; line-height: 1.8; margin-top: 12px; }
.companies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; list-style: none; max-width: 850px; }
.companies form { height: 100%; }
.company-card { position: relative; padding: 28px; width: 100%; height: 100%; text-align: left; color: var(--ink); border: 1px solid #c7d3d9; background: var(--surface); border-radius: 12px; display: flex; flex-direction: column; align-items: flex-start; }
.company-card:hover { border-color: var(--teal); box-shadow: 0 5px 18px #122c3808; background: #fbfefd; }
.company-card-active { border-color: var(--teal); }
.company-monogram { display: grid; place-items: center; width: 52px; height: 52px; background: #e7f2f0; color: var(--teal); font-size: 23px; font-weight: 600; border-radius: 13px; margin-bottom: 24px; }
.companies li:nth-child(even) .company-monogram { background: #edf0f9; color: #52679e; }
.company-card-name { font-size: 18px; font-weight: 650; letter-spacing: -.4px; overflow-wrap: anywhere; }
.company-card-caption { color: var(--muted); font-size: 12px; margin-top: 5px; }
.company-card-action { display: flex; align-items: center; justify-content: space-between; align-self: stretch; margin-top: auto; padding-top: 28px; color: var(--teal); font-size: 12px; font-weight: 650; }
.company-card-action .icon { width: 18px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 5px; background: #edf2f5; color: #526973; font-size: 10px; font-weight: 600; }
.badge-teal { color: var(--teal-dark); background: var(--mint-soft); }
.company-card > .badge { position: absolute; top: 29px; right: 24px; }
.badge .icon { width: 12px; height: 12px; }
.selection-note { display: flex; gap: 9px; align-items: flex-start; max-width: 68ch; margin: 24px 0; color: var(--muted); font-size: 12px; }
.selection-note .icon { width: 17px; height: 17px; color: var(--teal); }
.account-empty { max-width: 650px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 48px auto; padding: 64px 32px; }
.account-empty h1 { font-size: 26px; max-width: 24ch; letter-spacing: -.8px; margin-top: 18px; }
.empty-instruction { background: var(--canvas); border-radius: 8px; padding: 16px; display: flex; gap: 10px; align-items: flex-start; text-align: left; margin-top: 28px; max-width: 43ch; color: var(--muted); font-size: 12px; }
.empty-instruction .icon { width: 17px; height: 17px; color: var(--teal); }
/* The clock carries the brand; the sign-in form stays quiet and legible. */
.login-body { background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100svh; }
.login-story { position: relative; background: var(--navy); color: #fff; padding: 44px 56px 30px; display: flex; flex-direction: column; overflow: hidden; }
.login-story > .brand { align-self: flex-start; }
.login-story-content { margin: auto 0; padding: 60px 0 24px; }
.story-tag { display: inline-flex; align-items: center; gap: 9px; color: #c5e1dc; font-size: 12px; margin-bottom: 24px; }
.story-tag > span { width: 7px; height: 7px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 4px #68ddc015; }
.login-story h1 { font-size: clamp(36px, 3.8vw, 58px); letter-spacing: -2.4px; line-height: 1.12; max-width: 11ch; font-weight: 600; }
.login-story-content > p { max-width: 37ch; font-size: 14px; line-height: 1.85; color: #b8cfd7; margin-top: 22px; }
.clock-illustration { position: relative; height: 295px; width: 100%; max-width: 410px; margin: 36px auto 0; display: grid; place-items: center; }
.clock-orbit { position: absolute; width: 290px; height: 290px; border: 1px solid #31505b; border-radius: 50%; }
.orbit-two { width: 370px; height: 370px; border-color: #254450; }
.clock-face { width: 230px; height: 230px; border-radius: 50%; background: #1c404b; color: #9ee9d5; border: 1px solid #426c70; box-shadow: 0 16px 50px #05192338, inset 0 0 0 10px #193a46; position: relative; }
.clock-face svg { width: 100%; height: 100%; }
.clock-note { position: absolute; bottom: 19px; right: 0; padding: 14px 22px 14px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #4b7777; border-radius: 10px; background: #224b53; color: #f0fbf8; font-size: 12px; box-shadow: 0 10px 24px #05192320; transform: rotate(-3deg); }
.clock-note div > span { display: block; color: #c0dad8; font-size: 10px; margin-top: 2px; }
.check-circle { display: grid; place-items: center; width: 31px; height: 31px; color: var(--navy); background: var(--mint); border-radius: 50%; }
.check-circle .icon { width: 17px; height: 17px; }
.story-footer { position: relative; display: flex; align-items: center; gap: 9px; font-size: 11px; color: #b8cfd7; padding-top: 26px; }
.story-footer .icon { width: 16px; height: 16px; color: var(--mint); }
.login-form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 40px 26px; }
.login-form-wrap { width: 100%; max-width: 375px; margin: auto 0; }
.login-welcome { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.welcome-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #c8dfd5; background: var(--mint-soft); color: var(--teal); border-radius: 9px; }
.welcome-icon .icon { width: 16px; height: 16px; }
.login-form-wrap h2 { font-size: 32px; letter-spacing: -1.2px; line-height: 1.3; }
.login-description { color: var(--muted); font-size: 13px; line-height: 1.8; margin-top: 10px; max-width: 40ch; }
.login-form { margin-top: 34px; }
.form-field { margin-bottom: 22px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 9px; }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; top: 17px; left: 15px; width: 17px; height: 17px; color: #687b85; pointer-events: none; }
.input-wrap input, .input-wrap select { padding: 14px 46px 14px 43px; min-height: 51px; width: 100%; border: 1px solid #b8c8cf; border-radius: 7px; background: #fcfdfd; color: var(--ink); font-size: 13px; }
.input-wrap input:hover, .input-wrap select:hover { border-color: #809ba7; }
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--teal); outline: 3px solid #087f7020; outline-offset: 0; background: #fff; }
.input-wrap [aria-invalid='true'] { border-color: var(--error); }
.password-toggle { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.password-toggle:hover, .password-toggle[aria-pressed='true'] { color: var(--teal); background: var(--mint-soft); }
.password-toggle .icon { width: 18px; height: 18px; }
.login-submit { width: 100%; justify-content: space-between; font-size: 13px; min-height: 51px; padding-left: 20px; padding-right: 18px; margin-top: 4px; }
.field-error { color: var(--error); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.login-help { border-top: 1px solid var(--border); margin-top: 34px; padding-top: 24px; display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 11px; }
.login-help .icon { width: 16px; height: 16px; margin-top: 1px; }
.login-help p { font-weight: 600; }
.login-help p span { display: block; font-weight: 400; margin-top: 4px; line-height: 1.7; }
.login-footer { color: var(--muted); font-size: 10px; margin-top: 50px; text-align: center; }
.device-form { max-width: 620px; background: var(--surface); border: 1px solid var(--border); padding: 30px; border-radius: 12px; }
.device-form .button { margin-top: 6px; }
.service-error { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; padding: 32px 24px; background: var(--canvas); }
.service-error .login-form-wrap { max-width: 500px; margin: 0; }
.service-error .brand { color: var(--navy); margin-bottom: 40px; }
.service-error .brand-mark, .service-error .brand-period { color: var(--teal); }
.service-error h1 { font-size: 30px; }
@media (min-width: 1600px) { .login-story { padding-left: 12%; padding-right: 12%; } }
@media (max-width: 1200px) {
    .sidebar { width: 218px; padding-left: 16px; padding-right: 16px; }
    .main-content { padding: 32px 28px; }
    .topbar { padding-left: 28px; padding-right: 28px; }
    .overview { grid-template-columns: repeat(3, 1fr); padding: 24px; }
    .overview-intro { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-right: 0; }
    .overview-icon { margin-bottom: 0; }
    .overview-intro p { max-width: none; }
    .metric:nth-child(2) { padding-left: 0; border-left: 0; }
    .metric strong { font-size: 36px; }
    .metric { padding-left: 24px; padding-right: 10px; }
    .records-table th, .records-table td { padding-left: 20px; padding-right: 20px; }
    .login-story { padding: 36px 36px 28px; }
}
@media (max-width: 900px) {
    .sidebar { width: 190px; }
    .sidebar > .brand { font-size: 27px; margin-left: 4px; }
    .brand-mark { width: 30px; height: 30px; }
    .main-content { padding: 28px 24px; }
    .topbar { padding: 14px 24px; }
    .breadcrumb > span:first-child, .breadcrumb > .icon { display: none; }
    .topbar-actions { gap: 12px; }
    .company-switch { font-size: 11px; }
    .records-table { min-width: 600px; }
    .records-search { width: 210px; }
    .records-toolbar { padding: 20px; gap: 12px; }
    .records-title h2 { font-size: 14px; }
    .records-footer { padding: 14px 20px; flex-wrap: wrap; gap: 5px; }
    .login-story h1 { letter-spacing: -1.5px; }
    .login-story-content > p { font-size: 13px; }
    .clock-illustration { margin-top: 24px; height: 260px; }
    .clock-face { width: 200px; height: 200px; }
    .clock-orbit { width: 250px; height: 250px; }
    .orbit-two { width: 320px; height: 320px; }
    .clock-note { right: -12px; padding-right: 14px; }
    .login-form-panel { padding-left: 30px; padding-right: 30px; }
    .login-form-wrap h2 { font-size: 28px; }
    .companies { gap: 14px; }
    .company-card { padding: 22px; }
    .company-card > .badge { top: 25px; right: 18px; }
}
@media (max-width: 760px) {
    .app-shell { flex-direction: column; }
    .sidebar { position: static; width: 100%; height: auto; padding: 20px 24px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; overflow: visible; }
    .sidebar > .brand { margin: 0; font-size: 27px; }
    .workspace-label, .workspace, .sidebar-bottom { display: none; }
    /* Con cinco o seis enlaces (el admin: Reportes y Verificación) la fila no cabe en una pantalla angosta: las pestañas pasan a una segunda fila en vez de empujar la página de lado. */
    .navigation { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .nav-link { padding: 9px 12px; min-height: 44px; font-size: 11px; border-radius: 7px 7px 0 0; gap: 7px; }
    .nav-link .icon { width: 16px; height: 16px; }
    .nav-link.is-active { box-shadow: inset 0 -3px 0 var(--mint); }
    .nav-chevron { display: none; }
    .topbar { min-height: 68px; }
    .main-content { padding: 28px 24px; }
    .page-heading { margin-bottom: 24px; }
    h1 { font-size: 30px; }
    .page-heading p { font-size: 12px; max-width: 30ch; }
    .page-footer { padding: 16px 24px; }
    .selection-intro { padding-top: 0; }
    .account-empty { margin-top: 16px; }
}
@media (max-width: 680px) {
    .input-wrap input, .input-wrap select, .records-search input { font-size: 16px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { padding: 26px 28px 32px; }
    .login-story-content { padding: 26px 0 0; margin: 0; }
    .login-story h1 { font-size: 32px; max-width: 15ch; letter-spacing: -1px; }
    .story-tag, .clock-illustration, .story-footer, .login-story-content > p { display: none; }
    .login-form-panel { padding: 36px 28px 24px; }
    .login-form-wrap { max-width: 420px; }
    .login-welcome { display: none; }
    .login-form-wrap h2 { font-size: 27px; }
    .login-form { margin-top: 28px; }
    .login-footer { margin-top: 36px; }
}
@media (max-width: 480px) {
    .sidebar { padding: 20px 16px 0; gap: 12px; grid-template-columns: 1fr; }
    .sidebar > .brand { font-size: 26px; }
    .navigation { width: 100%; }
    .nav-link { flex: 1; justify-content: center; padding-left: 8px; padding-right: 8px; }
    .topbar { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
    .breadcrumb { flex: 1 1 110px; font-size: 11px; }
    .topbar-actions { gap: 10px; }
    .company-switch { max-width: 95px; gap: 5px; font-size: 10px; line-height: 1.5; }
    .company-switch .icon { width: 15px; height: 15px; }
    .topbar-actions button { padding: 8px 11px; min-width: 48px; }
    .main-content { padding: 26px 16px; }
    .page-heading { gap: 12px; align-items: flex-start; }
    .page-heading h1 { font-size: 29px; }
    .page-heading p { max-width: 24ch; line-height: 1.7; }
    .page-heading > .button { padding: 10px 12px; font-size: 11px; }
    .overview { padding: 20px 16px; margin-bottom: 24px; }
    .overview-intro { gap: 10px; margin-bottom: 20px; }
    .overview-intro h2 { font-size: 15px; }
    .overview-intro p { font-size: 10px; }
    .metric { padding-left: 13px; padding-right: 8px; align-self: stretch; }
    .metric > span:first-child { font-size: 10px; min-height: 30px; }
    .metric strong { font-size: 31px; }
    .metric > span:last-child { font-size: 9px; }
    .records-toolbar { flex-direction: column; align-items: stretch; padding: 18px 16px; gap: 16px; }
    .records-search { width: 100%; }
    .records-title h2 { font-size: 16px; }
    .records-footer { padding: 14px 16px; font-size: 10px; }
    .records-table th, .records-table td { padding-left: 16px; padding-right: 16px; }
    .empty-state { padding: 48px 20px; }
    .empty-state > p { font-size: 12px; }
    .empty-state h3 { font-size: 18px; }
    .data-note { font-size: 10px; line-height: 1.7; }
    .page-footer { padding: 16px; font-size: 9px; }
    .page-footer > span:last-child { display: none; }
    .companies { grid-template-columns: 1fr; }
    .selection-intro h1 { font-size: 28px; }
    .selection-intro p { font-size: 13px; }
    .company-card { padding: 24px; }
    .company-monogram { margin-bottom: 18px; }
    .account-empty { padding: 44px 24px; }
    .account-empty h1 { font-size: 23px; }
    .device-form { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    .sidebar, .topbar, .page-footer, .page-heading > a, .records-search, .data-note { display: none !important; }
    .app-shell, .app-workspace { display: block; }
    .app-body, .main-content { background: #fff; padding: 0; }
    .table-scroll { overflow: visible; }
    .records-table { min-width: 0; }
    .records-panel { border: 0; box-shadow: none; }
    .records-table tr { break-inside: avoid; }
}
/* Device setup uses the same surfaces with room for real server names and status text. */
.page-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.page-actions form { margin: 0; }
.overview[data-device-status] { grid-template-columns: 1fr 1.6fr .8fr; gap: 12px; }
.overview[data-device-status] .metric:first-child { border: 0; padding-left: 0; }
.overview[data-device-status] .metric { min-width: 0; }
.overview [data-gateway-host] { font-size: 18px; letter-spacing: -.4px; overflow-wrap: anywhere; }
.overview [data-pairing-code] { letter-spacing: .1em; }
.overview .metric-wide { grid-column: 1 / -1; padding: 14px 0 0; border-left: 0; border-top: 1px solid #c8dfd9; }
.overview .metric-wide strong { font-size: 16px; letter-spacing: 0; line-height: 1.5; overflow-wrap: anywhere; }
.overview .metric-wide .button { align-self: flex-start; margin-top: 6px; }
.overview[aria-label='Estado del reloj'] { grid-template-columns: 1fr 1.5fr; gap: 20px; }
.overview[aria-label='Estado del reloj'] .metric:first-child { border: 0; padding-left: 0; }
.overview[aria-label='Estado del reloj'] .metric strong { font-size: 16px; letter-spacing: -.2px; }
.steps { list-style: none; counter-reset: step; padding: 0 28px 12px; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 20px 0 20px 48px; max-width: 80ch; color: var(--muted); font-size: 13px; line-height: 1.8; border-top: 1px solid var(--border); }
.steps li::before { content: counter(step); position: absolute; top: 20px; left: 0; display: grid; place-items: center; width: 29px; height: 29px; background: var(--mint-soft); border: 1px solid #c8dfd5; border-radius: 50%; color: var(--teal); font-size: 12px; font-weight: 600; }
.steps strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
[data-refresh] { margin: 0 0 24px; }
/* «Vincular» desde «PIN sin asignar» (historia 5, T8): el reloj y el PIN que se van a vincular, solo de lectura, y los dos botones del formulario. */
.data-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 24px; margin: 0; padding: 4px 24px 24px; }
.data-list dt { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.data-list dd { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.records-panel + .device-form, .records-panel + .data-note { margin-top: 24px; }
/* «PIN sin asignar» en el celular: cada fila es una tarjeta con su botón «Vincular» a la vista (en una tabla que se desliza de lado, el botón quedaba fuera de pantalla). */
@media (max-width: 680px) {
    .records-table[data-stack] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .records-table[data-stack] { min-width: 0; }
    .records-table[data-stack], .records-table[data-stack] tbody, .records-table[data-stack] tr, .records-table[data-stack] td { display: block; }
    .records-table[data-stack] tr { padding: 14px 24px 18px; border-top: 1px solid var(--border); }
    .records-table[data-stack] tbody tr:first-child { border-top: 0; }
    .records-table[data-stack] td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; }
    .records-table[data-stack] td[data-label]::before { content: attr(data-label); flex-shrink: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
    .records-table[data-stack] td:last-child:not([data-label]) { justify-content: flex-start; padding-top: 12px; }
    .records-table[data-stack] td:last-child:not([data-label]) .button { min-height: 44px; }
    .records-table[data-stack] .time-secondary { display: inline; margin: 0 0 0 8px; }
    .records-table[data-stack] .time-primary { display: inline; }
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.form-actions .button { margin-top: 0; }
[data-device-status] ~ .data-note { margin-bottom: 24px; }
.service-error .button { margin-top: 24px; }
@media (max-width: 900px) {
    .page-heading:has(.page-actions) { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .overview[data-device-status], .overview[aria-label='Estado del reloj'] { grid-template-columns: 1fr; padding: 24px; gap: 20px; }
    .overview[data-device-status] .metric, .overview[aria-label='Estado del reloj'] .metric { border: 0; border-top: 1px solid #c8dfd9; padding: 20px 0 0; }
    .overview[data-device-status] .metric:first-child, .overview[aria-label='Estado del reloj'] .metric:first-child { padding-top: 0; border: 0; }
    .overview[data-device-status] .metric > span:first-child, .overview[aria-label='Estado del reloj'] .metric > span:first-child { min-height: 0; }
    .steps { padding: 0 20px 8px; }
    .steps li { font-size: 12px; padding-left: 42px; }
    .page-actions { flex-wrap: wrap; }
    .page-heading:has(> .button-primary) { flex-direction: column; }
}
/* «Reportes» (historia 6a, T3): el formulario es una rejilla que se acomoda sola (en 375 px, un campo por renglón); la marca de borrador y los avisos del reporte se imprimen. */
.report-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 0 20px; align-items: start; max-width: 1000px; margin-bottom: 28px; padding: 26px 26px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.report-form .input-wrap input[type='date'] { min-width: 0; }
.report-form .report-submit { align-self: end; }
.report-form .report-submit .button { width: 100%; min-height: 51px; justify-content: space-between; }
.report-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 18px; }
.report-head h2 { font-size: 20px; letter-spacing: -.5px; }
.report-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.draft-mark, .report-note { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #e2c98d; border-radius: 8px; background: #fff8e6; color: #6b4e00; font-size: 12px; font-weight: 600; line-height: 1.5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-head .draft-mark { margin-top: 0; color: #6b4e00; }
.draft-mark .icon, .report-note .icon { width: 16px; height: 16px; flex-shrink: 0; }
.report-note { margin-top: 18px; }
.report-total { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.report-total strong { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.report-gap { margin-top: 24px; }
[data-report-day] .count-badge { flex-shrink: 0; white-space: nowrap; }
.report-gap .records-footer .button { min-height: 44px; }
.report-head-side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.report-head-side .button { min-height: 44px; }
@media print {
    .report-form, .report-head-side .button { display: none; }
}
@media (max-width: 480px) {
    .report-form { padding: 20px 18px 2px; }
    .report-head h2 { font-size: 18px; }
    .draft-mark { width: 100%; }
}

/* La pantalla «Verificación» (7b): la línea de lo que NO detecta, la ayuda del rango y el resultado de verificar el tramo. El texto largo (una serie de reloj) parte donde haga falta para no empujar la página de lado. */
.chain-limits, .chain-hint { max-width: 1000px; margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: #4a5f69; overflow-wrap: anywhere; }
.chain-outcome { max-width: 1000px; margin: 0 0 28px; padding: 20px 24px; border: 1px solid #c9d8de; border-left: 4px solid var(--teal); border-radius: 8px; background: #fff; overflow-wrap: anywhere; }
.chain-outcome[data-chain-state='broken'] { border-left-color: var(--error); }
.chain-outcome[data-chain-state='late'], .chain-outcome[data-chain-state='failed'], .chain-outcome[data-chain-state='too_large'] { border-left-color: #b7791f; }
.chain-outcome p { margin: 0 0 10px; line-height: 1.6; }
.chain-outcome p:last-child { margin-bottom: 0; }
.chain-outcome .chain-headline { font-size: 16px; font-weight: 600; }

/* /plataforma (historia 17a): el login es una sola columna centrada y la cuenta que entró se ve en la barra de arriba. */
.platform-login { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.platform-account { font-size: 12px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; text-align: right; }
/* /plataforma, «Empresas» (historia 17a, T6): la búsqueda, la paginación y el texto largo de las celdas. La tabla es la de siempre (`.records-table`); a 680 px o menos pasa a tarjetas con `data-stack` (R280). Solo el NOMBRE de la empresa
   (lo escribe cada empresa) parte donde haga falta en la tabla: `anywhere` baja el ancho mínimo de la columna y partía «Verificada» a media palabra a 1280 px; en las tarjetas (≤ 680 px) todas las celdas pueden partir. */
.platform-search { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 16px; max-width: 640px; margin-bottom: 24px; }
.platform-search .form-field { flex: 1 1 260px; min-width: 0; margin-bottom: 0; }
.platform-hint { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }
.platform-search-submit { min-height: 51px; margin-top: 26px; }
.field-error a { color: inherit; }
.records-table[data-platform-tenants] td:first-child { overflow-wrap: anywhere; }
.pager { padding: 0 24px 24px; }
.pager ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pager a, .pager [aria-current='page'], .pager li[aria-hidden='true'] span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 7px; font-size: 12px; font-weight: 650; }
.pager a { border: 1px solid #bdcbd1; background: var(--surface); color: var(--ink); text-decoration: none; }
.pager a:hover { background: #edf4f3; border-color: #7f9e9a; }
.pager [aria-current='page'] { background: var(--teal); color: #fff; }
.pager li[aria-hidden='true'] span { color: var(--muted); min-width: 0; padding: 0 4px; }
@media (max-width: 680px) {
    .records-table[data-platform-tenants] td { overflow-wrap: anywhere; }
    .platform-search { max-width: none; }
    .platform-search .form-field { flex-basis: 100%; }
    .platform-search-submit { margin-top: 14px; margin-bottom: 8px; width: 100%; }
    .pager { padding: 0 16px 20px; }
}
