:root {
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: Consolas, Menlo, monospace;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --nav-h: 64px;
  --ease: cubic-bezier(.22,.9,.3,1);
}

html[data-theme="light"] {
  --bg: #EDF1F6;
  --surface: #FFF;
  --surface2: #F4F7FA;
  --border: #D6DFE9;
  --text: #16222F;
  --dim: #59697B;
  --primary: #0F4C81;
  --onpri: #FFF;
  --prisoft: #E1EBF5;
  --accent: #1173B1;
  --ok: #178A4C;
  --onok: #FFF;
  --oksoft: #E1F3E9;
  --warn: #B45309;
  --onwarn: #FFF;
  --warnsoft: #FBEEDC;
  --danger: #BE3A3A;
  --ondanger: #FFF;
  --dangersoft: #FBE7E5;
  --info: #0F62A8;
  --oninfo: #FFF;
  --infosoft: #E2EDF8;
  --shadow-sm: 0 2px 10px rgba(15,76,129,.08);
  --grid-line: rgba(15,76,129,.05);
}

html[data-theme="dark"] {
  --bg: #121212;
  --surface: #1B1D23;
  --surface2: #22252C;
  --border: #2E323A;
  --text: #EAEDF2;
  --dim: #9BA7B4;
  --primary: #54A9FF;
  --onpri: #071523;
  --prisoft: #16324C;
  --accent: #54A9FF;
  --ok: #3ECF7D;
  --onok: #052013;
  --oksoft: #10331F;
  --warn: #F5A524;
  --onwarn: #221302;
  --warnsoft: #3A2A10;
  --danger: #FF6B5E;
  --ondanger: #2B0705;
  --dangersoft: #3D1512;
  --info: #5AB2FF;
  --oninfo: #07182B;
  --infosoft: #122B45;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.4);
  --grid-line: rgba(255,255,255,.035);
}

html[data-theme="ocean"] {
  --bg: #07222E;
  --surface: #0C2F3E;
  --surface2: #113A4C;
  --border: #1E4A5E;
  --text: #E7F4F4;
  --dim: #93B8C4;
  --primary: #2EC4B6;
  --onpri: #032A2B;
  --prisoft: #0E454A;
  --accent: #2EC4B6;
  --ok: #38D08B;
  --onok: #04231A;
  --oksoft: #0E3A2C;
  --warn: #FFC24D;
  --onwarn: #241703;
  --warnsoft: #403010;
  --danger: #FF7A6B;
  --ondanger: #2B0906;
  --dangersoft: #451B15;
  --info: #4CC3FF;
  --oninfo: #04202E;
  --infosoft: #0E3548;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --grid-line: rgba(46,196,182,.06);
}

html[data-theme="forest"] {
  --bg: #EFF3EA;
  --surface: #FFF;
  --surface2: #F6F8F1;
  --border: #D8E0CB;
  --text: #22301F;
  --dim: #5D6B4E;
  --primary: #386641;
  --onpri: #FFF;
  --prisoft: #E4EFE3;
  --accent: #A98467;
  --ok: #3D9257;
  --onok: #FFF;
  --oksoft: #E3F2E4;
  --warn: #B26205;
  --onwarn: #FFF;
  --warnsoft: #F7EBD9;
  --danger: #B94A3E;
  --ondanger: #FFF;
  --dangersoft: #F8E6E1;
  --info: #46708C;
  --oninfo: #FFF;
  --infosoft: #E4EEF2;
  --shadow-sm: 0 2px 10px rgba(56,102,65,.09);
  --grid-line: rgba(56,102,65,.055);
}

html[data-theme="sunset"] {
  --bg: #FBF0E7;
  --surface: #FFFDFA;
  --surface2: #FAF0E6;
  --border: #EFD9C6;
  --text: #372317;
  --dim: #8A6550;
  --primary: #D1495B;
  --onpri: #FFF;
  --prisoft: #FBE3E4;
  --accent: #F2994A;
  --ok: #3E9253;
  --onok: #FFF;
  --oksoft: #E5F3E5;
  --warn: #C97408;
  --onwarn: #FFF;
  --warnsoft: #FBEBD5;
  --danger: #C0392B;
  --ondanger: #FFF;
  --dangersoft: #F9E3DF;
  --info: #9C4D77;
  --oninfo: #FFF;
  --infosoft: #F4E3EC;
  --shadow-sm: 0 2px 10px rgba(209,73,91,.09);
  --grid-line: rgba(209,73,91,.05);
}

html[data-theme="sakura"] {
  --bg: #FAF4F6;
  --surface: #FFF;
  --surface2: #FBF3F5;
  --border: #EEDCE2;
  --text: #3B2B33;
  --dim: #8A707B;
  --primary: #A85D75;
  --onpri: #FFF;
  --prisoft: #F6E6EB;
  --accent: #E5989B;
  --ok: #4C9A62;
  --onok: #FFF;
  --oksoft: #E6F3E9;
  --warn: #B5822E;
  --onwarn: #FFF;
  --warnsoft: #F8EFDC;
  --danger: #C25460;
  --ondanger: #FFF;
  --dangersoft: #F9E6E8;
  --info: #6C7FBF;
  --oninfo: #FFF;
  --infosoft: #E9EDF9;
  --shadow-sm: 0 2px 10px rgba(168,93,117,.09);
  --grid-line: rgba(168,93,117,.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  position: relative;
}

/* Marca de agua sutil del ícono */
body::before {
  content: '';
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 120px;
  height: 120px;
  background-image: url('icon.svg');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

.narrow {
  max-width: 760px;
}

.shell {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  width: 240px;
  display: none;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100dvh;
}

.sb-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

.sb-brand b {
  font-size: 18px;
  font-weight: 800;
  display: block;
}

.sb-brand small {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  flex: 1;
}

.sb-nav .navbtn {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--dim);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  width: 100%;
}

.sb-nav .navbtn.on {
  background: var(--prisoft);
  color: var(--primary);
}

.sb-user {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tb-title {
  flex: 1;
  min-width: 0;
}

.tb-title h1 {
  font-size: 16px;
  font-weight: 800;
}

.tb-title p {
  font-size: 11px;
  color: var(--dim);
}

.tb-clock {
  font-weight: 800;
}

.tb-clock small {
  display: block;
  font-size: 10px;
  color: var(--dim);
  text-align: right;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip.ok {
  background: var(--oksoft);
  color: var(--ok);
}

.chip.warn {
  background: var(--warnsoft);
  color: var(--warn);
}

.chip.info {
  background: var(--infosoft);
  color: var(--info);
}

.chip.soft {
  background: var(--surface2);
  color: var(--dim);
  border-color: var(--border);
}

.chip .bdot {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--warn);
  color: var(--onwarn);
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.off-banner {
  display: none;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--warnsoft);
  color: var(--warn);
}

.off-banner.show {
  display: flex;
}

.content {
  flex: 1;
  padding: 18px 16px calc(var(--nav-h) + 30px);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: vIn .35s var(--ease);
}

@keyframes vIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
  }
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
}

.wrap.narrow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.card-h h3 {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.card-b {
  padding: 16px;
}

.card-b.thin {
  padding: 8px 16px;
}

.clock-card {
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.clock-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.greet {
  font-size: 13px;
  color: var(--dim);
  font-weight: 600;
}

.big-clock {
  font-size: clamp(38px, 9vw, 52px);
  font-weight: 800;
  line-height: 1.05;
}

.big-date {
  font-size: 13px;
  color: var(--dim);
  text-transform: capitalize;
}

.steps {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  min-width: 64px;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  width: calc(100% - 28px);
  height: 2px;
  background: var(--border);
}

.step .pt {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: 11px;
  color: transparent;
  z-index: 1;
}

.step.done .pt {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--onok);
}

.step.done:not(:last-child)::after {
  background: var(--ok);
}

.step.now .pt {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--prisoft);
}

.step small {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
}

.step.done small {
  color: var(--ok);
}

.reader-zone {
  position: relative;
  height: 290px;
  background: #0C0F14;
  border-radius: var(--r-md);
  overflow: hidden;
  display: grid;
  place-items: center;
}

#qrVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 1;
}

.qr-ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: .25;
}

.reader-zone.camera-on .qr-ghost {
  display: none;
}

.scan-frame {
  position: relative;
  width: 240px;
  height: 240px;
  max-width: 80%;
  max-height: 80%;
  box-shadow: 0 0 0 999px rgba(5,8,12,.62);
  z-index: 3;
}

.scan-frame .corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3.5px solid var(--accent);
}

.c1 {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
}

.c2 {
  top: -2px;
  right: -2px;
  border-left: 0;
  border-bottom: 0;
}

.c3 {
  bottom: -2px;
  left: -2px;
  border-right: 0;
  border-top: 0;
}

.c4 {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
}

.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10%;
  height: 2.5px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  opacity: 0;
  z-index: 4;
}

.reader-zone.scanning .scan-line {
  opacity: 1;
  animation: scan 1.7s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% {
    top: 8%;
  }
  50% {
    top: 90%;
  }
}

.scan-status {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: #DDE6F0;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 4;
  padding: 0 12px;
}

.torch-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20,25,32,.7);
  color: #EAF2FA;
  border: 1px solid rgba(255,255,255,.2);
}

.torch-btn.on {
  background: var(--warn);
  color: var(--onwarn);
}

.scan-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.token-chip {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--oksoft);
  color: var(--ok);
  font-weight: 700;
  font-size: 13px;
}

.token-chip.show {
  display: inline-flex;
}

.token-chip code {
  font-family: var(--mono);
  letter-spacing: .12em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--onpri);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn.big {
  width: 100%;
  justify-content: center;
  padding: 15px;
  font-size: 16px;
  border-radius: 12px;
}

.btn.big.st-ok {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--onok);
}

.btn.big.st-warn {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--onwarn);
}

.btn.big.st-info {
  background: var(--info);
  border-color: var(--info);
  color: var(--oninfo);
}

.btn.big.st-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--ondanger);
}

.hint-c {
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
  margin-top: -6px;
}

.geo-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.geofence-viz {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.geofence-viz .ring30 {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1.5px dashed var(--ok);
}

.geofence-viz.out .ring30 {
  border-color: var(--warn);
}

.geofence-viz .office {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px;
  border-radius: 50%;
  background: var(--primary);
}

.geofence-viz .userdot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 50%;
  background: var(--ok);
  transition: transform 1s var(--ease);
}

.geofence-viz.out .userdot {
  background: var(--warn);
}

.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--border);
}

.today-item:last-child {
  border: 0;
}

.ti-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.today-item .tt {
  flex: 1;
  text-align: left;
}

.today-item .tt b {
  font-size: 13.5px;
  display: block;
}

.today-item .tt small {
  font-size: 11px;
  color: var(--dim);
}

.today-item .tm {
  font-family: var(--mono);
  font-weight: 700;
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

.ruta-intro {
  font-size: 13.5px;
  color: var(--dim);
  margin-bottom: 12px;
}

.gps-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}

.gps-opt small {
  color: var(--dim);
  font-size: 11.5px;
  display: block;
}

.gps-state {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dim);
}

.chat-box {
  max-height: 280px;
  min-height: 110px;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface2);
}

.msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.msg.coord {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
}

.msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: var(--onpri);
}

.msg small {
  display: block;
  font-size: 10px;
  opacity: .7;
  margin-top: 3px;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
}

.chat-input input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  outline: none;
}

.hist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hist-head h2 {
  font-size: 19px;
  font-weight: 800;
}

.month-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mn-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.month-label {
  font-size: 16px;
  font-weight: 800;
  min-width: 150px;
  text-align: center;
  text-transform: capitalize;
}

.sum-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.sum-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
}

.sum-item b {
  font-size: 20px;
  font-weight: 800;
  display: block;
}

.sum-item span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
}

.hrow {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr .8fr;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.hrow.head {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--surface2);
}

.hcell b {
  font-family: var(--mono);
}

.hcell .dash {
  color: var(--dim);
  opacity: .6;
}

.hdate b {
  font-weight: 700;
  display: block;
}

.hdate small {
  font-size: 11px;
  color: var(--dim);
  text-transform: capitalize;
}

.ot-pos {
  color: var(--ok);
  font-weight: 800;
  font-family: var(--mono);
}

.ast {
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  position: relative;
  top: -3px;
  padding: 1px 5px;
}

.legend {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--dim);
}

.legend .ast {
  top: 0;
  pointer-events: none;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  position: relative;
}

.kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--kc, var(--primary));
}

.kpi b {
  font-size: 24px;
  font-weight: 800;
  display: block;
}

.kpi span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 160px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 12px;
}

.search-box input {
  border: 0;
  background: none;
  width: 100%;
  padding: 9px 0;
  outline: none;
}

select.ctl, input.ctl {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.table-scroll {
  overflow-x: auto;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.adm-table th {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  padding: 10px 12px;
  background: var(--surface2);
}

.adm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.emp-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--prisoft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.emp-cell b {
  display: block;
  font-size: 13px;
}

.emp-cell small {
  font-size: 11px;
  color: var(--dim);
}

.lock-box {
  text-align: center;
  padding: 46px 20px;
}

.lock-box h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.lock-box p {
  font-size: 13px;
  color: var(--dim);
}

.chk-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
}

.switch .tr {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border);
}

.switch .tr::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .25s var(--ease);
}

.switch input:checked + .tr {
  background: var(--ok);
}

.switch input:checked + .tr::after {
  transform: translateX(18px);
}

.audit-item {
  padding: 11px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}

.audit-item:last-child {
  border: 0;
}

.audit-item .a-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 2px;
}

.audit-item code {
  font-family: var(--mono);
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--primary);
  font-weight: 700;
}

.set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}

.set-row small {
  color: var(--dim);
  display: block;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.theme-card {
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  background: var(--surface);
  text-align: left;
}

.theme-card.on {
  border-color: var(--primary);
}

.theme-card .sw {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.theme-card .sw i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.theme-card b {
  font-size: 13px;
  display: block;
}

.theme-card small {
  font-size: 11px;
  color: var(--dim);
}

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

.bottomnav .navbtn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
}

.bottomnav .navbtn.on {
  color: var(--primary);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(8,13,20,.58);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.overlay.show {
  display: flex;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  overflow: auto;
}

.modal .m-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 20px 0;
}

.modal .m-head .m-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--prisoft);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.modal .m-head h2 {
  font-size: 17px;
  font-weight: 800;
}

.modal .m-head small {
  font-size: 12px;
  color: var(--dim);
}

.modal .m-body {
  padding: 16px 20px 20px;
}

.m-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--dim);
}

.fld {
  margin-bottom: 13px;
}

.fld label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 5px;
}

.fld input, .fld select, .fld textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px;
  font-size: 14px;
  outline: none;
}

.fld textarea {
  min-height: 60px;
  resize: vertical;
}

.tp-manual {
  font-family: var(--mono);
  font-size: 22px;
  text-align: center;
  letter-spacing: .3em;
  font-weight: 700;
}

.form-err {
  display: none;
  background: var(--dangersoft);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}

.form-err.show {
  display: block;
}

.policy-box {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface2);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
}

.policy-box.show {
  display: block;
}

.kiosk-code {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: .3em;
  margin: 12px 0 4px;
}

.loading-ov {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8,13,20,.62);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-ov.show {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--accent);
  animation: rot .85s linear infinite;
}

@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

.loading-ov p {
  color: #F2F6FA;
  font-weight: 700;
}

.toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100% - 28px));
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  overflow: hidden;
  animation: tIn .35s var(--ease);
}

@keyframes tIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
  }
}

.toast .t-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
}

.toast.ok .t-ico {
  background: var(--oksoft);
  color: var(--ok);
}

.toast.warn .t-ico {
  background: var(--warnsoft);
  color: var(--warn);
}

.toast.info .t-ico {
  background: var(--infosoft);
  color: var(--info);
}

.toast.danger .t-ico {
  background: var(--dangersoft);
  color: var(--danger);
}

.toast .t-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.toast .t-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--primary);
  width: 100%;
  transform-origin: left;
  animation: shrink 5s linear forwards;
}

@keyframes shrink {
  to {
    transform: scaleX(0);
  }
}

.popover {
  position: fixed;
  z-index: 96;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  max-width: 270px;
  font-size: 12.5px;
  display: none;
}

.popover.show {
  display: block;
}

.popover b.p-t {
  display: block;
  color: var(--primary);
  margin-bottom: 2px;
}

.popover .p-row {
  color: var(--dim);
  margin-top: 4px;
}

@media (min-width: 920px) {
  .sidebar {
    display: flex;
  }
  
  .bottomnav {
    display: none !important;
  }
  
  .content {
    padding: 24px 28px;
  }
  
  .modal {
    border-radius: 18px;
    margin: auto;
  }
  
  .overlay {
    padding: 24px;
    align-items: center;
  }
  
  .toast-host {
    left: auto;
    right: 24px;
    transform: none;
    bottom: 24px;
  }
}

@media (max-width: 700px) {
  .hrow {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .hrow.head {
    display: none;
  }
  
  .hcell::before {
    content: attr(data-l);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--dim);
  }
  
  .hcell {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hdate {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 8px;
  }
  
  .tb-clock {
    display: none;
  }
}

#loginBox {
  align-items: center;
  padding: 14px;
}

#loginBox .modal {
  max-height: 88dvh;
  margin: auto;
}
.hcell{display:flex;flex-direction:column;gap:3px;align-items:flex-start}
*{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea{-webkit-user-select:text;user-select:text}
#printArea{display:none}
@media print{
body *{visibility:hidden}
#printArea,#printArea *{visibility:visible}
#printArea{display:block;position:absolute;left:0;top:0;width:100%;background:#fff;color:#000;text-align:center;padding:24px}
#printArea img{width:340px;height:340px}
#printArea .p-code{font-size:34px;letter-spacing:.35em;font-family:Consolas,Menlo,monospace;font-weight:700;margin:10px 0}
#printArea .p-meta{font-size:14px;margin:4px 0}
}