:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --line: #243244;
  --text: #e5eef9;
  --muted: #9fb0c7;
  --primary: #4f46e5;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --pending: #2563eb;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79,70,229,.18), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0f172a 60%, #111827 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: #c7d6ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.mobile-shell { max-width: 760px; }
.admin-shell { max-width: 1380px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  backdrop-filter: blur(18px);
  background: rgba(10, 15, 28, .72);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand { font-weight: 800; font-size: 1.1rem; color: white; }
.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.topnav a, .user-chip, .chip {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .92rem;
}
.topnav a.active { background: rgba(79,70,229,.28); border-color: rgba(99,102,241,.5); }
.user-chip { color: var(--muted); }
.topnav form { margin: 0; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 460px);
  padding: 28px;
}
.center-card { text-align: center; }
.narrow { max-width: 560px; margin: 0 auto; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); margin-bottom: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 10px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: #a5b4fc; font-size: .74rem; margin-bottom: 10px; }
.subtle, small, .empty { color: var(--muted); }
.login-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  line-height: 1.55;
}

label { display: grid; gap: 8px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(15,23,42,.9);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(99,102,241,.45);
  border-color: rgba(99,102,241,.75);
}

.password-field { position: relative; }
.password-field input { padding-right: 56px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 0;
}
.password-toggle:hover { background: rgba(255,255,255,.08); }
.password-toggle:focus { outline: 2px solid rgba(99,102,241,.45); }
.inline-check {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inline-check input { width: auto; }

.btn, button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: rgba(59,130,246,.18); color: #dbeafe; }
.btn-danger { background: rgba(220,38,38,.22); color: #fecaca; }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); }
.btn-small { padding: 10px 12px; font-size: .88rem; }
.btn-block { width: 100%; display: inline-block; text-align: center; }
button:disabled { opacity: .4; cursor: not-allowed; }

.flash {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.08);
}
.flash-success { background: rgba(22,163,74,.18); color: #bbf7d0; }
.flash-error { background: rgba(220,38,38,.18); color: #fecaca; }

.status-card {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}
.status-working { background: rgba(22,163,74,.2); color: #bbf7d0; }
.status-paused { background: rgba(217,119,6,.2); color: #fde68a; }
.status-out { background: rgba(220,38,38,.2); color: #fecaca; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stats-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card strong, .mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}
.mini-stat {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.03);
}

.stamp-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}
.stamp-btn {
  width: 100%;
  min-height: 74px;
  border-radius: 22px;
  font-size: 1.22rem;
  box-shadow: var(--shadow);
}
.stamp-in { background: linear-gradient(180deg, #22c55e, #15803d); color: white; }
.stamp-pause { background: linear-gradient(180deg, #f59e0b, #b45309); color: white; }
.stamp-out { background: linear-gradient(180deg, #ef4444, #b91c1c); color: white; }

.grid { display: grid; gap: 20px; }
.two-col-mobile, .two-col-desktop, .admin-grid-large, .company-grid { grid-template-columns: 1fr; }
.company-grid { display: grid; gap: 20px; }
.company-card { min-height: 220px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.stack-sm { display: grid; gap: 8px; }
.stack-md { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 18px; }
.top-gap { margin-top: 18px; }

.timeline { display: grid; gap: 12px; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.timeline-badge {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #93c5fd;
}
.timeline-badge.in { background: #22c55e; }
.timeline-badge.pause-start, .timeline-badge.pause-end { background: #f59e0b; }
.timeline-badge.out { background: #ef4444; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  vertical-align: top;
}
th { color: #c7d2fe; font-size: .9rem; }

.note-item, .request-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,.03);
}
.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.actions-inline.wrap { gap: 8px; }

.filter-grid {
  display: grid;
  gap: 14px;
}
.checkbox-grid {
  display: grid;
  gap: 10px;
}
.check-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.check-card input {
  width: auto;
}
.check-card span {
  display: grid;
}
.module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-pending { background: rgba(37,99,235,.18); }
.chip-approved { background: rgba(22,163,74,.18); }
.chip-rejected { background: rgba(220,38,38,.18); }

@media (min-width: 768px) {
  .shell { padding: 28px 20px 56px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-col-mobile, .two-col-desktop, .admin-grid-large, .company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkbox-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .stats-grid.compact { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  table { min-width: 560px; }
}


.center-line { text-align:center; }
.small-code { word-break: break-all; font-size: .85rem; display:block; }
code { white-space: pre-wrap; }
input[type="month"] { min-height: 48px; }
.actions-inline input[type="text"],
.actions-inline input[type="number"] { min-width: 220px; }
.request-card form { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }


.topbar {
  transition: transform .24s ease, opacity .24s ease, padding .24s ease;
}

@media (max-width: 1024px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }

  .topbar .brand {
    display: inline-block;
    font-size: 1rem;
    line-height: 1.2;
    margin-top: 2px;
  }

  .topnav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .topnav a,
  .topnav .user-chip,
  .topnav .chip,
  .topnav .btn-ghost,
  .topnav form {
    flex: 0 0 auto;
  }

  .topnav a,
  .topnav .user-chip,
  .topnav .chip,
  .topnav .btn-ghost {
    font-size: .9rem;
    padding: 8px 12px;
  }

  body.topbar-hidden .topbar {
    transform: translateY(calc(-100% - 10px));
    opacity: .01;
    pointer-events: none;
  }

  .admin-shell,
  .mobile-shell,
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }
}

.top-gap-sm { margin-top: 12px; }
.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.service-option {
  position: relative;
  display: block;
}
.service-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.service-option span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.service-option input:checked + span {
  border-color: rgba(34,197,94,.75);
  background: rgba(22,163,74,.18);
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.35);
}
.mobile-service-card .chip { align-self: flex-start; }
@media (min-width: 768px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.privacy-check { align-items: flex-start; }
.privacy-check strong { display: block; margin-bottom: 4px; }
.privacy-check small { line-height: 1.45; }
.privacy-check a { color: #c7d2fe; }

.policy-box {
  max-height: 60vh;
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  line-height: 1.65;
}

.policy-box p:last-child {
  margin-bottom: 0;
}

.policy-admin-grid {
  align-items: start;
}

.privacy-card {
  width: min(100%, 820px);
}

.privacy-auth-shell {
  align-items: start;
  padding-top: 48px;
  padding-bottom: 48px;
}

.consent-check {
  align-items: flex-start;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 2px 8px;
}

.module-group-card { padding: 1rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; background: rgba(255,255,255,0.02); }
.module-group-card h2 { margin: 0; font-size: 1rem; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 0.75rem; }
.service-option { display: block; position: relative; }
.service-option input { position: absolute; inset: 0; opacity: 0; }
.service-option span { display: flex; flex-direction: column; gap: 0.25rem; min-height: 84px; justify-content: center; padding: 0.9rem 1rem; border-radius: 16px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.03); }
.service-option input:checked + span { border-color: rgba(99,102,241,0.8); background: rgba(99,102,241,0.14); }
.small-code { display: inline-block; max-width: 420px; white-space: pre-wrap; word-break: break-word; }



.module-help {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.check-card.is-disabled {
  opacity: .58;
}

.check-card input:disabled + span {
  opacity: .85;
}

.banner-card {
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(99,102,241,.28);
  background: linear-gradient(180deg, rgba(79,70,229,.18), rgba(79,70,229,.08));
}

.banner-card h3,
.banner-card p {
  margin-bottom: 8px;
}

.progress-card {
  display: grid;
  gap: 10px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #22c55e);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .92rem;
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.03);
}

.note-card.is-pinned {
  border-color: rgba(99,102,241,.4);
  background: rgba(79,70,229,.1);
}

.mobile-dual-grid {
  display: grid;
  gap: 14px;
}

.dashboard-plus-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 768px) {
  .dashboard-plus-grid,
  .mobile-dual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.kiosk-page .topbar { display: none; }
.kiosk-card { width: min(100%, 760px); }
.note-list { display: grid; gap: 12px; }
.note-card { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.03); }
.note-card.is-pinned { border-color: rgba(99,102,241,.45); }
.progress-card { min-height: 100%; }
.progress-bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #818cf8); }
.progress-meta { display: grid; gap: 8px; margin-top: 12px; color: var(--muted); }
.dashboard-plus-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .dashboard-plus-grid { grid-template-columns: 1.4fr 1fr; } }
@media (max-width: 1024px) { .topbar { position: sticky; top: 0; } }


.impersonation-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.06);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  flex-wrap: wrap;
}

.impersonation-banner strong {
  margin-right: 8px;
}

@media (max-width: 900px) {
  .impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 20;
  }
}


.admin-users-layout {
  gap: 22px;
}

.admin-users-create-card {
  width: 100%;
}

.admin-users-form .actions-inline {
  margin-top: 4px;
}

.admin-users-inline-check {
  align-self: end;
  min-height: 52px;
  padding-top: 6px;
}

.table-wrap-wide {
  overflow-x: auto;
}

.user-table-wide {
  min-width: 1040px;
}

@media (min-width: 1024px) {
  .admin-users-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-users-create-card {
    padding: 24px;
  }

  .admin-users-list-card {
    padding: 24px;
  }
}

@media (max-width: 767px) {
  .admin-users-create-card,
  .admin-users-list-card {
    padding: 16px;
  }

  .user-table-wide {
    min-width: 880px;
  }
}


.request-mode-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  line-height: 1.45;
}
.request-mode-note.compact {
  font-size: .92rem;
  padding: 10px 12px;
}
.history-request-grid > label {
  min-width: 0;
}
input[type="datetime-local"] {
  min-width: 0;
  padding-right: 44px;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: .92;
  cursor: pointer;
}
@media (min-width: 768px) and (max-width: 1199px) {
  .history-request-grid {
    grid-template-columns: 1fr;
  }
}
