:root {
  --ink: #0f1215;
  --ink-2: #1a1f24;
  --steel: #5c6670;
  --mist: #a8b0b8;
  --paper: #f2efe8;
  --paper-2: #e8e4db;
  --line: #d4cfc4;
  --teal: #0f766e;
  --teal-soft: #ccfbf1;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --rust: #b33a2b;
  --rust-soft: #fde8e4;
  --ok: #2f6b4f;
  --ok-soft: #d8f0e4;
  --sidebar-w: 236px;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(15, 18, 21, .05), 0 8px 24px rgba(15, 18, 21, .06);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ── Login ── */
.login {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--paper);
  z-index: 100;
}

.login-art {
  background:
    linear-gradient(180deg, rgba(15, 18, 21, .82) 0%, rgba(15, 18, 21, .35) 38%, rgba(15, 18, 21, .55) 62%, rgba(15, 18, 21, .94) 100%),
    url("img/login-hero.jpg") center / cover no-repeat,
    var(--ink);
  color: #e8ecef;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-art::after {
  display: none;
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 60px solid rgba(15, 118, 110, .18);
}

.login-art h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 13ch;
}

.login-chain {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: 1.5rem;
}

.login-chain li {
  font-size: .78rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: #c5ccd3;
}

.login-chain li+li::before {
  content: "→ ";
  color: var(--teal);
}

.login-foot {
  color: var(--mist);
  font-size: .8rem;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.login-card {
  width: min(440px, 100%);
}

.login-card h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  margin-bottom: .35rem;
}

.login-card>.muted {
  margin-bottom: 1.25rem;
}

.login-err {
  color: var(--rust);
  font-size: .85rem;
  min-height: 1.2rem;
  margin: .25rem 0 .5rem;
}

.login-go {
  width: 100%;
  justify-content: center;
  padding: .7rem;
}

.demo-h {
  margin: 1.5rem 0 0;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
}

.demo-group {
  margin: 1rem 0 .45rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
  font-weight: 600;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}

.demo-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .6rem .7rem;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.demo-user:hover:not(:disabled) {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.demo-user:active:not(:disabled) {
  transform: scale(.98);
}

.demo-user:disabled {
  opacity: .6;
  cursor: wait;
}

.demo-user .demo-ico {
  flex: none;
  font-size: 1.05rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
}

.demo-user strong {
  display: block;
  font-size: .88rem;
}

.demo-user span {
  display: block;
  font-size: .72rem;
  color: var(--steel);
}

/* ── Shell ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  color: #e8ecef;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: transform .25s ease;
}

.brand {
  padding: 1.1rem 1.2rem .9rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.brand-mark span {
  width: 10px;
  height: 10px;
  background: var(--teal);
  border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .35);
}

.brand-sub {
  font-size: .7rem;
  color: var(--mist);
  margin-top: .3rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: .6rem .6rem 1rem;
}

.nav-group {
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--steel);
  padding: .8rem .6rem .3rem;
}

.nav-subgroup-label {
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(197, 204, 211, .55);
  padding: .55rem .65rem .2rem;
  margin-top: .15rem;
}

.nav-subgroup-label:first-child {
  margin-top: 0;
}

.nav-subgroup-label + .nav-btn,
.nav-btn + .nav-subgroup-label {
  margin-top: 0;
}

.page-lead {
  margin: 0 0 .75rem;
  max-width: 52rem;
}

.page-toolbar {
  margin-bottom: .75rem;
}

.page-body .toolbar {
  margin-bottom: .75rem;
}

/* Team overview dashboard */
.team-overview {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.team-overview-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 55%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.team-overview-kicker {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 .35rem;
}

.team-overview-toolbar {
  margin-bottom: 1rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .45rem;
  line-height: 0;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.btn-icon .icon-print {
  display: block;
}

.team-section {
  margin-bottom: 1.25rem;
}

.team-section-head {
  margin-bottom: .65rem;
}

.team-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.01em;
}

.team-kpi-grid .team-kpi {
  height: 100%;
}

.team-kpi-ok {
  border-left: 3px solid var(--ok);
}

.team-kpi-warn {
  border-left: 3px solid var(--amber);
}

.team-dept-bars {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-dept-bars li {
  margin-bottom: .65rem;
}

.team-dept-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
}

.team-dept-name {
  font-size: .88rem;
  font-weight: 500;
}

.team-dept-meter {
  height: 6px;
}

.team-coverage-block .meter {
  margin-top: .45rem;
}

.team-trend-bars {
  min-height: 140px;
}

.team-branch-tiles-wrap {
  overflow-x: auto;
}

.team-branch-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: .65rem;
}

.team-branch-tile {
  min-height: 5.5rem;
}

.team-branch-tile .stat-value {
  font-size: 1.25rem;
}

/* HR dashboard (People overview) */
.team-overview.hr-dash-wrap,
.team-overview {
  gap: 1rem;
}

.hr-dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1rem 1.15rem;
  margin-bottom: .25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hr-dash-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .65rem;
  margin-bottom: .35rem;
}

.hr-dash-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.02em;
}

.hr-dash-pill {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #f5e6d3;
  color: #7c5c3a;
}

.hr-dash-sub {
  margin: 0;
  max-width: 42rem;
}

.hr-dash-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  min-width: min(100%, 20rem);
}

.hr-dash-toolbar {
  margin: 0;
}

.hr-drill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: .25rem;
}

@media (max-width: 1100px) {
  .hr-drill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .hr-drill-grid {
    grid-template-columns: 1fr;
  }
}

.hr-drill-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  width: 100%;
  text-align: left;
  padding: .85rem .95rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.hr-drill-card:not(button) {
  cursor: default;
}

.hr-drill-card:hover,
.hr-drill-card:focus-visible {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.hr-drill-card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .hr-drill-card:active {
    transform: scale(0.99);
  }
}

.hr-drill-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.hr-drill-card--blue .hr-drill-card__icon { background: #e0f2fe; color: #0369a1; }
.hr-drill-card--slate .hr-drill-card__icon { background: #f1f5f9; color: #475569; }
.hr-drill-card--green .hr-drill-card__icon { background: #dcfce7; color: #15803d; }
.hr-drill-card--purple .hr-drill-card__icon { background: #ede9fe; color: #6d28d9; }
.hr-drill-card--amber .hr-drill-card__icon { background: #fef3c7; color: #b45309; }
.hr-drill-card--indigo .hr-drill-card__icon { background: #e0e7ff; color: #4338ca; }
.hr-drill-card--red .hr-drill-card__icon { background: #fee2e2; color: #b91c1c; }
.hr-drill-card--rose .hr-drill-card__icon { background: #fce7f3; color: #be185d; }
.hr-drill-card--sand .hr-drill-card__icon { background: #f5e6d3; color: #92400e; }

.hr-drill-card__body {
  flex: 1;
  min-width: 0;
}

.hr-drill-card__label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: .15rem;
}

.hr-drill-card__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.hr-drill-card__meta {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-top: .25rem;
  line-height: 1.35;
}

.hr-drill-card__chev {
  flex-shrink: 0;
  opacity: .35;
  margin-top: .15rem;
}

.hr-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .85rem 1rem 1rem;
}

.hr-panel--wide {
  min-width: 0;
}

.hr-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}

.hr-panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.hr-dash-main,
.hr-dash-secondary,
.hr-dash-charts {
  margin-top: .25rem;
}

.hr-dash-main {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  align-items: start;
}

@media (max-width: 900px) {
  .hr-dash-main {
    grid-template-columns: 1fr;
  }
}

.hr-dash-branch-cols {
  margin-top: .25rem;
  align-items: stretch;
}

.hr-dash-branch-cols > .hr-panel--col {
  height: 100%;
  min-height: 24rem;
  display: flex;
  flex-direction: column;
}

.hr-panel--col .hr-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hr-panel--col .hr-panel-body .hr-shift-grid {
  flex: 1;
  justify-content: flex-start;
}

.hr-panel--col .hr-panel-body .hr-pending-list,
.hr-panel--col .hr-panel-body .hr-ho-list,
.hr-panel--col .hr-panel-body .hr-alert-rows,
.hr-panel--col .hr-panel-body .hr-decision-list {
  flex: 1;
  overflow-y: auto;
  padding-right: .15rem;
}

.hr-branch-table th,
.hr-branch-table td {
  font-size: .86rem;
  vertical-align: middle;
}

.hr-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: .78rem;
  font-weight: 600;
}

.hr-count-badge--sm {
  min-width: 1.45rem;
  font-size: .72rem;
}

.hr-decision-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-decision-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .65rem .5rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.hr-decision-row:last-child {
  border-bottom: none;
}

.hr-decision-row:hover,
.hr-decision-row:focus-visible {
  background: #f8fafc;
}

.hr-decision-row__label {
  flex: 1;
  font-size: .88rem;
  font-weight: 500;
}

.hr-att-branch-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-att-branch-row {
  margin-bottom: .75rem;
}

.hr-att-branch-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .3rem;
  font-size: .86rem;
}

.hr-att-branch-meter {
  height: 8px;
  border-radius: 999px;
}

.hr-att-branch-meter i {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.hr-att-branch-foot {
  margin: .5rem 0 0;
}

.hr-alert-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-alert-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
}

.hr-alert-row:last-child {
  border-bottom: none;
}

.hr-alert-row__main {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.hr-alert-row__sub {
  color: var(--muted);
  font-weight: 400;
}

.hr-activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-activity-item {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}

.hr-activity-item:last-child {
  border-bottom: none;
}

.hr-activity-text {
  margin: 0 0 .2rem;
  font-size: .88rem;
}

.hr-activity-meta {
  margin: 0;
}

.hr-shift-grid {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.hr-shift-card {
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 1px solid transparent;
}

.hr-shift-card--amber { background: #fffbeb; border-color: #fde68a; }
.hr-shift-card--blue { background: #eff6ff; border-color: #bfdbfe; }
.hr-shift-card--green { background: #f0fdf4; border-color: #bbf7d0; }
.hr-shift-card--purple { background: #f5f3ff; border-color: #ddd6fe; }

.hr-shift-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}

.hr-shift-card__name {
  font-weight: 600;
  font-size: .9rem;
}

.hr-shift-card__time,
.hr-shift-card__stat {
  margin: 0;
}

.hr-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-pending-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}

.hr-pending-row:last-child {
  border-bottom: none;
}

.hr-ho-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-ho-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
}

.hr-ho-row:last-child {
  border-bottom: none;
}

.tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-amber { background: #fef3c7; color: #b45309; }
.tag-teal { background: #ccfbf1; color: #0f766e; }

.nav-btn {
  width: 100%;
  text-align: left;
  color: #c5ccd3;
  padding: .48rem .65rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    box-sizing: border-box;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.nav-btn.active {
  background: rgba(15, 118, 110, .28);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--teal);
}

.nav-ico {
  width: 1.1rem;
  opacity: .75;
  font-size: .82rem;
  text-align: center;
}

.nav-count {
  margin-left: auto;
  background: var(--rust);
  color: #fff;
  font-size: .68rem;
  padding: 0 .4rem;
  border-radius: 999px;
}

.sidebar-foot {
  padding: .9rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .8rem;
  color: var(--mist);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), #134e4a);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .75rem;
  color: #fff;
  flex-shrink: 0;
}

.logout-btn {
  margin-top: .7rem;
  width: 100%;
  color: #c5ccd3;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: .4rem;
  font-size: .78rem;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: rgba(242, 239, 232, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 1rem;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.branch-select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .38rem .7rem;
  font-size: .85rem;
  font-weight: 500;
  max-width: 240px;
}

.branch-select:disabled {
  background: var(--paper-2);
  color: var(--steel);
}

.pill {
  font-size: .72rem;
  font-weight: 600;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  white-space: nowrap;
}

.content {
  padding: 1.3rem 1.4rem 3rem;
  flex: 1;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 21, .4);
  z-index: 35;
}

.overlay.show {
  display: block;
}

/* ── Building blocks ── */
.grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span2 {
  grid-column: span 2;
}

.stack>*+* {
  margin-top: 1rem;
}

.row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.card-h {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.card-h h3 {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 700;
}

.card-b {
  padding: 1rem;
}

.scroll {
  overflow-x: auto;
}

.stat {
  padding: 1rem 1.05rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
  font-weight: 600;
}

.stat-value {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  margin-top: .2rem;
  letter-spacing: -.02em;
}

.stat-meta {
  font-size: .78rem;
  color: var(--steel);
  margin-top: .3rem;
}

.up {
  color: var(--ok);
}

.down {
  color: var(--rust);
}

.muted {
  color: var(--steel);
}

.small {
  font-size: .8rem;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.strong {
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .1s, background .15s, opacity .15s;
}

.btn:active {
  transform: scale(.98);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--ink-2);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--paper-2);
}

.btn-danger {
  background: var(--rust);
  color: #fff;
}

.btn-sm {
  padding: .28rem .6rem;
  font-size: .77rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--teal);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link {
  color: var(--teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 600;
  padding: .16rem .48rem;
  border-radius: 6px;
  white-space: nowrap;
  background: #eef1f4;
  color: var(--steel);
}

.b-teal {
  background: var(--teal-soft);
  color: #115e59;
}

.b-amber {
  background: var(--amber-soft);
  color: #92400e;
}

.b-rust {
  background: var(--rust-soft);
  color: #9f2a1f;
}

.b-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.b-ink {
  background: var(--ink);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

th {
  text-align: left;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--steel);
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  background: #faf9f6;
  white-space: nowrap;
}

td {
  padding: .58rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #faf9f6;
}

tr.click {
  cursor: pointer;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tfoot td {
  font-weight: 700;
  background: #faf9f6;
  border-top: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab {
  padding: .55rem .85rem;
  font-weight: 600;
  font-size: .85rem;
  color: var(--steel);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}

/* People module — category side navigation */
.people-module {
  max-width: 1200px;
}

.people-module-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.people-module-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: var(--ink);
}

.people-module-desc {
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
  max-width: 52rem;
}

.people-layout {
  display: grid;
  grid-template-columns: minmax(210px, 252px) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.people-sidenav {
  position: sticky;
  top: .5rem;
  padding: .65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(26, 32, 44, .04);
}

.people-nav-group {
  margin-bottom: .85rem;
}

.people-nav-group:last-child {
  margin-bottom: 0;
}

.people-nav-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
  padding: .25rem .55rem .45rem;
}

.people-nav-btn {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  width: 100%;
  text-align: left;
  padding: .55rem .6rem;
  margin-bottom: .2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--steel);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.people-nav-btn:hover {
  background: #f6f5f2;
  color: var(--ink);
}

.people-nav-btn.active {
  background: linear-gradient(135deg, #f0faf8 0%, #fff 100%);
  border-color: rgba(13, 148, 136, .35);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--teal);
}

.people-nav-ico {
  flex-shrink: 0;
  width: 1.35rem;
  text-align: center;
  font-size: .82rem;
  line-height: 1.35;
  opacity: .85;
}

.people-nav-btn.active .people-nav-ico {
  opacity: 1;
}

.people-nav-text {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}

.people-nav-title {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.3;
}

.people-nav-hint {
  font-size: .72rem;
  font-weight: 500;
  color: var(--steel);
  line-height: 1.35;
}

.people-nav-btn.active .people-nav-hint {
  color: #5a6578;
}

.people-main {
  min-width: 0;
}

.people-main-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: .85rem;
}

.people-page-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.people-page-hint {
  margin: .25rem 0 0;
}

.people-main-toolbar {
  margin-bottom: .85rem;
}

.people-main-body .toolbar {
  margin-bottom: .85rem;
}

.people-dept-block {
  margin-bottom: 1.1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
}

.people-dept-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.people-dept-head {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .45rem;
}

/* Organisation structure chart */
.org-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.org-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.org-legend {
  margin: .25rem 0 0;
  line-height: 1.5;
}

.org-company-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem 0 .25rem;
}

.org-branches {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.org-branches--network .org-branch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.org-branch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .85rem;
}

.org-branch-kind {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--teal);
  margin-bottom: .2rem;
}

.org-branch-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.01em;
}

.org-branch-sub {
  margin: .2rem 0 0;
}

.org-branch-mgr {
  min-width: min(100%, 220px);
}

.org-branch-mgr-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.org-rail-down {
  width: 2px;
  height: 1.25rem;
  margin: 0 auto;
  background: linear-gradient(var(--line), var(--teal));
  border-radius: 1px;
}

.org-rail-down--tall {
  height: 1.5rem;
}

.org-branch-rail {
  width: min(92%, 720px);
  height: 2px;
  margin: 0 auto .35rem;
  background: var(--line);
  border-radius: 1px;
}

.org-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
  align-items: start;
}

.org-dept-col {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .55rem .75rem;
  min-height: 4rem;
}

.org-dept-col.org-dept--mgmt { border-top: 3px solid #7c3aed; }
.org-dept-col.org-dept--floor { border-top: 3px solid var(--teal); }
.org-dept-col.org-dept--kitchen { border-top: 3px solid #ea580c; }
.org-dept-col.org-dept--store { border-top: 3px solid #2563eb; }
.org-dept-col.org-dept--office { border-top: 3px solid #64748b; }
.org-dept-col.org-dept--other { border-top: 3px solid var(--line); }

.org-dept-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  margin-bottom: .55rem;
  padding: 0 .15rem;
}

.org-dept-pill {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
}

.org-dept-count {
  font-size: .75rem;
  color: var(--muted);
}

.org-dept-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
}

.org-dept-lead-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-dept-connector {
  width: 2px;
  height: .65rem;
  background: var(--line);
  margin: .15rem auto;
}

.org-dept-empty {
  text-align: center;
  padding: .5rem;
}

.org-node {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: left;
  padding: .5rem .55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  position: relative;
}

.org-node:hover {
  border-color: rgba(13, 148, 136, .45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.org-node:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.org-node:active {
  transform: scale(.98);
}

.org-node--static {
  cursor: default;
}

.org-node--static:active {
  transform: none;
}

.org-node--lead {
  border-color: rgba(13, 148, 136, .35);
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 70%);
}

.org-node--compact {
  padding: .4rem .5rem;
}

.org-node--compact .org-node-avatar {
  width: 28px;
  height: 28px;
  font-size: .65rem;
}

.org-node--company {
  max-width: 280px;
  cursor: default;
  border-color: rgba(13, 148, 136, .5);
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 60%);
}

.org-node--company:active {
  transform: none;
}

.org-node-avatar--company {
  background: linear-gradient(135deg, #0f766e, #115e59);
}

.org-node-body {
  flex: 1;
  min-width: 0;
}

.org-node-name {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.org-node-title {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: .1rem;
}

.org-node-code {
  display: inline-block;
  font-size: .65rem;
  color: var(--muted);
  margin-top: .15rem;
}

.org-node-badge {
  position: absolute;
  top: -.45rem;
  right: .45rem;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .12rem .38rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
}

.org-tree {
  list-style: none;
  margin: 0;
  padding: 0 0 0 .65rem;
  border-left: 2px solid var(--line);
}

.org-tree .org-tree {
  margin-top: .35rem;
}

.org-tree-item {
  margin: 0 0 .4rem;
  padding-left: .35rem;
  position: relative;
}

.org-tree-item::before {
  content: '';
  position: absolute;
  left: -.65rem;
  top: 1.1rem;
  width: .55rem;
  height: 2px;
  background: var(--line);
}

@media (max-width: 768px) {
  .org-summary {
    grid-template-columns: 1fr;
  }

  .org-dept-grid {
    grid-template-columns: 1fr;
  }

  .org-branch-head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .org-node {
    transition: none;
  }

  .org-node:active {
    transform: none;
  }
}

@media (max-width: 900px) {
  .people-layout {
    grid-template-columns: 1fr;
  }

  .people-sidenav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem;
  }

  .people-nav-group {
    display: contents;
  }

  .people-nav-label {
    width: 100%;
    padding: .35rem .25rem .15rem;
  }

  .people-nav-btn {
    width: auto;
    flex: 1 1 auto;
    min-width: calc(50% - .35rem);
    box-shadow: none;
  }

  .people-nav-btn.active {
    box-shadow: inset 0 -2px 0 var(--teal);
  }

  .people-nav-hint {
    display: none;
  }
}

.chips {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.chip {
  padding: .32rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  color: var(--steel);
}

.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.empty {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--steel);
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: .3rem;
}

.loading {
  padding: 2rem;
  text-align: center;
  color: var(--steel);
}

.note {
  background: var(--amber-soft);
  color: #78350f;
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .82rem;
}

.note.info {
  background: var(--teal-soft);
  color: #134e4a;
}

.note.bad {
  background: var(--rust-soft);
  color: #7f1d1d;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .8rem;
  min-width: 0;
}

.field label {
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field .hint {
  font-weight: 400;
  color: var(--steel);
}

.field input,
.field select,
.field textarea,
.inp {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .5rem .65rem;
  background: #fff;
  font-size: .88rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inp:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field.check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}

.field.check input {
  width: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 .9rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.inp-sm {
  padding: .3rem .45rem;
  font-size: .82rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 100%;
  background: #fff;
}

.lines-t td {
  padding: .35rem .4rem;
}

.lines-t th {
  padding: .4rem;
}

.rm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--rust);
  font-size: 1.1rem;
}

.rm:hover {
  background: var(--rust-soft);
}

/* Modal */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 21, .45);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 1rem;
  overflow-y: auto;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: min(560px, 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
  animation: pop .18s ease;
}

.modal.wide {
  width: min(860px, 100%);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-h {
  padding: 1rem 1.2rem .8rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.modal-h h2 {
  font-family: var(--display);
  font-size: 1.1rem;
}

.modal-h p {
  font-size: .82rem;
  color: var(--steel);
  margin-top: .2rem;
}

.modal-x {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.3rem;
  color: var(--steel);
  flex-shrink: 0;
}

.modal-x:hover {
  background: var(--paper-2);
}

.modal-b {
  padding: 1rem 1.2rem;
  max-height: 68vh;
  overflow-y: auto;
}

.modal-err {
  margin: 0 1.2rem;
}

.modal-f {
  padding: .8rem 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  background: #faf9f6;
  border-radius: 0 0 14px 14px;
  flex-wrap: wrap;
}

.modal-f .spacer {
  flex: 1;
}

.pin-back {
  z-index: 80;
  align-items: center;
}

.pin-modal {
  width: min(360px, 100%);
}

.pin-input {
  font-size: 1.6rem !important;
  letter-spacing: .6em;
  text-align: center;
  font-family: var(--display);
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  font-size: .85rem;
}

.kv dt {
  color: var(--steel);
}

/* Toasts */
.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 90;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: .7rem 1rem;
  border-radius: 10px;
  font-size: .85rem;
  box-shadow: var(--shadow);
  max-width: 380px;
  animation: pop .2s ease;
  border-left: 4px solid var(--teal);
}

.toast.err {
  border-left-color: var(--rust);
}

/* Charts & chain */
.bars {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  height: 150px;
  padding-top: .5rem;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.bar i {
  display: block;
  width: 100%;
  background: var(--teal);
  border-radius: 5px 5px 0 0;
  min-height: 2px;
}

.bar.today i {
  background: var(--ink);
}

.bar span {
  font-size: .68rem;
  color: var(--steel);
  white-space: nowrap;
}

.bar b {
  font-size: .68rem;
  font-weight: 600;
}

.chain {
  display: flex;
  overflow-x: auto;
}

.chain-node {
  flex: 1;
  min-width: 104px;
  text-align: center;
  padding: .8rem .4rem;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
}

.chain-node:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.chain-node:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.chain-node+.chain-node {
  border-left: none;
}

.chain-node::after {
  content: "→";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: .75rem;
  color: var(--teal);
  background: var(--paper);
  width: 16px;
  text-align: center;
  font-weight: 700;
}

.chain-node:last-child::after {
  display: none;
}

.chain-node.transit {
  background: var(--amber-soft);
}

.chain-node.hold {
  background: var(--rust-soft);
}

.chain-label {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--steel);
  font-weight: 600;
}

.chain-val {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: .15rem;
}

.meter {
  height: 7px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: .3rem;
}

.meter i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.meter i.warn {
  background: var(--amber);
}

.meter i.bad {
  background: var(--rust);
}

.alert-list {
  list-style: none;
}

.alert-list li {
  display: flex;
  gap: .7rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}

.alert-list li:last-child {
  border-bottom: none;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .4rem;
  flex-shrink: 0;
  background: var(--teal);
}

.dot.high {
  background: var(--rust);
}

.dot.mid {
  background: var(--amber);
}

.dot.low {
  background: var(--steel);
}

.dot.ok {
  background: var(--ok);
}

/* POS */
.pos {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem;
  margin-top: .8rem;
}

.menu-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-item:hover:not(:disabled) {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.menu-item:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: var(--paper-2);
}

.menu-item.has-img {
  padding: 0;
  overflow: hidden;
}

.menu-item.has-img>div,
.menu-item.has-img>h4 {
  padding: 0 .8rem;
}

.menu-item.has-img>h4 {
  padding-top: .6rem;
}

.menu-item.has-img>div {
  padding-bottom: .7rem;
}

.menu-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}

.menu-item:disabled .menu-img {
  filter: grayscale(1);
}

.menu-item h4 {
  font-size: .88rem;
  font-weight: 600;
}

.menu-item .price {
  font-family: var(--display);
  font-weight: 700;
  color: var(--teal);
  margin-top: .3rem;
}

.menu-item .why {
  font-size: .7rem;
  color: var(--rust);
}

.ticket {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 72px;
}

.ticket-h {
  padding: .85rem 1rem;
  border-bottom: 1px dashed var(--line);
  background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #faf9f6 8px, #faf9f6 16px);
}

.ticket-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
}

.ticket-lines {
  max-height: 42vh;
  overflow-y: auto;
  padding: .3rem 0;
}

.tline {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  font-size: .87rem;
}

.tline .nm {
  flex: 1;
  min-width: 0;
}

.tline .nm small {
  display: block;
  color: var(--steel);
  font-size: .72rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-weight: 700;
  line-height: 1;
}

.ticket-foot {
  border-top: 1px dashed var(--line);
  padding: .85rem 1rem;
  background: #faf9f6;
  border-radius: 0 0 var(--radius) var(--radius);
}

.sum-row {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  padding: .12rem 0;
  color: var(--steel);
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  margin: .4rem 0 .75rem;
}

.shift-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .9rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: .8rem;
  flex-wrap: wrap;
}

.bills-row {
  flex-basis: 100%;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  min-width: 0;
  padding-top: .6rem;
  border-top: 1px solid var(--line);
}

.bill-search {
  flex: 0 0 240px;
  padding: .45rem .6rem;
}

.bill-strip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 1px 2px 1px 1px;
}

.bill-tile {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: .9rem;
  min-width: 140px;
  padding: .35rem .6rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s;
}

.bill-tile[hidden] {
  display: none;
}

.bill-tile:hover {
  border-color: var(--teal);
}

.bill-tile.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.bill-no {
  font-weight: 700;
  font-size: .8rem;
}

.bill-amt {
  font-size: .8rem;
  text-align: right;
}

.bill-meta {
  grid-column: 1 / -1;
  max-width: 190px;
  font-size: .72rem;
  color: var(--steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bill-tile.active .bill-meta {
  color: var(--mist);
}

.bill-late {
  color: var(--amber);
  font-weight: 700;
}

.bill-tile.active .bill-late {
  color: #fcd34d;
}

/* KOT */
.kot-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  align-items: start;
}

.kot-col h4 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
  margin-bottom: .5rem;
  display: flex;
  justify-content: space-between;
}

.kot-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem;
  margin-bottom: .6rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--teal);
}

.kot-card.late {
  border-top-color: var(--rust);
}

.kot-card.ready {
  border-top-color: var(--ok);
}

.kot-card.served {
  opacity: .6;
}

.kot-meta {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--steel);
  margin-bottom: .4rem;
}

.kot-items {
  list-style: none;
  font-size: .88rem;
  line-height: 1.5;
}

.kot-note {
  font-size: .76rem;
  color: var(--amber);
  font-weight: 600;
}

.kot-age.warn,
.kot-verdict.warn {
  color: var(--amber);
  font-weight: 600;
}

.kot-age.over,
.kot-verdict.over {
  color: var(--rust);
  font-weight: 600;
}

.kot-age.ok,
.kot-verdict.ok {
  color: var(--ok);
}

.kot-steps {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .6rem;
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px dashed var(--line);
  font-size: .7rem;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.kot-verdict {
  margin-top: .45rem;
  font-size: .74rem;
}

/* Roster */
.roster td,
.roster th {
  text-align: center;
  font-size: .78rem;
  padding: .45rem .35rem;
}

.roster td:first-child,
.roster th:first-child {
  text-align: left;
}

.cell {
  display: block;
  width: 100%;
  border-radius: 6px;
  padding: .3rem .2rem;
  border: 1px dashed transparent;
}

.cell:hover {
  border-color: var(--teal);
}

.cell.off {
  color: var(--mist);
}

.cell.leave {
  background: var(--amber-soft);
  color: #92400e;
}

.cell small {
  display: block;
  font-size: .66rem;
}

th.today,
td.today {
  background: #f0fdfa !important;
}

@media (max-width: 1100px) {
  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kot-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos {
    grid-template-columns: 1fr;
  }

  .ticket {
    position: static;
  }
}

@media (max-width: 820px) {
  .bills-row {
    flex-wrap: wrap;
  }

  .bill-search {
    flex-basis: 100%;
  }

  .login {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: none;
  }

  .main {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .g2,
  .g3,
  .g4,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span2 {
    grid-column: auto;
  }

  .content {
    padding: 1rem;
  }

  .pill {
    display: none;
  }
}

/* Lot labels + scanning */
.scan-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem;
  background: #fff;
}

.scan-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 2px solid var(--teal);
  border-radius: 8px;
  padding: .15rem .6rem;
  background: #fff;
}

.scan-row:focus-within {
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.scan-ico {
  color: var(--teal);
  font-size: 1.2rem;
}

.scan-input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: .5rem 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1rem;
  letter-spacing: .05em;
  background: transparent;
}

.scan-box .scan-t {
  margin-top: .6rem;
}

.scan-box .scan-empty {
  padding: .5rem 0 0;
}

.scan-box tr.pending td {
  color: var(--steel);
}

.scan-box tr.scanned td,
.lines-t tr.scanned td {
  background: var(--ok-soft);
}

.scan-box .check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
}

.scan-manual-btn {
  margin-top: .5rem;
}

.scan-expect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .4rem;
  margin-top: .6rem;
}

.scan-expect-item {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .55rem;
  border-radius: 6px;
  background: var(--paper);
  font-size: .82rem;
}

.scan-expect-item.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.scan-expect-item.over {
  background: var(--rust-soft);
  color: var(--rust);
}

.label-previews {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  max-height: 52vh;
  overflow: auto;
}

.label-preview {
  background: #fff;
  color: #000;
  border: 1px dashed var(--mist);
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
}

.label-preview .lbl6 {
  zoom: .8;
}
.lot-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.export-bar {
  gap: .35rem;
}
.table-floor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: .5rem;
  padding: .8rem;
}

.tbl {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: .6rem .4rem;
  text-align: center;
  cursor: pointer;
  font: inherit;
}

.tbl b {
  display: block;
  font-size: 1.1rem;
}

.tbl small {
  display: block;
  color: var(--steel);
  text-transform: capitalize;
}

.tbl.available {
  background: var(--ok-soft);
}

.tbl.reserved {
  background: var(--amber-soft);
}

.tbl.occupied {
  background: var(--teal-soft);
}

.tbl.cleaning {
  background: var(--paper-2);
}

.tbl.blocked {
  background: var(--rust-soft);
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}