:root {
  --ink: #5c2e2c;
  --ink-2: #6b3834;
  --muted: #a86a64;
  --line: #f3d0b0;
  --paper: #fff9f2;
  --card: #fffdf9;
  --gold: #FA948F;
  --gold-2: #FACA8F;
  --lime: #F5FA8F;
  --rose: #FA948F;
  --cream: #fff9f2;
  --sidebar: #b33a36;
  --sidebar-2: #9a3f28;
  --ok: #16a34a;
  --info: #2563eb;
  --warn: #d97706;
  --vio: #7c3aed;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(200,100,90,.10);
  --r: 18px;
  --navw: 286px;
  --top: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Kanit", "Leelawadee UI", "Tahoma", "Segoe UI", sans-serif;
  --display: "Kanit", "Leelawadee UI", "Tahoma", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
html, body { margin: 0; padding: 0; }
body.app {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: .01em;
  background: var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

.ico { width: 22px; height: 22px; flex: 0 0 auto; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; background: #fffdf9; border-radius: 14px; padding: 4px; }

/* Layout */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  width: var(--navw);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #fff9f2;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 60;
  transition: transform .25s ease;
}
.sidebar-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-head b {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.15;
}
.sidebar-head small { color: #f8c8c0; font-size: 12px; }
.sidebar-head .brand-mark { width: 40px; height: 40px; }
.nav {
  padding: 6px 10px 8px;
  overflow: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 226, 210, .4) transparent;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 226, 210, .38);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 226, 210, .58);
  background-clip: padding-box;
}
.nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.nav::-webkit-scrollbar-corner { background: transparent; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 10px;
  color: #ffe8e0; margin-bottom: 1px; font-size: 14.5px; font-weight: 500;
}
.nav .ico { width: 18px; height: 18px; }
.nav a:hover { background: rgba(255,255,255,.14); color: #fff9f2; }
.nav a.active { background: linear-gradient(90deg, #F5FA8F, #FACA8F); color: #5c2e2c; }
.nav .sec {
  color: #f8d0c4; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 10px 10px 3px;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.nav .sec:first-child { border-top: 0; margin-top: 0; padding-top: 6px; }
.sidebar-foot { padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.12); }
.user-mini { display: flex; gap: 12px; align-items: center; }
a.user-mini { color: inherit; }
a.user-mini:hover { background: rgba(255,255,255,.12); border-radius: 14px; margin: -8px; padding: 8px; }
.user-mini > div:last-child { font-size: 16px; font-weight: 600; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--lime); color: var(--ink); display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
}
.user-mini small { color: #f8c8c0; font-size: 13px; font-weight: 400; }

.main { margin-left: var(--navw); flex: 1; min-width: 0; }
.topbar {
  height: var(--top); position: sticky; top: 0; z-index: 20;
  background: rgba(255,249,242,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; gap: 12px;
}
.topbar h1 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0;
  line-height: 1.2;
  min-width: 0;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topbar > div:first-child { min-width: 0; flex: 1; }
.top-profile { max-width: 100%; }
.icon-btn {
  width: 44px; height: 44px; border: 1px solid var(--line); background: #fffdf9;
  border-radius: 14px; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.burger { display: none; }
.content { padding: 26px; padding-bottom: 108px; }

/* Cards / KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border-radius: var(--r); padding: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.kpi .lbl { color: var(--muted); font-size: 15px; font-weight: 500; }
.kpi .val {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.kpi .sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.kpi.gold { background: linear-gradient(160deg, #FA948F, #FACA8F); color: var(--ink); }
.kpi.gold .lbl, .kpi.gold .sub { color: #7a4540; }

.panel {
  background: var(--card); border-radius: var(--r); border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-h h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .02em;
}
.panel-b { padding: 20px 22px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.mt { margin-top: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 600; cursor: pointer;
  font-size: 16px; white-space: nowrap;
}
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: #e06b66; color: #fff9f2; }
.btn-gold { background: linear-gradient(90deg, #FA948F, #FACA8F); color: var(--ink); }
.btn-ghost { background: #fffdf9; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-ok { background: #ecfdf3; color: #166534; }
.btn-sm { padding: 8px 13px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: color-mix(in srgb, var(--b, #888) 14%, white); color: var(--b, #444);
}
.prio-urgent { --b: #dc2626; }
.prio-normal { --b: #2563eb; }

/* Room grid */
.room-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px;
}
.rl-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--muted); }
.rl-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; }

.floor-section { margin-bottom: 24px; }
.floor-section:last-child { margin-bottom: 0; }
.floor-label {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  color: var(--gold); letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.floor-label small { font-weight: 400; color: var(--muted); font-size: 13px; text-transform: none; letter-spacing: 0; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.rc {
  border-radius: 18px; padding: 20px 18px 16px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 140px; position: relative;
  border: 1.5px solid rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s;
}
.rc:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(60,40,30,.10); }
.rc-num {
  font-family: var(--display); font-weight: 700; font-size: 42px;
  line-height: 1; letter-spacing: -.01em;
}
.rc-type {
  font-size: 12px; font-weight: 500; opacity: .72; margin-top: 4px; line-height: 1.3; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 6px; }
.rc-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(2px);
}
.rc-status .ico { width: 14px; height: 14px; }
.rc-guest {
  font-size: 12px; font-weight: 600; opacity: .8;
  max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.st-available { background: #e8faf0; color: #15613a; }
.rc.is-held { background: #fff1e6; color: #9a3412; }
.st-occupied { background: #e6f0ff; color: #1d3d8a; }
.st-cleaning { background: #fff7e0; color: #854a06; }
.st-inspected { background: #f0edff; color: #5420b6; }
.st-out_of_order { background: #ffeded; color: #991b1b; }

.floor-ico {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(160deg, #FA948F, #FACA8F); color: #5c2e2c;
  display: grid; place-items: center; box-shadow: 0 8px 18px rgba(250,148,143,.28);
}
.floor-ico .ico { width: 22px; height: 22px; }
.with-ico { display: inline-flex; align-items: center; gap: 10px; }
.with-ico .ico { width: 22px; height: 22px; color: var(--gold); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.legend-chip .ico { width: 16px; height: 16px; }
.legend-chip.st-available { background: #e8faf0; color: #15613a; }
.legend-chip.st-occupied { background: #e6f0ff; color: #1d3d8a; }
.legend-chip.st-cleaning { background: #fff7e0; color: #854a06; }
.legend-chip.st-inspected { background: #f0edff; color: #5420b6; }
.legend-chip.st-out_of_order { background: #ffeded; color: #991b1b; }

/* Tape chart */
.tape-wrap { overflow: auto; }
.tape-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.tape-legend span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tape { border-collapse: separate; border-spacing: 4px; min-width: 900px; }
.tape th, .tape td { font-size: 14px; }
.tape th { color: var(--muted); font-weight: 500; padding: 8px; position: sticky; top: 0; background: #fffdf9; }
.tape td.rn { font-weight: 700; width: 80px; position: sticky; left: 0; background: #fffdf9; font-size: 16px; }
.cell {
  height: 32px; border-radius: 10px; min-width: 72px; text-align: center; line-height: 32px;
  background: #fde8c8; color: transparent; cursor: pointer;
}
.cell.has { color: #fff; font-weight: 600; }
.cell.occ { background: #2563eb; }
.cell.rsv { background: var(--gold); }
.cell.out { background: #dc2626; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; }

/* Tables */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 16px; }
table.data th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); letter-spacing: .04em; }
table.data td { padding: 14px; border-bottom: 1px solid #f5e0c8; vertical-align: middle; }
table.data tr:hover td { background: #fff6ee; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.day-rate-head { font-size: 15px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.day-rates { display: grid; gap: 8px; }
.day-rate {
  display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; align-items: center;
  background: #fffaf5; border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px;
}
.day-rate span { font-size: 15px; font-weight: 600; color: var(--ink); }
.day-rate input { width: 100%; }
.cm-total-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cm-total-row .btn { height: 48px; }
.bk-form { display: grid; gap: 14px; }
.bk-sec {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fffdf9;
}
.bk-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.bk-step {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: linear-gradient(160deg, #FA948F, #FACA8F); color: var(--ink);
}
.bk-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.bk-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stay-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.stay-hint.is-ready { color: var(--ink); }
.stay-cal {
  border: 1px solid var(--line); border-radius: 16px; background: #fffaf5; padding: 12px;
}
.stay-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stay-cal-head b { font-size: 16px; font-weight: 700; }
.stay-cal-nav {
  width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line);
  background: #fffdf9; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.stay-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.stay-cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.stay-cal-day {
  height: 42px; border: 0; border-radius: 12px; background: transparent; color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.stay-cal-day.is-muted { color: #e0b8b0; }
.stay-cal-day.is-today { box-shadow: inset 0 0 0 1.5px #e7b2a4; }
.stay-cal-day:hover { background: #fff1ec; }
.stay-cal-day.is-range, .stay-cal-day.is-range:hover { background: #ffe4d6; border-radius: 8px; }
.stay-cal-day.is-start, .stay-cal-day.is-start:hover,
.stay-cal-day.is-end, .stay-cal-day.is-end:hover {
  background: linear-gradient(160deg, #FA948F, #FACA8F); color: var(--ink);
}
.stay-cal.is-span .stay-cal-day.is-start { border-radius: 12px 8px 8px 12px; }
.stay-cal.is-span .stay-cal-day.is-end { border-radius: 8px 12px 12px 8px; }
.stay-cal-day.is-booked { text-decoration: line-through; }
.bk-sec > .f + .bk-grid,
.bk-sec > p + .bk-grid,
.bk-sec > input[type="hidden"] + .bk-grid { margin-top: 12px; }
.bk-note { font-size: 12px; color: var(--muted); font-weight: 500; }
.bk-sum {
  margin-top: 10px; padding: 12px 14px; border-radius: 14px;
  background: #fff3e4; color: var(--ink); font-weight: 700;
}
.bk-more { padding: 0; }
.bk-more summary {
  list-style: none; cursor: pointer; padding: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 700; color: var(--ink);
}
.bk-more summary::-webkit-details-marker { display: none; }
.bk-more summary::after { content: "เปิด"; color: var(--muted); font-weight: 600; font-size: 13px; }
.bk-more[open] summary::after { content: "ปิด"; }
.bk-more .bk-body { padding: 0 16px 16px; display: grid; gap: 12px; }
.cm-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-board { overflow: auto; }
.cm-grid {
  display: grid;
  grid-template-columns: 148px repeat(14, minmax(58px, 1fr));
  min-width: 980px;
}
.cm-corner, .cm-day { position: sticky; top: 0; z-index: 4; background: #fffdf9; }
.cm-day, .cm-corner { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 2px; border-bottom: 1px solid var(--line); }
.cm-corner { display: flex; align-items: flex-end; justify-content: center; font-weight: 700; }
.cm-day b { display: block; font-size: 16px; color: var(--ink); line-height: 1.1; }
.cm-day small { display: block; font-size: 11px; letter-spacing: .02em; }
.cm-day.is-today { background: #fff3e4; }
.cm-day.is-today b { color: #9a3412; }
.cm-type {
  grid-column: 1 / -1;
  background: #f7f1ea;
  font-weight: 700;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}
.cm-hold {
  grid-column: 1 / -1;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-bottom: 1px solid #f3e6d8;
}
.cm-cell.is-held { background: #f6efe6; cursor: not-allowed; }
.grp-line {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 110px minmax(140px, 180px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.grp-side { display: flex; flex-direction: column; gap: 6px; min-height: 48px; justify-content: flex-end; }
.grp-left { font-size: 12px; font-weight: 700; color: var(--muted); }
.grp-assign {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fffdf9;
}
.grp-assign-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.grp-assign-h b { font-size: 16px; }
.grp-assign-h span { color: var(--muted); font-weight: 700; }
.grp-assign-h em { margin-left: auto; font-style: normal; font-weight: 700; }
.grp-rooms { display: grid; gap: 8px; margin-bottom: 10px; }
.grp-room {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid #f3e6d8; border-radius: 12px; padding: 8px 10px;
}
.grp-room b { min-width: 48px; }
.grp-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grp-pick select { max-width: 220px; }
.cm-room {
  position: sticky; left: 0; z-index: 3; background: #fffdf9;
  min-height: 48px; padding: 0 12px; font-weight: 700;
  border-bottom: 1px solid #f3e6d8;
  display: flex; flex-direction: column; justify-content: center;
}
.cm-room small { font-weight: 500; color: var(--muted); font-size: 12px; }
.cm-track {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(14, minmax(58px, 1fr));
  grid-template-rows: 48px;
  min-height: 48px;
  border-bottom: 1px solid #f3e6d8;
  align-items: stretch;
}
.cm-cell {
  grid-row: 1;
  border: 0; background: #fff;
  border-left: 1px solid #f3e6d8;
  min-height: 48px; height: 48px; cursor: pointer; padding: 0;
}
.cm-cell:hover { background: #fff6ee; }
.cm-cell.is-today { background: #fffaf3; }
.cm-cell.is-pick { background: #fde8c8; }
.cm-cell:disabled { cursor: default; background: #f4f4f4; }
.cm-track.is-closed .cm-cell { pointer-events: none; }
.cm-bar {
  grid-row: 1;
  z-index: 2;
  align-self: center;
  height: 30px;
  margin: 0 3px;
  border-radius: 8px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #6b3a12;
  background: #f6d7b8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  min-width: 0;
}
.cm-bar.is-in { background: #dbeafe; color: #1d3d8a; }
label.f, .f { display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--muted); font-weight: 500; }
label.f[hidden], .f[hidden] { display: none; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=month], input[type=datetime-local], input[type=file], select, textarea {
  border: 1px solid var(--line); background: #fffdf9; border-radius: 14px; padding: 12px 14px; color: var(--ink); font-size: 16px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 6px; background: #fde8c8; border-radius: 999px; padding: 8px 14px; font-size: 15px; color: var(--ink);
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Booking list */
.rsv-toolbar-wrap {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
}
.rsv-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}
.rsv-toolbar input[type=text],
.rsv-toolbar select {
  width: auto;
}
.rsv-toolbar .rsv-q {
  flex: 1 1 280px;
  min-width: 180px;
}
.rsv-toolbar .btn { flex: 0 0 auto; }
.rsv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.rsv-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf9;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.rsv-tab em {
  font-style: normal;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #fff1ec;
  color: var(--ink);
  font-size: 11px;
  display: grid;
  place-items: center;
}
.rsv-tab:hover { border-color: #e08a80; color: var(--ink); }
.rsv-tab.on {
  background: linear-gradient(90deg, #FA948F, #FACA8F);
  color: var(--ink);
  border-color: transparent;
}
.rsv-tab.on em { background: rgba(255,255,255,.55); }
.rsv-st-pending { --b: #d97706; }
.rsv-st-confirmed { --b: #16a34a; }
.rsv-st-checked_in { --b: #2563eb; }
.rsv-st-checked_out { --b: #78716c; }
.rsv-st-cancelled { --b: #dc2626; }
.rsv-st-no_show { --b: #7c3aed; }
.rsv-tab.rsv-st-pending:not(.on) { color: #b45309; }
.rsv-tab.rsv-st-confirmed:not(.on) { color: #15803d; }
.rsv-tab.rsv-st-checked_in:not(.on) { color: #1d4ed8; }
.rsv-tab.rsv-st-cancelled:not(.on) { color: #b91c1c; }
.rsv-wrap { overflow: auto; }
.rsv-head, .rsv-item {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1.3fr) minmax(200px, 1.4fr) 128px minmax(220px, .95fr);
  gap: 14px 18px;
  align-items: center;
  min-width: 960px;
}
.rsv-head {
  padding: 10px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
  position: sticky;
  top: 0;
  z-index: 1;
}
.rsv-item {
  padding: 16px 22px;
  border-bottom: 1px solid #f5e0c8;
  align-items: start;
}
.rsv-item:last-child { border-bottom: 0; }
.rsv-item:hover { background: #fff6ee; }
.rsv-item.is-done { opacity: .78; }
.rsv-room {
  background: #fff1ec;
  border-radius: 14px;
  padding: 10px 8px 8px;
  text-align: center;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.rsv-room .num {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.rsv-room .typ {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rsv-room .amt {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  margin-top: 6px;
}
.rsv-guest b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.rsv-guest .no {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .02em;
  margin-top: 3px;
}
.rsv-guest .ph { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.rsv-stay .dates { font-weight: 600; font-size: 15px; line-height: 1.35; }
.rsv-stay .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.rsv-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rsv-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1ec;
  color: var(--ink-2);
}
.rsv-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.rsv-status { padding-top: 4px; }
.rsv-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.rsv-ops, .rsv-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.rsv-ops form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.rsv-ops form .btn { width: 100%; }
.rsv-ops .btn, .rsv-docs .btn { flex: 1 1 auto; min-width: 0; }
.rsv-ops .btn-gold { flex: 1 1 100%; }
.rsv-head span:last-child { text-align: right; }

/* Room setup */
.setup-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.setup-stat {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; box-shadow: var(--shadow); min-width: 132px;
}
.setup-stat b {
  font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1;
}
.setup-stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}
.setup-head-actions { display: flex; align-items: center; gap: 8px; }
.setup-add {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
}
.setup-add h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.setup-add .form-grid { gap: 10px; }
.setup-list { padding: 14px; display: grid; gap: 12px; }
.setup-floor { padding: 8px 6px 6px; }
.setup-floor .floor-label { margin: 6px 10px 4px; }
.setup-floor .setup-list { padding: 8px 8px 12px; }
.setup-card {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.setup-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.setup-card-head .dk-ico { margin-bottom: 0; flex: 0 0 auto; }
.setup-card-title { flex: 1; min-width: 0; }
.setup-card-title b { display: block; font-size: 16px; }
.setup-card-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.setup-card-rate {
  font-family: var(--display); font-size: 18px; font-weight: 600;
  text-align: right; white-space: nowrap; line-height: 1.15;
}
.setup-card-rate small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.setup-room-no {
  font-family: var(--display); font-size: 28px; font-weight: 700;
  line-height: 1; letter-spacing: -.02em; min-width: 52px;
}
.setup-form {
  display: grid;
  grid-template-columns: 1fr 110px 72px;
  gap: 10px;
}
.setup-form-room { grid-template-columns: 90px 70px minmax(0, 1fr); }
.setup-form .full { grid-column: 1 / -1; }
.setup-form .f { font-size: 12px; gap: 5px; }
.setup-form input, .setup-form select {
  padding: 9px 11px; font-size: 14px; border-radius: 12px;
}
.setup-form-actions {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 6px; margin-top: 10px;
}
.setup-form-actions form { margin: 0; }

/* Users & permissions */
.usr-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.usr-tab {
  border: 1px solid var(--line); background: #fffdf9; color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font-weight: 650; cursor: pointer;
  font-family: inherit; font-size: 15px;
}
.usr-tab.is-on { background: linear-gradient(90deg, #FA948F, #FACA8F); border-color: transparent; }
.usr-page[hidden] { display: none !important; }
.usr-list-h { align-items: flex-start; }
.usr-mini-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.usr-mini-stats b { color: var(--ink); font-family: var(--display); font-size: 16px; font-weight: 650; margin-right: 3px; }
.usr-head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.usr-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.usr-pos-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.usr-pos-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.usr-pos-add .f { flex: 1; min-width: 180px; }
.usr-role-group { padding: 4px 6px 2px; }
.usr-role-group .floor-label { margin: 8px 12px 0; }
.usr-seq { list-style: none; margin: 0; padding: 4px 8px 8px; }
.usr-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 11px 10px;
  border-bottom: 1px solid #f5e0c8;
  border-radius: 12px;
}
.usr-row:last-child { border-bottom: 0; }
.usr-row.is-off { opacity: .58; }
.usr-row.is-self { background: #fff8f4; }
.usr-row:hover { background: #fff6ee; }
.usr-no {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  color: #c45d58; text-align: center; line-height: 1;
}
.usr-main { min-width: 0; }
.usr-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usr-name-line > b { font-size: 16px; line-height: 1.3; }
.usr-main small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.usr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.usr-manage-btn { padding: 5px 10px; font-size: 13px; border-radius: 999px; gap: 5px; }
.usr-manage-btn .ico { width: 14px; height: 14px; }
.usr-manage-pane[hidden] { display: none !important; }
.usr-manage-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.usr-manage-contact { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.usr-manage-form { margin-bottom: 4px; }
.usr-manage-static {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.usr-manage-static div {
  background: #fff6ee; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.usr-manage-static span { display: block; color: var(--muted); font-size: 12px; }
.usr-manage-static b { display: block; margin-top: 2px; font-size: 15px; }
.usr-manage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.usr-manage-foot {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  justify-content: space-between; margin-top: 4px; padding-top: 14px;
  border-top: 1px solid #f5e0c8;
}
.usr-manage-foot form { margin: 0; }
.usr-manage-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.perm-check.is-locked { opacity: .45; }
.usr-reset .f { font-size: 12px; gap: 5px; }
.usr-reset { flex: 1; min-width: 200px; }
.usr-reset-row { display: flex; gap: 6px; }
.usr-reset-row input {
  width: auto; flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px;
}
.usr-perms { margin-top: 0; }
.usr-perm-save { margin-top: 14px; display: flex; justify-content: flex-end; }
.perm-page-name { display: inline-flex; align-items: center; gap: 8px; }
.perm-page-name .ico { width: 16px; height: 16px; color: var(--gold); }
.perm-page-name b { font-size: 14px; }

/* Check-in / check-out */
.io-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.io-stack { display: grid; gap: 16px; align-content: start; }
.io-focus { margin-bottom: 16px; }
.io-focus-guest {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.io-focus-guest b { display: block; font-size: 18px; }
.io-focus-guest small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.io-focus-guest:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.io-focus-actions { display: flex; justify-content: flex-end; }
.io-list { padding: 12px; display: grid; gap: 10px; }
.io-group-label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--muted); padding: 4px 6px 0;
}
.io-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}
.io-card.is-today { background: #fffaf5; border-color: #f3d0b0; }
.io-card.is-late { background: #fff8f8; border-color: #fecaca; }
.io-card.is-on { border-color: #e06b66; background: #fff8f4; box-shadow: 0 8px 24px rgba(224,107,102,.14); }
.io-room {
  font-family: var(--display); font-size: 24px; font-weight: 700;
  line-height: 1; text-align: center; letter-spacing: -.02em;
  background: #fff1ec; border-radius: 12px; padding: 12px 6px;
}
.io-body b { display: block; font-size: 15px; }
.io-body small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.io-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 6px; font-size: 13px; color: var(--muted);
}
.io-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 228px; }
.io-actions .btn-primary { flex: 1 1 100%; }
.io-folio .stat-row { margin: 8px 0; }
.io-folio .io-due {
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px;
}
.io-folio .io-due b { font-size: 22px; }
.io-charge-form {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: end;
}
.io-charge-form input { min-width: 0; width: 100%; }
.io-charge-list { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.io-checkout-form { display: grid; gap: 12px; }
.io-check {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff6ee; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.io-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #e06b66; flex: 0 0 auto; }
.io-check b { display: block; font-size: 15px; }
.io-check small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.io-checkout-btn { width: 100%; padding: 14px; }

.thai-date { position: relative; width: 100%; z-index: 3; }
.thai-date input[type=date] {
  position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px;
  pointer-events: none; margin: 0; padding: 0; border: 0;
}
.thai-date-btn {
  width: 100%; text-align: left; border: 1px solid var(--line); background: #fffdf9;
  border-radius: 14px; padding: 12px 14px; color: var(--ink); font-size: 16px; cursor: pointer;
  font-family: inherit; position: relative; z-index: 1;
}
.thai-date-btn:focus { outline: 2px solid #FA948F; outline-offset: 1px; }
.thai-date-pop {
  position: fixed; z-index: 90;
  width: min(320px, 92vw); background: #fffdf9; border: 1px solid var(--line);
  border-radius: 18px; padding: 12px; box-shadow: 0 18px 40px rgba(140,50,40,.14);
}
.td-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.td-nav select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 6px; font-size: 14px; color: var(--ink);
}
.td-nav select[data-year] { flex: 1.15; }
.td-nav button {
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: #fff1ec;
  color: var(--ink); cursor: pointer; font-size: 18px;
}
.td-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.td-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.td-week span:first-child { color: #c45d58; }
.td-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.td-days button {
  height: 36px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); cursor: pointer; font-size: 14px; font-family: inherit;
}
.td-days button:hover { background: #fff1ec; }
.td-days button.mute { color: #d4b4a8; }
.td-days button.today { box-shadow: inset 0 0 0 1.5px #FA948F; }
.td-days button.sel { background: linear-gradient(90deg, #FA948F, #FACA8F); font-weight: 700; }
.td-days button.sun, .td-days button.off { color: #8a3d36; background: #f3d0c4; }
.td-days button.off.sel, .td-days button.sun.sel { color: var(--ink); background: linear-gradient(90deg, #FA948F, #FACA8F); }
.td-days button:disabled { opacity: .35; cursor: default; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(16,14,12,.45); display: none; place-items: center; z-index: 60; padding: 16px; }
.modal-bg.show { display: grid; }
.modal {
  background: #fffdf9; width: min(560px, 100%); border-radius: 22px; padding: 26px;
  max-height: 90dvh; overflow: auto;
}
.modal h3 { margin: 0 0 10px; font-family: var(--display); font-size: 28px; font-weight: 600; }
.toast {
  position: fixed; right: 16px; top: 16px; z-index: 80; background: var(--ink); color: #fff;
  padding: 14px 18px; border-radius: 14px; display: none; box-shadow: var(--shadow);
  font-size: 16px;
}
.toast.show { display: block; }
.flash-dialog, .ask-dialog { z-index: 90; }
.flash-dialog.show, .ask-dialog.show {
  background: rgba(72, 28, 26, .46);
  backdrop-filter: blur(5px);
}
.flash-dialog .modal, .ask-dialog .modal {
  width: min(420px, 100%);
  text-align: center;
  padding: 28px 24px 22px;
  border-radius: 28px;
  border: 1px solid #f6dcc8;
  box-shadow: 0 28px 70px rgba(92, 46, 44, .28);
  animation: ask-pop .22s ease;
}
.flash-dialog .modal h3, .ask-dialog .modal h3 { margin: 0 0 6px; font-size: 26px; }
.flash-dialog .modal p, .ask-dialog .modal p {
  margin: 0 0 20px;
  line-height: 1.6;
  color: var(--ink-2);
  font-size: 16px;
}
.ask-dialog .modal p[hidden] { display: none; }
.ask-mark {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 22px;
  display: grid; place-items: center;
  background: #fff1ec; color: #b33a36;
  box-shadow: inset 0 0 0 1px rgba(250, 148, 143, .4);
}
.ask-mark svg, .ask-mark .ico { width: 32px; height: 32px; }
.ask-mark.danger { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.ask-mark.ok { background: #ecfdf3; color: #15803d; box-shadow: inset 0 0 0 1px #bbf7d0; }
.ask-mark.info { background: #eff6ff; color: #1d4ed8; box-shadow: inset 0 0 0 1px #bfdbfe; }
.ask-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ask-actions .btn, .flash-dialog .modal > .btn { min-width: 128px; }
.ask-solid { background: #dc2626; color: #fff; }
@keyframes ask-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-dialog .modal, .ask-dialog .modal { animation: none; }
}

.empty-state { text-align: center; padding: 52px 16px; color: var(--muted); font-size: 16px; }
.empty-state h2, .empty-state h3 { font-family: var(--display); color: var(--ink); font-size: 28px; font-weight: 600; }
.empty-ico { width: 60px; height: 60px; border-radius: 16px; background: #fde8c8; color: var(--ink); display: grid; place-items: center; margin: 0 auto 12px; font-size: 26px; }
.empty-ico .ico { width: 28px; height: 28px; }

/* HK mobile */
.job-list { display: grid; gap: 14px; }
.job-card {
  background: var(--card); border-radius: 22px; padding: 20px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.job-card .room { font-family: var(--display); font-size: 42px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.job-card .task-title { font-size: 22px; font-weight: 650; line-height: 1.35; }
.hk-block + .hk-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.hk-block h3 { margin: 0 0 8px; font-size: 15px; }
.hk-assign { display: grid; gap: 10px; align-items: end; }
.hk-assign-room { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; }
.hk-assign-other { grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, 1fr) auto auto; }
.hk-assign .btn { min-height: 48px; }
.hk-task-note { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hk-alert {
  margin-top: 8px;
  background: #fff1ec;
  border: 1px solid #FA948F;
  color: #8b4540;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.actions-col { display: grid; gap: 8px; margin-top: 14px; }
.actions-col .btn { width: 100%; padding: 15px; font-size: 17px; border-radius: 14px; }

.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; margin-top: 8px; display: none; }

.progress-ring { width: 84px; height: 84px; }
.stat-row { display: flex; justify-content: space-between; font-size: 15px; margin: 10px 0; }
.bar { height: 8px; background: #f3d0b0; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); }

.alert-due { background: #fff1ec; border: 1px solid #FA948F; color: #8b4540; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; font-size: 16px; }

.mobile-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fffdf9; border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + var(--safe-b));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  transition: opacity .2s ease, transform .2s ease;
}
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--muted); padding: 6px 2px; font-weight: 500;
  min-width: 0;
}
.mobile-nav a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
  text-align: center;
}
.mobile-nav a.active { color: var(--gold); }
.mobile-nav .ico { width: 22px; height: 22px; }
body.app:has(.sidebar.open) .mobile-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(110%);
}

.flash { border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; font-size: 16px; }
.flash-ok { background: #ecfdf3; color: #166534; }
.flash-err { background: #fef2f2; color: #991b1b; }

.push-slot { position: relative; }
.push-slot[hidden] { display: none !important; }
.push-slot .icon-btn { position: relative; }
.push-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #e06b66; box-shadow: 0 0 0 2px #fffdf9;
}
.push-dot[hidden] { display: none !important; }
.push-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  width: min(280px, calc(100vw - 24px));
  background: #fffdf9; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px 14px 12px;
}
.push-pop[hidden] { display: none !important; }
.push-pop b { display: block; font-size: 15px; line-height: 1.35; }
.push-pop > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.push-actions:empty { display: none; }
@media (max-width: 860px) {
  .push-pop {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top, 0px));
    right: 12px;
  }
}

.login-page {
  min-height: 100dvh; display: grid; place-items: center;
  background: radial-gradient(900px 500px at 50% -20%, #fffdf9, #F5FA8F 42%, #FACA8F 72%, #FA948F 100%);
  padding: 24px;
  font-family: var(--font);
  font-size: 17px;
  color: var(--ink);
}
.login-card {
  width: min(440px, 100%); background: #fffdf9; border-radius: 28px; padding: 40px 32px;
  box-shadow: 0 30px 80px rgba(200,100,90,.14); text-align: center;
}
.login-card img { width: 168px; }
.login-card h1 { font-family: var(--display); font-size: 38px; font-weight: 600; margin: 10px 0 6px; letter-spacing: .03em; }
.login-card p { color: var(--muted); margin: 0 0 24px; font-size: 16px; }
.login-card form { text-align: left; display: grid; gap: 14px; }
.login-card .btn { width: 100%; margin-top: 6px; padding: 15px; border-radius: 14px; font-size: 17px; }
.hint { margin-top: 18px; font-size: 14px; color: #a86a64; }

.print-toolbar {
  max-width: 210mm; margin: 0 auto 10px;
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.print-hint {
  max-width: 210mm; margin: 0 auto 14px; text-align: right;
  color: var(--muted); font-size: 13px;
}
.print-sheet {
  width: min(210mm, 100%);
  margin: 0 auto 28px;
  background: #fff;
  padding: 16mm 16mm 14mm;
  border: 1px solid #e4cbb8;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(90,40,30,.10);
  color: #2b1a18;
}
.print-sheet .logo { width: 92px; }
.doc-sheet { box-sizing: border-box; }
.doc-accent {
  height: 5px;
  margin: 0 0 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7a2e2a 0%, #c45c56 48%, #e8b56a 100%);
}
.doc-sec-title { font-size: 16px; font-weight: 700; margin: 8px 0 10px; }
.doc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.doc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
a.doc-card:hover { border-color: #e08a80; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(200,100,90,.14); }
a.doc-card.is-on { border-color: #e06b66; background: #fff8f4; box-shadow: 0 8px 24px rgba(224,107,102,.18); }
.doc-card.is-off { opacity: .55; cursor: not-allowed; }
.doc-card.is-off .doc-go { color: var(--muted); }
.doc-card h3 { margin: 8px 0 6px; font-size: 16px; }
.doc-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.doc-card .doc-go { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: #c45c56; }
.doc-picked {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff8f4; border: 1px solid #e8c4b0; border-radius: 18px;
  padding: 14px 18px; margin-bottom: 16px;
}
.doc-picked b { font-size: 16px; }
.doc-picked p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.doc-head {
  display: grid;
  grid-template-columns: 78px 1fr minmax(168px, 34%);
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #5c2e2c;
}
.doc-head img { width: 78px; height: auto; object-fit: contain; }
.doc-brand { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: #6b4a44; line-height: 1.45; }
.doc-brand b { color: #3b1f1c; font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.doc-meta { text-align: right; font-size: 12.5px; color: #6b4a44; line-height: 1.5; }
.doc-meta strong {
  display: block; font-size: 16px; line-height: 1.3; margin-bottom: 0;
  color: #3b1f1c; font-weight: 700;
}
.doc-title-en {
  display: block; font-size: 12px; font-weight: 600; color: #6b4a44;
  letter-spacing: .03em; margin: 2px 0 6px; line-height: 1.3;
}
.doc-lead { color: #6b4a44; margin: 0 0 14px; font-size: 13.5px; }
.doc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.doc-box {
  border: 1px solid #d9bfae; background: #fffaf5;
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.55;
}
.doc-box h4 {
  margin: 0 0 4px; font-size: 11px; color: #8a5a50; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.regcard { margin-top: 2px; }
.regcard .doc-lead { margin-bottom: 8px; }
.rc-stay, .rc-form, .rc-people { width: 100%; border-collapse: collapse; }
.rc-stay th, .rc-stay td, .rc-form th, .rc-form td, .rc-people th, .rc-people td {
  border: 1px solid #d2b9aa; padding: 4px 7px; vertical-align: middle; font-size: 12.5px;
}
.rc-stay th, .rc-form th, .rc-people th {
  background: #f7eee6; color: #6b4a44; font-weight: 700; text-align: center; font-size: 11px;
}
.rc-form th { width: 18%; text-align: left; font-size: 12px; }
.rc-stay td { text-align: center; }
.rc-stay .en, .rc-form .en {
  display: block; font-weight: 600; font-size: 10px; color: #8a5a50; letter-spacing: .02em;
}
.rc-sec {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin: 10px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #5c2e2c;
  font-size: 12.5px; font-weight: 700; color: #3b1f1c;
}
.rc-sec span { font-weight: 600; color: #8a5a50; }
.rc-sub { margin-top: 2px; color: #6b4a44; font-size: 11px; }
.rc-line {
  display: inline-block; width: 100%; min-width: 64px; height: 1.05em;
  border-bottom: 1px dotted #3b1f1c; vertical-align: bottom;
}
.rc-line.is-short { width: 52px; min-width: 52px; }
.rc-val { font-weight: 700; }
.rc-form td.is-tall { height: 34px; }
.rc-inline { display: inline-flex; align-items: flex-end; gap: 6px; min-width: 30%; margin: 1px 10px 1px 0; }
.rc-inline .rc-line { width: 108px; }
.rc-inline .rc-line.is-short { width: 52px; min-width: 52px; }
.rc-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.rc-checks > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rc-tick {
  width: 11px; height: 11px; border: 1px solid #3b1f1c; display: inline-block; flex: 0 0 auto;
}
.rc-people td { height: 24px; }
.rc-people td.num { text-align: center; color: #6b4a44; width: 36px; }
.rc-pay {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid #d2b9aa; padding: 6px 8px; font-size: 12.5px;
}
.rc-pay .rc-inline { margin: 0; min-width: 180px; }
.rc-pay .rc-line { width: 88px; }
.rc-terms { font-size: 11.5px; color: #3b1f1c; line-height: 1.45; margin-top: 8px; }
.rc-terms ol { margin: 3px 0 0; padding-left: 18px; }
.rc-terms li { margin: 0; }
.print-sheet.is-regcard {
  width: 210mm;
  height: 297mm;
  max-width: none;
  box-sizing: border-box;
  padding: 7mm 9mm;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.is-regcard .doc-accent { flex: none; height: 4px; margin-bottom: 5px; }
.is-regcard .doc-head {
  flex: none;
  grid-template-columns: 52px 1fr minmax(156px, 34%);
  gap: 6px 10px; margin-bottom: 4px; padding-bottom: 4px;
}
.is-regcard .doc-head img { width: 46px; }
.is-regcard .doc-brand { font-size: 11px; line-height: 1.25; gap: 0; }
.is-regcard .doc-brand b { font-size: 15px; }
.is-regcard .doc-meta { font-size: 12px; line-height: 1.35; }
.is-regcard .doc-meta strong { font-size: 15px; }
.is-regcard .doc-title-en { margin: 1px 0 4px; font-size: 11px; }
.is-regcard .regcard {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.is-regcard .doc-lead { flex: none; font-size: 12.5px; margin-bottom: 2px; }
.is-regcard .rc-stay,
.is-regcard .rc-form,
.is-regcard .rc-people { table-layout: fixed; }
.is-regcard .rc-stay { flex: none; }
.is-regcard .rc-stay th, .is-regcard .rc-stay td,
.is-regcard .rc-form th, .is-regcard .rc-form td,
.is-regcard .rc-people th, .is-regcard .rc-people td {
  padding: 2px 6px; font-size: 12px; line-height: 1.2;
}
.is-regcard .rc-form { flex: 1 1 auto; height: 0; min-height: 0; }
.is-regcard .rc-form th, .is-regcard .rc-form td { padding: 0 6px; font-size: 11px; }
.is-regcard .rc-form tr { height: 1%; }
.is-regcard .rc-form th { width: 27%; font-size: 11px; white-space: nowrap; }
.is-regcard .rc-stay th { white-space: normal; font-size: 11.5px; line-height: 1.15; padding: 3px 4px; }
.is-regcard .rc-stay .en { display: block; margin: 0; font-size: 9px; }
.is-regcard .rc-form .en {
  display: block; margin: 0; font-size: 8px; line-height: 1; font-weight: 600; white-space: nowrap;
}
.is-regcard .rc-sec { flex: none; margin: 2px 0 1px; font-size: 12px; }
.is-regcard .rc-sub { display: inline; margin: 0 0 0 4px; font-size: 10px; }
.is-regcard .rc-stay td {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-size: 10.5px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: break-word;
}
.rc-stay .rc-sub,
.is-regcard .rc-stay .rc-sub {
  display: block;
  margin: 1px 0 0;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 600;
}
.is-regcard.is-group .rc-stay th:nth-child(1),
.is-regcard.is-group .rc-stay td:nth-child(1) { width: 32%; text-align: left; }
.is-regcard.is-group .rc-stay th:nth-child(2),
.is-regcard.is-group .rc-stay td:nth-child(2),
.is-regcard.is-group .rc-stay th:nth-child(3),
.is-regcard.is-group .rc-stay td:nth-child(3) { width: 15%; }
.is-regcard.is-group .rc-stay th:nth-child(4),
.is-regcard.is-group .rc-stay td:nth-child(4) { width: 8%; }
.is-regcard .rc-rooms {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}
.is-regcard.is-group.is-many .rc-stay th:nth-child(1),
.is-regcard.is-group.is-many .rc-stay td:nth-child(1) { width: 42%; }
.is-regcard.is-group.is-many .rc-rooms { font-size: 10.5px; }
.is-regcard .rc-stay td.rc-booking { font-size: 10px; }
.is-regcard .rc-stay td > .rc-line,
.is-regcard .rc-form td > .rc-line {
  display: block; width: 100%; min-width: 0;
}
.is-regcard .rc-form td.is-tall { height: auto; }
.is-regcard .rc-people { flex: none; }
.is-regcard .rc-people td { height: 18px; }
.is-regcard .rc-pay { flex: none; padding: 4px 8px; font-size: 13px; }
.is-regcard .rc-terms { flex: none; font-size: 10.5px; line-height: 1.2; margin-top: 2px; }
.is-regcard .rc-terms ol {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
  margin: 2px 0 0; padding-left: 16px;
}
.rc-terms .en, .is-regcard .rc-terms .en {
  display: block; margin: 0; font-size: 8.5px; font-weight: 600; line-height: 1.15;
  color: #6b4a44; white-space: normal;
}
.is-regcard .doc-sign { flex: none; margin-top: 6px; gap: 24px; font-size: 12.5px; }
.is-regcard .doc-sign-pad { height: 42px; }
.is-regcard .doc-sign-line { margin: 0 6px 4px; }
.is-regcard .doc-sign-date { margin-top: 0; font-size: 12px; }
.is-regcard .doc-foot { flex: none; margin-top: 0; padding-top: 1px; font-size: 10.5px; }
.reg-table { display: grid; gap: 0; border: 1px solid #c9b0a4; border-radius: 8px; overflow: hidden; }
.reg-table > div { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid #ead8cc; }
.reg-table > div:last-child { border-bottom: 0; }
.reg-table span { padding: 8px 12px; background: #f7eee6; color: #6b4a44; font-size: 13px; }
.reg-table b { padding: 8px 12px; font-weight: 600; color: #2b1a18; }
.doc-note { font-size: 12.5px; color: #6b4a44; margin: 14px 0 0; line-height: 1.55; }
.doc-kv, .doc-bill {
  width: 100%; border-collapse: collapse; margin: 4px 0 0;
  font-size: 13.5px;
}
.doc-kv th, .doc-kv td, .doc-bill th, .doc-bill td {
  border: 1px solid #d2b9aa; padding: 7px 10px; vertical-align: top;
}
.doc-kv th {
  width: 34%; text-align: left; font-weight: 600; color: #6b4a44;
  background: #f7eee6; font-size: 13px;
}
.doc-bill thead th { background: #f7eee6; font-size: 12px; color: #6b4a44; font-weight: 700; }
.doc-kv .num, .doc-bill .num, .doc-bill td.num {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.doc-bill tr.is-total td, .doc-kv tr.is-total th, .doc-kv tr.is-total td {
  background: #fff1ec; font-weight: 700; border-top: 2px solid #5c2e2c;
}
.doc-bill tr.is-due td, .doc-kv tr.is-due th, .doc-kv tr.is-due td { font-weight: 700; }
.doc-kv tr.is-note td {
  background: #fff8f3; color: #5c2e2c; font-size: 13px; line-height: 1.55;
}
.doc-bill td.mid, .doc-bill th.mid { text-align: center; white-space: nowrap; }
.doc-muted { color: #8a5a50; font-style: italic; }
.doc-sign {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  margin-top: 36px; text-align: center; font-size: 13px;
  page-break-inside: avoid;
}
.doc-sign-pad { height: 52px; }
.doc-sign-line { border-top: 1px solid #3b1f1c; margin: 0 18px 8px; }
.doc-sign-role { font-weight: 700; color: #3b1f1c; }
.doc-sign-date { color: #6b4a44; font-size: 12px; margin-top: 4px; }
.doc-foot {
  margin-top: 28px; padding-top: 10px; border-top: 1px dashed #d2b9aa;
  font-size: 11px; color: #8a5a50; text-align: center;
}
body.is-print-page .content { background: #efe4d6; }
body.is-print-page { background: #efe4d6; }

@media (max-width: 1080px) {
  .doc-cards { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .doc-head { grid-template-columns: 64px 1fr; }
  .doc-meta { grid-column: 1 / -1; text-align: left; }
  .doc-grid2, .doc-sign { grid-template-columns: 1fr; }
  .reg-table > div { grid-template-columns: 1fr; }
}

/* Dashboard luxury */
.dash-hero {
  display: flex; justify-content: space-between; align-items: stretch; gap: 28px;
  background: linear-gradient(135deg, #8f2f2c 0%, #b33a36 42%, #c46a3a 100%);
  color: #fff9f2; border-radius: 24px; padding: 28px 32px; margin-bottom: 18px;
  box-shadow: 0 22px 50px rgba(140,40,36,.22);
}
.dash-kicker { margin: 0; letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: #f8c8c0; }
.dash-hero h2 { margin: 6px 0 4px; font-size: 34px; font-weight: 600; letter-spacing: .02em; }
.dash-date { margin: 0 0 18px; color: #fde8c8; font-size: 15px; }
.dash-hero-stats { display: flex; flex-wrap: wrap; gap: 22px; }
.dash-hero-stats div { min-width: 88px; }
.dash-hero-stats b { display: block; font-size: 28px; font-weight: 600; line-height: 1.1; }
.dash-hero-stats span { font-size: 13px; color: #f8c8c0; }
.occ-wrap { text-align: center; min-width: 160px; }
.occ-ring {
  --p: 0;
  width: 132px; height: 132px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(#F5FA8F calc(var(--p) * 1%), rgba(255,255,255,.14) 0);
  display: grid; place-items: center;
}
.occ-inner {
  width: 100px; height: 100px; border-radius: 50%;
  background: #7a2a28; display: grid; place-items: center; text-align: center;
}
.occ-inner strong { font-size: 26px; line-height: 1; }
.occ-inner small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #f8c8c0; }
.occ-note { margin: 10px 0 0; font-size: 13px; color: #fde8c8; }
.occ-note em { display: block; font-style: normal; margin-top: 2px; }
.occ-note .up { color: #F5FA8F; }
.occ-note .down { color: #ffd0c8; }

.dash-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.dk {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 16px 14px; box-shadow: var(--shadow); min-width: 0;
}
.dk-ico {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(160deg, #FA948F, #FACA8F); color: #5c2e2c; margin-bottom: 10px;
}
.dk-ico .ico { width: 18px; height: 18px; }
.dk-lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dk-val { font-family: var(--display); font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -.02em; line-height: 1.15; }
.dk-sub { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.35; }

.dash-grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: 16px; margin-bottom: 16px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-hint { color: var(--muted); font-size: 13px; font-weight: 500; }
.count-pill {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  background: #fff1ec; color: var(--ink); display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.trend { display: grid; grid-template-columns: repeat(13, minmax(36px, 1fr)); gap: 8px; align-items: end; min-height: 180px; overflow-x: auto; }
.trend-col { text-align: center; min-width: 0; }
.trend-bar {
  height: 120px; border-radius: 10px; background: #f7ebe0;
  display: flex; align-items: flex-end; overflow: hidden;
}
.trend-bar i { display: block; width: 100%; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #FA948F, #FACA8F); }
.trend-col.today .trend-bar i { background: linear-gradient(180deg, #c45d58, #FA948F); }
.trend-col.future .trend-bar i { background: linear-gradient(180deg, #F5FA8F, #FACA8F); }
.trend-col.today .trend-bar { box-shadow: 0 0 0 2px #FA948F; }
.trend-col b { display: block; font-size: 11px; margin-top: 6px; }
.trend-col span { display: block; font-size: 12px; color: var(--muted); }
.trend-col small { display: block; font-size: 11px; color: #c9a08e; }

.mix-bar { height: 10px; border-radius: 99px; overflow: hidden; display: flex; background: #f3e6d4; margin-bottom: 14px; }
.mix-bar i { display: block; height: 100%; }
.mix-list { display: grid; gap: 8px; }
.mix-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.mix-row span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.mix-row .ico { width: 16px; height: 16px; }
.mix-row b { font-size: 16px; }

.guest-list { padding: 6px 0; }
.guest-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 22px; border-bottom: 1px solid #f5e6d4;
}
.guest-row:last-child { border-bottom: 0; }
.gr-room { font-family: var(--display); font-size: 22px; font-weight: 600; }
.guest-row b { display: block; font-size: 15px; }
.guest-row small { display: block; color: var(--muted); font-size: 13px; }
.guest-row .amt { font-size: 13px; font-weight: 600; color: var(--muted); }
.quiet { padding: 28px 22px; color: var(--muted); font-size: 15px; }
.alert-due.overdue { background: #fff1ec; border-color: #FA948F; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid-2, .setup-layout, .io-layout { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .dash-kpis { grid-template-columns: 1fr 1fr 1fr; }
  .dash-grid, .dash-cols { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; }
  .att-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  html { font-size: 17px; }
  .sidebar {
    transform: translateX(-105%);
    width: min(var(--navw), 86vw);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .sidebar-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .main { margin-left: 0; }
  .burger { display: grid; }
  .form-grid, .bk-grid, .grp-line { grid-template-columns: 1fr; }
  .day-rate { grid-template-columns: minmax(0, 1fr) 128px; padding-left: 12px; }
  .cm-total-row { grid-template-columns: 1fr; }
  .cm-total-row .btn { width: 100%; height: auto; }
  .hk-assign, .hk-assign-room, .hk-assign-other { grid-template-columns: 1fr; }
  .hk-assign .btn { width: 100%; }
  .mobile-nav { display: grid; }
  .content { padding: 16px 14px calc(118px + var(--safe-b)); }
  .topbar {
    height: auto;
    min-height: 58px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  }
  .topbar h1 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .val { font-size: 30px; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-hero { padding: 22px 18px; }
  .dash-hero h2 { font-size: 28px; }
  .dash-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
  .dash-hero-stats div { min-width: 0; }
  .trend { overflow-x: auto; min-width: 0; }
  .top-profile span { display: none; }
  .top-profile { width: 44px; height: 44px; padding: 0; border-radius: 14px; }
  .rc { min-height: 120px; padding: 16px 14px 12px; }
  .rc-num { font-size: 34px; }
  .rc-type {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-legend { gap: 8px 10px; }
  .room-legend .btn { margin-left: auto; }
  .rsv-head { display: none; }
  .rsv-head, .rsv-item { min-width: 0; }
  .rsv-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 16px 18px;
  }
  .rsv-room {
    width: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
    padding: 10px 12px;
  }
  .rsv-room .num { font-size: 22px; }
  .rsv-room .typ { margin-top: 0; -webkit-line-clamp: 1; flex: 1; }
  .rsv-room .amt { margin-top: 0; margin-left: auto; }
  .rsv-status { padding-top: 0; }
  .rsv-ops, .rsv-docs { justify-content: stretch; }
  .rsv-ops .btn, .rsv-docs .btn { flex: 1 1 calc(50% - 6px); }
  .rsv-ops .btn-gold { flex: 1 1 100%; }
  .rsv-toolbar { flex-wrap: nowrap; }
  .rsv-toolbar .rsv-q { min-width: 0; flex: 1 1 auto; }
  .panel-h { padding: 14px 16px; flex-wrap: wrap; }
  .panel-h .btn { flex: 0 0 auto; }
  .filters select { flex: 1 1 100%; min-width: 0; }
  .setup-form, .setup-form-room { grid-template-columns: 1fr; }
  .setup-add { padding: 14px 16px; }
  .setup-add .btn, .setup-form .btn { width: 100%; }
  .setup-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .setup-stat { min-width: 0; padding: 10px 10px; }
  .setup-card-rate { font-size: 16px; }
  .io-card { grid-template-columns: 64px 1fr; }
  .io-card > .btn,
  .io-actions { grid-column: 1 / -1; max-width: none; }
  .io-focus-guest { grid-template-columns: 64px 1fr; }
  .io-focus-guest .badge { grid-column: 2; justify-self: start; }
  .io-charge-form { grid-template-columns: 1fr; }
  .io-charge-form .btn { width: 100%; }
  .usr-row { grid-template-columns: 32px minmax(0, 1fr); }
  .usr-head-actions { width: 100%; }
  .usr-head-actions .btn { flex: 1; }
  .usr-side { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .usr-manage-static { grid-template-columns: 1fr; }
  .usr-reset { min-width: 0; width: 100%; }
  .hk-me .btn { flex: 1 1 100%; width: 100%; margin-left: 0; }
  .job-card .actions-col > div { flex-wrap: wrap; }
  .job-card .actions-col > div .btn { flex: 1 1 calc(50% - 4px); }
  .att-hero > a.btn { width: 100%; justify-content: center; }
  .login-card { padding: 28px 20px; }
  .login-card h1 { font-size: 30px; }
  .login-card img { width: 128px; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .scrim.show { display: block; }
}
/* Staff attendance */
.att-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.att-hero {
  background: linear-gradient(145deg, #8f2f2c 0%, #b33a36 48%, #c46a3a 100%);
  color: #fff9f2; border-radius: 24px; padding: 28px 26px;
  box-shadow: 0 22px 50px rgba(140,40,36,.18);
}
.att-kicker { margin: 0; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; color: #f8c8c0; }
.att-clock {
  font-family: var(--display); font-size: 56px; font-weight: 600;
  letter-spacing: .04em; line-height: 1; margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.att-date { color: #fde8c8; font-size: 16px; margin-bottom: 18px; }
.att-who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.att-who b { display: block; font-size: 20px; }
.att-who small { color: #f8c8c0; font-size: 14px; }
.att-hero .btn-ghost {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: #fff9f2;
  margin-bottom: 12px;
}
.att-hero .badge { background: rgba(255,255,255,.16); color: #fff9f2; }
.att-times {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16);
}
.att-times dt { font-size: 13px; color: #f8c8c0; }
.att-times dd { margin: 2px 0 0; font-size: 28px; font-weight: 600; }
.att-times small { color: #fde8c8; font-size: 13px; }
.att-cam-box {
  position: relative; background: #1a1210; border-radius: 18px;
  overflow: hidden; aspect-ratio: 3 / 4; max-height: 420px; margin: 0 auto;
}
.att-cam-box video, .att-cam-box img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #1a1210;
}
.att-cam-box canvas {
  position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none;
}
.att-cam-box [hidden],
.att-cam-actions [hidden] {
  display: none !important;
}
.att-cam-box.is-preview video,
.att-cam-box.is-preview .att-cam-hint {
  display: none !important;
}
.att-cam-box.is-preview img {
  display: block !important;
}
.att-cam-hint {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  color: #fde8c8; font-size: 15px; padding: 20px; text-align: center;
  background: rgba(26,18,16,.55);
}
.att-cam-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att-file-btn { position: relative; overflow: hidden; cursor: pointer; }
.att-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.att-loc {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff6ee; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin: 14px 0;
}
.att-loc .ico { color: var(--gold); margin-top: 2px; }
.att-loc b { display: block; font-size: 15px; }
.att-loc small { color: var(--muted); font-size: 13px; }
.att-loc.ok { background: #ecfdf3; border-color: #bbf7d0; }
.att-loc.ok .ico { color: var(--ok); }
.att-loc.err { background: #fef2f2; border-color: #fecaca; }
.att-loc.err .ico { color: var(--danger); }
.att-punch { width: 100%; padding: 16px; font-size: 18px; border-radius: 16px; }
.att-note { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }
.att-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.att-photos a {
  display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff;
}
.att-photos img { width: 100%; height: 140px; object-fit: cover; display: block; }
.att-photos span { display: block; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.att-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; display: block; }
.att-place { max-width: 220px; font-size: 13px; line-height: 1.4; }
.att-place a { color: var(--info); text-decoration: underline; }
.att-paper { display: none; }
.att-ico {
  width: 40px; height: 40px; padding: 0; border-radius: 13px;
  border: 1px solid var(--line); background: #fff6ee; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer;
}
.att-ico .ico { width: 20px; height: 20px; }
.att-ico.is-photo { background: #fff1ec; color: #b33a36; }
.att-ico.is-place { background: #eef4ff; color: #2563eb; }
.att-ico:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(200,100,90,.16); }
.att-view-modal { width: min(460px, 100%); }
.att-view-modal.is-place { width: min(640px, 100%); }
.att-view-modal .modal-head { justify-content: space-between; align-items: flex-start; }
.att-view-modal .modal-head h3 { margin: 0; }
.att-view-modal [hidden] { display: none !important; }
.att-view-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.att-view-photo {
  width: 100%; max-height: min(62vh, 520px); object-fit: contain;
  border-radius: 16px; background: #1a1210; display: block;
}
.att-view-loc {
  background: #fff6ee; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 12px;
}
.att-view-loc b { display: block; font-size: 16px; line-height: 1.45; }
.att-view-loc small { color: var(--muted); font-size: 13px; }
.att-view-map {
  width: 100%; height: 280px; border: 0; border-radius: 16px;
  background: #eef4ff; display: block; margin-bottom: 12px;
}
.att-view-modal .btn { width: 100%; }
.att-filters {
  background: var(--card); border-radius: var(--r); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px;
  overflow: visible; align-items: flex-end;
}
.att-filters .f { min-width: 180px; flex: 1 1 180px; }
.atr-filters { gap: 12px; }
.atr-quick { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.atr-quick a {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fffdf9; color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.atr-quick a.on {
  background: linear-gradient(90deg, #FA948F, #FACA8F);
  border-color: transparent; color: var(--ink);
}
.atr-actions { display: flex; gap: 8px; align-items: center; }
.atr-block { margin-bottom: 16px; }
.atr-stats .kpi { position: relative; overflow: hidden; }
.atr-stats .kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
}
.atr-stats .is-in::before { background: #b33a36; }
.atr-stats .is-work::before { background: #2563eb; }
.atr-stats .is-out::before { background: #16a34a; }
.atr-stats .is-miss::before { background: #d97706; }
.atr-stats .is-work .val { color: #1d4ed8; }
.atr-stats .is-out .val { color: #15803d; }
.atr-stats .gold::before { display: none; }
.atr-stats .gold .val { color: var(--ink); }
.atr-day {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 18px; background: #fff6ee; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.atr-day b { font-size: 15px; }
.atr-day span { color: var(--muted); font-weight: 600; }
.atr-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #f5e0c8;
}
.atr-row:last-child { border-bottom: 0; }
.atr-row:hover { background: #fffaf6; }
.atr-row.is-late { box-shadow: inset 3px 0 0 #e08a80; }
.atr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}
.atr-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.atr-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  background: #fff6ee;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.atr-chip.is-ok, .atr-chip.is-done { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.atr-chip.is-late, .atr-chip.is-nosalary { color: #b33a36; background: #fff1f2; border-color: #fecdd3; }
.atr-chip.is-waived, .atr-chip.is-off { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.atr-chip.is-noshift, .atr-chip.is-time { color: var(--ink-2); background: #fffdf9; }
.atr-chip.is-work { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.atr-who, .atr-miss-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.atr-who b, .atr-miss-item b { display: block; font-size: 16px; line-height: 1.25; }
.atr-who small, .atr-miss-item small { color: var(--muted); font-size: 13px; }
.atr-av {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  background: #fff1ec; color: #b33a36;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.atr-punches {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px; align-items: center; min-width: 0;
}
.atr-punch {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: #fff6ee; border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 10px;
}
.atr-punch.is-in { background: #f3fbf6; border-color: #c8ead4; }
.atr-punch.is-out { background: #fff8ee; }
.atr-punch.is-wait { background: #f4f7ff; border-color: #d7e3fb; }
.atr-k {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted);
}
.atr-when { min-width: 0; flex: 1; }
.atr-when b {
  display: block; font-family: var(--display); font-size: 22px; font-weight: 600;
  line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.atr-when small {
  display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.atr-punch.is-wait .atr-when b { font-size: 16px; color: #1d4ed8; }
.atr-tools { display: flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.atr-tools:empty { display: none; }
.atr-punch .att-ico { width: 36px; height: 36px; border-radius: 12px; }
.atr-arrow { color: #c4897a; font-size: 18px; line-height: 1; }
.atr-waive-note {
  margin: -4px 0 0;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
}
.atr-act {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed #f3d0b0;
}
.atr-waive { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.atr-waive input[type="text"] { width: min(280px, 100%); min-height: 38px; }
.set-lead { margin: 0 0 14px; }
.set-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 14px; color: var(--ink-2); font-weight: 700; text-decoration: none;
}
.set-back:hover { color: #b33a36; }
.set-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.set-pick a {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-height: 156px; padding: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.set-pick a:hover { transform: translateY(-2px); border-color: #f0b4a4; }
.set-pick .ico { width: 28px; height: 28px; color: #b33a36; }
.set-pick b { font-size: 20px; line-height: 1.3; }
.set-pick small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.set-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.set-box-wide { grid-column: 1 / -1; }
.set-box .form-grid { grid-template-columns: 1fr; }
.set-box-wide .form-grid { grid-template-columns: 1fr 1fr; }
.set-box .panel-h h2 { display: inline-flex; align-items: center; gap: 8px; }
.set-box .panel-h .ico { width: 22px; height: 22px; color: var(--gold); }
.set-note { margin: 0 0 14px; line-height: 1.55; }
.set-box .btn { margin-top: 14px; }
.set-check {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--ink); margin-bottom: 4px;
}
.set-check input { width: 18px; height: 18px; }
.att-shift {
  margin-top: 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.14); font-size: 14px; line-height: 1.45;
}
.att-shift b { display: block; font-size: 16px; }
.atr-dur { font-size: 15px; font-weight: 700; line-height: 1.3; text-align: right; }
.atr-miss { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.atr-miss-item {
  padding: 8px 10px; border-radius: 14px; background: #fff6ee; border: 1px solid var(--line);
}
.atr-print-only { display: none; }
.att-filters.atr-list-filters {
  align-items: center;
  gap: 6px;
  padding: 8px;
  margin-bottom: 10px;
}
.atr-list-filters input,
.atr-list-filters select {
  width: auto;
  height: 32px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 9px;
}
.atr-list-filters input[type=text] { flex: 1 1 140px; min-width: 120px; }
.atr-list-filters input[type=month] { flex: 0 0 146px; }
.atr-list-filters select { flex: 0 1 148px; }
.atr-list-filters .atr-actions { gap: 6px; }
.atr-list-filters .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 9px;
}
.atr-table { min-width: 860px; font-size: 13.5px; }
.atr-table th, .atr-table td { padding: 5px 10px; }
.atr-table .atr-chip { padding: 1px 8px; font-size: 12px; }
.atr-table th.is-right, .atr-table td.is-right { text-align: right; }
.atr-table tr.is-late td { background: #fff8f8; }
.atr-mini { display: flex; align-items: center; gap: 8px; min-width: 0; }
.atr-mini b { display: block; font-size: 14.5px; line-height: 1.25; }
.atr-mini small { display: block; color: var(--muted); font-size: 12px; }
.atr-av.is-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
.atr-when-line { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atr-when-line small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.atr-money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.atr-money.is-none { color: var(--muted); font-weight: 600; }
.atr-note { display: block; margin-top: 3px; color: #1d4ed8; font-size: 12px; font-weight: 600; }
.atr-note[hidden] { display: none; }
.atr-icos { display: flex; gap: 4px; }
.atr-icos .att-ico { width: 32px; height: 32px; border-radius: 10px; }
.atr-icos .att-ico .ico { width: 16px; height: 16px; }
.atr-manage { display: flex; justify-content: flex-end; gap: 6px; }
.atr-manage .btn { white-space: nowrap; }
#waiveForm .modal-head { justify-content: space-between; align-items: flex-start; }
.atr-block .panel-h .dash-hint { display: block; margin-top: 4px; line-height: 1.45; }

@media (max-width: 980px) {
  .set-grid, .set-box-wide { grid-template-columns: 1fr; grid-column: auto; }
  .atr-top { flex-direction: column; align-items: flex-start; }
  .atr-chips { justify-content: flex-start; }
  .atr-act, .atr-waive { justify-content: flex-start; width: 100%; }
  .atr-waive input[type="text"] { flex: 1; min-width: 0; }
}
@media (max-width: 860px) {
  .att-layout { grid-template-columns: 1fr; }
  .att-clock { font-size: 42px; }
  .att-cam-box { max-height: 360px; }
  .atr-punches { grid-template-columns: 1fr; }
  .atr-arrow { display: none; }
  .atr-actions { width: 100%; }
  .atr-actions .btn { flex: 1; }
  .atr-list-filters input,
  .atr-list-filters select,
  .atr-list-filters .atr-actions { flex: 1 1 100%; width: 100%; }
  .atr-list-filters .atr-actions .btn { flex: 1; }
}

@page regcard { size: A4 portrait; margin: 7mm 9mm 7mm; }
@media print {
  @page { size: A4 portrait; margin: 10mm 12mm 12mm; }
  .print-sheet.is-regcard {
    page: regcard;
    width: auto !important;
    height: 283mm !important;
    max-height: 283mm !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .is-regcard .doc-head,
  .is-regcard .doc-sign,
  .is-regcard .rc-stay,
  .is-regcard .rc-people,
  .is-regcard .rc-terms { break-inside: auto; }
  html { font-size: 11pt !important; }
  html, body, body.app, body.is-print-page {
    background: #fff !important;
    color: #1a1a1a !important;
    min-height: 0 !important;
  }
  body.app { font-size: 11pt; }
  .sidebar, .topbar, .mobile-nav, .no-print, .scrim, .toast, .flash, .push-pop, .burger, .att-screen, .modal-bg { display: none !important; }
  .att-paper { display: inline !important; }
  img.att-paper { display: block !important; width: 42px; height: 42px; object-fit: cover; }
  .pay-screen { display: none !important; }
  .me-card {
    color: #1a1a1a !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
  .me-card::before, .me-card::after { display: none !important; }
  .me-kicker, .me-chip span, .me-pay small { color: #555 !important; }
  .me-code, .me-chip, .me-pay {
    background: #fff !important;
    border-color: #ddd !important;
    color: #1a1a1a !important;
  }
  .me-pay b, .me-card h2 { color: #1a1a1a !important; }
  .me-pay span { color: #444 !important; }
  .me-avatar { box-shadow: none !important; }
  .atr-print-only { display: block !important; }
  .atr-print-only h2 { margin: 0 0 4px; font-size: 16pt; }
  .atr-print-sub { margin: 0 0 12px; }
  .atr-print-only table.data { font-size: 10pt; }
  .atr-print-only td, .atr-print-only th { vertical-align: top; }
  .shell, .main, .content {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .table-wrap { overflow: visible !important; }
  .print-sheet, .doc-sheet {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .doc-accent { border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .doc-head { border-bottom-color: #3b1f1c; }
  .doc-box, .reg-table span, .rc-stay th, .rc-form th, .rc-people th, .doc-kv th, .doc-bill thead th,
  .doc-bill tr.is-total td, .doc-kv tr.is-total th, .doc-kv tr.is-total td, .doc-kv tr.is-note td {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  table.data th, table.data td { background: transparent !important; color: #1a1a1a; }
  table.data tr:hover td { background: transparent !important; }
  .print-sheet, .doc-sheet, img {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .doc-head, .doc-sign, .doc-grid2, .reg-table, .rc-stay, .rc-people, .rc-terms, .lv-sign, .lv-slip-approve, .lv-slip-ask {
    break-inside: avoid;
  }
  .lv-sign-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lv-slip-status, .lv-slip-who, .lv-sign-ink {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .regcard { font-size: 9.5pt; }
  .regcard .doc-sign { margin-top: 14px; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* Permissions */
.perm-hint { font-size: 14px; color: var(--muted); margin: 0 0 12px; font-weight: 400; }
.readonly-note {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px;
}
body.is-readonly form[method="post"] button[type="submit"],
body.is-readonly form[method="post"] input[type="submit"] {
  pointer-events: none; opacity: .45;
}
.perm-matrix { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
.perm-matrix table { min-width: 720px; margin: 0; }
.perm-matrix .perm-role {
  text-align: center; font-size: 12px; min-width: 148px; white-space: normal; line-height: 1.3;
}
.perm-matrix .perm-role small {
  display: block; font-weight: 500; color: var(--muted); font-size: 11px;
  margin-top: 3px; letter-spacing: 0;
}
.perm-matrix .perm-check { text-align: center; }
.perm-split { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.perm-split label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; cursor: pointer;
}
.perm-page.is-split { grid-column: 1 / -1; align-items: center; justify-content: space-between; cursor: default; }
.perm-matrix .perm-sticky {
  position: sticky; left: 0; background: #fffdf9; z-index: 1; min-width: 140px;
}
.perm-matrix tr:hover .perm-sticky { background: #fff6ee; }
.perm-group-row td {
  background: #fff1ec; color: var(--muted); font-size: 12px; font-weight: 700;
  letter-spacing: .04em; padding: 8px 14px;
}
.perm-matrix input[type=checkbox],
.perm-page input[type=checkbox],
.perm-mode input[type=checkbox],
.perm-mode input[type=radio] {
  width: 18px; height: 18px; accent-color: #e06b66; flex: 0 0 auto;
}
.modal-wide { width: min(680px, 100%); }
.modal-wide .modal-head { justify-content: space-between; }
.perm-mode-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.perm-mode {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff6ee; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  cursor: pointer;
}
.perm-mode:has(input:checked) { border-color: #FA948F; background: #fff1ec; }
.perm-mode b { display: block; color: var(--ink); font-size: 15px; }
.perm-mode small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.perm-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.perm-pages {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  max-height: 54vh; overflow: auto; padding: 2px;
}
.perm-page-sec {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; padding: 10px 2px 0;
}
.perm-pages.is-disabled { opacity: .55; }
.perm-page {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffdf9; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 14px; cursor: pointer;
}
.perm-page b { display: block; font-size: 14px; }
.perm-page small { color: var(--muted); font-weight: 400; }
@media (max-width: 700px) {
  .perm-pages { grid-template-columns: 1fr; }
  .perm-mode-picks { grid-template-columns: 1fr; }
}

/* Employee profile */
.hk-me {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hk-me-id { flex: 1; min-width: 140px; }
.hk-me-id b { display: block; font-size: 17px; }
.hk-me-id small { color: var(--muted); font-size: 13px; }
.hk-me .btn { margin-left: auto; }
.pf-layout {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}
.pf-side { position: sticky; top: calc(var(--top) + 16px); }
.pf-card { padding: 28px 22px 22px; text-align: center; }
.pf-avatar { width: 72px; height: 72px; font-size: 28px; margin: 0 auto 12px; }
.pf-card h2 { margin: 0 0 4px; font-family: var(--display); font-size: 24px; font-weight: 600; }
.pf-card > p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.pf-code-box {
  background: linear-gradient(160deg, #fff1ec, #fffdf9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}
.pf-code-box > span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.pf-code {
  display: block;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 4px 0 10px;
}
.pf-code-box .btn { width: 100%; }
.pf-meta { display: grid; gap: 10px; text-align: left; margin: 0 0 16px; }
.pf-meta div { background: #fff6ee; border-radius: 14px; padding: 10px 12px; }
.pf-meta dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.pf-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; }
.pf-sec-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-grid .pf-sec-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
@media (max-width: 1080px) {
  .pf-layout { grid-template-columns: 1fr; }
  .pf-side { position: static; }
}
td.num, th.num { text-align: right; white-space: nowrap; }
tr.is-void td { color: var(--muted); text-decoration: line-through; }
.alert-due a { color: inherit; font-weight: 700; }

.lv-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 18px 20px;
  background: linear-gradient(135deg, #fff 0%, #fff6ef 55%, #ffe8dc 100%);
  border: 1px solid #f3d0b0; border-radius: 24px;
  box-shadow: 0 16px 40px rgba(180, 80, 70, .07);
}
.lv-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-avatar {
  width: 56px; height: 56px; border-radius: 18px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #FA948F, #FACA8F);
  color: #5c2e2c; font-family: var(--display); font-size: 26px; font-weight: 600;
  box-shadow: 0 8px 18px rgba(224, 107, 102, .28);
}
.lv-hero h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.15; }
.lv-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lv-meta span {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.72); border: 1px solid #f3d0b0;
  border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.lv-live { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.lv-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-tabs {
  display: inline-flex; gap: 4px; margin: 0 0 16px; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.lv-tabs .rsv-tab { border: 0; background: transparent; border-radius: 999px; padding: 8px 16px; }
.lv-tabs .rsv-tab.on { background: linear-gradient(90deg, #FA948F, #FACA8F); color: var(--ink); }
.lv-section-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.lv-section-label b { font-size: 16px; }
.lv-section-label span { color: var(--muted); font-size: 14px; }
.lv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.lv-card {
  --c: #e06b66;
  position: relative; overflow: hidden; min-width: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, #fff) 0%, #fff 46%);
  border: 1px solid color-mix(in srgb, var(--c) 22%, #fff);
  border-radius: 22px; padding: 16px 16px 14px;
  box-shadow: 0 14px 32px rgba(160, 70, 60, .06);
}
.lv-card.is-wide { grid-column: span 2; }
.lv-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lv-card-top span { color: var(--ink-2); font-size: 15px; font-weight: 600; line-height: 1.3; }
.lv-card-top i {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--c); background: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 22%, transparent);
}
.lv-card-top svg { width: 20px; height: 20px; }
.lv-num { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; margin-top: 14px; letter-spacing: -.03em; }
.lv-num small { font-size: 15px; font-weight: 500; margin-left: 4px; color: var(--muted); letter-spacing: 0; }
.lv-bar { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, #fff); margin-top: 12px; overflow: hidden; }
.lv-bar span { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.lv-sub { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.lv-rule { margin-top: 4px; font-size: 12px; line-height: 1.45; color: #6b534c; }
.lv-modal .modal-head { align-items: center; }
.lv-modal .modal-head h3 { margin: 0; }
.lv-modal [hidden] { display: none !important; }
.lv-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.lv-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .78fr); gap: 16px; align-items: stretch; }
.lv-cal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.lv-cal-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; }
.lv-month { display: inline-flex; align-items: center; gap: 4px; background: #fff7f2; border-radius: 999px; padding: 4px; }
.lv-month b { min-width: 132px; text-align: center; font-size: 15px; }
.lv-month a {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: #fff; color: var(--ink); font-size: 22px; line-height: 1;
}
.lv-month a:hover { background: #ffe4d4; }
.lv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lv-cal > b { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; padding-bottom: 2px; }
.lv-day {
  min-height: 58px; height: auto; border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; padding: 4px 2px;
  background: #fff8f3; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.1;
}
.lv-day em { font-style: normal; }
.lv-day small {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: 0; line-height: 1.2;
}
.lv-day.is-out { background: transparent; }
.lv-day.is-off { background: #f3d0c4; color: #8a3d36; }
.lv-day.is-today { background: #e06b66; color: #fff9f2; box-shadow: 0 8px 16px rgba(224, 107, 102, .28); }
.lv-day.is-approved { background: #dcfce7; color: #166534; }
.lv-day.is-pending { background: #ffedd5; color: #9a3412; }
.lv-day.is-today.is-approved, .lv-day.is-today.is-pending { box-shadow: inset 0 0 0 2px #e06b66; }
.lv-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.lv-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lv-legend i.is-today { background: #e06b66; }
.lv-legend i.is-approved { background: #dcfce7; }
.lv-legend i.is-off { background: #f3d0c4; }
.lv-off-picks { display: flex; flex-wrap: wrap; gap: 4px; min-width: 240px; }
.lv-off-picks .chip { margin: 0; padding: 4px 7px; font-size: 12px; }
.lv-off-picks input { width: auto; }
.lv-empty-wrap, .lv-empty-panel .lv-empty { min-height: 280px; }
.lv-empty { display: grid; justify-items: center; align-content: center; text-align: center; gap: 6px; padding: 28px 16px; }
.lv-empty-ico {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 6px;
  background: linear-gradient(160deg, #fff, #ffe8dc); color: #e06b66;
  box-shadow: inset 0 0 0 1px #f3d0b0;
}
.lv-empty-ico svg { width: 28px; height: 28px; }
.lv-empty b { font-size: 18px; }
.lv-empty p { margin: 0 0 8px; color: var(--muted); font-size: 14px; max-width: 240px; }
.lv-list { display: grid; gap: 12px; align-content: start; }
.lv-req {
  border: 1px solid var(--line); border-left: 4px solid var(--b, #e06b66);
  border-radius: 18px; padding: 14px 14px 14px 16px; background: #fff;
  box-shadow: 0 8px 22px rgba(160, 70, 60, .05);
}
.lv-req header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lv-req header b { display: block; font-size: 17px; }
.lv-req header small { color: var(--muted); font-size: 13px; }
.lv-req p { margin: 8px 0; color: var(--ink-2); }
.lv-req-main { font-weight: 600; }
.lv-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.lv-steps li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.lv-steps small { color: var(--muted); }
.lv-decide { display: grid; gap: 10px; margin-top: 8px; }
.lv-req-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-req-actions .btn { flex: 1 1 120px; }
.lv-inbox { padding: 12px 14px; }
.lv-inbox header b { font-size: 16px; }
.lv-inbox .lv-req-main { margin: 2px 0 8px; font-size: 14px; }
.lv-inbox .lv-req-main span { font-weight: 500; color: var(--muted); }
.lv-inbox .lv-req-main span::before { content: "· "; }
.lv-steps-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.lv-steps-row li {
  gap: 4px; padding: 2px 8px 2px 10px; border-radius: 999px;
  background: #fff8f3; font-size: 12px;
}
.lv-steps-row .badge { padding: 1px 7px; font-size: 11px; }
.lv-inbox .lv-decide {
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.lv-inbox .lv-decide input[type="text"],
.lv-inbox .lv-decide select {
  flex: 1 1 160px; width: auto; min-width: 0; height: 36px; min-height: 0;
  padding: 6px 10px; font-size: 14px;
}
.lv-inbox .lv-decide .lv-standin {
  flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px;
  margin: 0; font-size: 13px; color: var(--muted);
}
.lv-inbox .lv-decide .lv-standin select { width: 100%; flex: none; }
.lv-inbox .lv-decide .btn { flex: 0 0 auto; }
.lv-mine { padding: 12px; }
.lv-mine header { align-items: center; }
.lv-mine header > div { min-width: 0; }
.lv-mine header b { font-size: 15px; }
.lv-mine header small { display: block; font-size: 12px; line-height: 1.4; }
.lv-mine > header > .badge { flex: 0 0 auto; white-space: nowrap; padding: 3px 8px; font-size: 12px; }
.lv-mine .lv-steps-row { margin-bottom: 8px; }
.lv-mine-decide {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px;
}
.lv-mine-decide input[type="text"] {
  flex: 1 1 140px; width: auto; min-width: 0; height: 34px; min-height: 0;
  padding: 6px 10px; font-size: 13px;
}
.lv-mine-decide .btn { flex: 0 0 auto; }
.lv-mine-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lv-mine-actions form { margin: 0; }
.lv-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.lv-flow-step {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
}
.lv-flow-step b { display: block; font-size: 14px; }
.lv-flow-step span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.lv-flow-step.is-skip { background: #fff8f3; }
.lv-flow-step.is-skip span { color: #c4897a; }
.lv-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lv-jump a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.lv-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lv-dept-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.lv-dept-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.lv-dept-list form { margin: 0; }
.lv-dept-list .btn { min-width: 72px; }
.lv-staff-card { background: #fffdf9; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.lv-staff-card h3 { margin: 0; font-size: 18px; }
.lv-staff-card .who { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.lv-staff-card .btn { width: 100%; margin-top: 12px; }
.lv-field-label { margin: 12px 0 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.lv-off-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.lv-off-form .lv-field-label { margin: 0; }
.lv-daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-daypick label {
  position: relative; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px;
  cursor: pointer; background: #fff; font-size: 13px; color: var(--ink);
}
.lv-daypick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lv-daypick label:has(input:checked) { background: linear-gradient(90deg, #FA948F, #FACA8F); border-color: transparent; font-weight: 700; }
.lv-qrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f6e4d4; }
.lv-qrow b { display: block; }
.lv-qrow small { color: var(--muted); font-weight: 500; }
.lv-qrow input[type="number"], .lv-qrow input[type="text"] { width: min(220px, 46%); }
.lv-fold { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.lv-fold summary { cursor: pointer; font-weight: 700; }
.lv-setup-steps { display: grid; gap: 12px; }
.lv-setup-step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.lv-setup-step > b { display: block; margin-bottom: 4px; }
.lv-now { margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: #fff6ee; line-height: 1.5; }
.lv-setup [hidden], #empApprovers[hidden] { display: none !important; }
.lv-matrix input[type="text"] { min-width: 120px; margin-bottom: 6px; }
.lv-matrix input[type="number"] { width: 88px; }
.lv-step-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.lv-picks {
  max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; background: #fff; margin-top: 6px;
}
.lv-picks label { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 14px; color: var(--ink); }
.lv-picks small { color: var(--muted); }
.lv-dept-title { margin: 18px 0 8px; font-size: 18px; }
.lv-person { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.lv-person summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lv-person summary small { color: var(--muted); }
.lv-stamp {
  display: inline-block; margin: 0 0 12px; padding: 6px 12px; border-radius: 999px;
  background: #fff7ed; color: #9a3412; font-weight: 700; font-size: 14px;
}
.lv-letter { line-height: 1.8; }
.lv-slip .doc-accent { height: 4px; margin-bottom: 8px; }
.lv-slip .doc-head {
  grid-template-columns: 58px 1fr minmax(148px, 32%);
  gap: 8px 12px; margin-bottom: 8px; padding-bottom: 8px;
}
.lv-slip .doc-head img { width: 58px; }
.lv-slip .doc-brand, .lv-slip .doc-meta { font-size: 11.5px; line-height: 1.35; }
.lv-slip .doc-brand b { font-size: 16px; }
.lv-slip .doc-meta strong { font-size: 15px; }
.lv-slip .doc-title-en { margin: 1px 0 4px; }
.lv-slip-status {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 0 8px; padding: 5px 10px; border: 1px solid #e7c4a8; border-radius: 8px;
  background: #fff7ed; color: #9a3412; font-size: 12.5px;
}
.lv-slip-status b { font-size: 14px; color: #3b1f1c; }
.lv-slip-status.is-approved { background: #f0fdf4; border-color: #86efac; color: #166534; }
.lv-slip-status.is-rejected { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.lv-slip-status.is-cancelled { background: #f5f5f4; border-color: #d6d3d1; color: #57534e; }
.lv-slip-subject {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 0 2px; font-size: 14px;
}
.lv-slip-to { margin: 0 0 10px; font-size: 14px; }
.lv-doc p {
  margin: 0 0 4px; font-size: 14.5px; line-height: 1.75; text-align: left;
}
.lv-doc b, .lv-slip-letter .lv-fill { font-weight: 700; }
.lv-blank { display: inline-block; min-width: 72px; border-bottom: 1px solid #3b1f1c; }
.lv-slip-close { margin: 12px 0 0; font-size: 14.5px; }
.lv-slip-ask { display: flex; justify-content: flex-end; margin-top: 14px; }
.lv-slip-asker { width: 250px; text-align: center; font-size: 13.5px; }
.lv-sign-write { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.lv-sign-write span { flex: 1; border-bottom: 1px solid #3b1f1c; height: 22px; }
.lv-slip-asker .lv-sign-name { margin-top: 4px; }
.lv-slip-asker .lv-sign-date { margin-top: 2px; color: #6b4a44; font-size: 12px; }
.lv-slip-approve { margin-top: 16px; break-inside: avoid; page-break-inside: avoid; }
.lv-slip-approve h3 {
  margin: 0 0 10px; padding-bottom: 3px; border-bottom: 1.5px solid #5c2e2c;
  font-size: 14px; font-weight: 700;
}
.lv-sign-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
.lv-sign { text-align: center; font-size: 12.5px; color: #3b1f1c; break-inside: avoid; }
.lv-sign-step { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.lv-sign-ink { height: 42px; display: flex; align-items: flex-end; justify-content: center; }
.lv-sign-ink:empty { height: 18px; }
.lv-sign-ink img { max-width: 100%; max-height: 40px; object-fit: contain; }
.lv-sign-line { border-top: 1px solid #3b1f1c; margin: 0 16px 4px; }
.lv-sign-name { font-weight: 700; font-size: 12.5px; }
.lv-sign-role { margin-top: 2px; color: #6b4a44; font-size: 11.5px; }
.lv-sign-note { margin-top: 3px; color: #8a5a50; font-size: 11px; line-height: 1.35; }
.lv-slip .doc-foot { margin-top: 14px; }
.pf-sign-form { margin-top: 8px; }
.pf-sign-pad {
  width: min(100%, 640px); height: 160px; display: block;
  border: 1px dashed #d2b9aa; border-radius: 14px; background: #fff;
  touch-action: none; cursor: crosshair;
}
.pf-sign-current {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px;
}
.pf-sign-current img { display: block; max-width: 280px; max-height: 90px; object-fit: contain; }
@media (max-width: 1200px) {
  .lv-stats { grid-template-columns: 1fr 1fr; }
  .lv-card.is-wide { grid-column: span 1; }
  .lv-split, .lv-flow, .lv-step-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .lv-hero { align-items: stretch; padding: 16px; }
  .lv-hero h2 { font-size: 24px; }
  .lv-num { font-size: 32px; }
  .lv-hero-actions .btn { flex: 1; }
  .lv-day { min-height: 52px; border-radius: 12px; }
  .lv-day small { font-size: 9px; }
  .lv-inbox .lv-decide { flex-wrap: wrap; }
  .lv-inbox .lv-decide input[type="text"],
  .lv-inbox .lv-decide select { flex: 1 1 100%; }
}

/* Staff roster */
.rs-wrap { display: grid; gap: 12px; }
.rs-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.rs-nav {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px;
}
.rs-nav b { min-width: 210px; text-align: center; font-size: 15px; padding: 0 8px; }
.rs-nav a {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: #fff7f2; color: var(--ink); font-size: 22px; line-height: 1;
}
.rs-nav a:hover { background: #ffe4d4; }
.rs-toolbar select {
  width: 180px; min-width: 0; height: 42px; padding: 6px 12px; border-radius: 999px;
}
.rs-tabs { margin: 0 0 12px; }
.rs-tabs a { text-decoration: none; }
.rs-tools {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0; background: transparent; border: 0;
}
.rs-tools-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
}
.rs-entry { display: block; }
.rs-entry [hidden] { display: none !important; }
.rs-entry .f { min-width: 0; }
.rs-form { display: grid; gap: 14px; }
.rs-form-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rs-form-label small { color: var(--muted); font-size: 13px; font-weight: 600; }
.rs-form-line { display: grid; grid-template-columns: 1.3fr .9fr .9fr; gap: 12px; align-items: end; }
.rs-form-when { grid-template-columns: 210px 210px minmax(0, 1fr); }
.rs-form-actions { display: flex; justify-content: flex-end; align-items: end; gap: 8px; min-height: 46px; }
.rs-entry .rs-clock { width: 100%; }
.rs-entry .rs-clock select {
  flex: 1 1 0; width: auto; min-width: 0; max-width: none;
  height: 46px; padding: 8px 8px;
}
.rs-people-list {
  max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: 14px; background: #fffdf9;
}
.rs-pick-dept + .rs-pick-dept { border-top: 1px solid #f6e4d4; }
.rs-pick, .rs-pick-all {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 9px 14px; border: 0; border-radius: 0;
  background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer;
}
.rs-pick { padding-left: 36px; font-weight: 500; }
.rs-pick-all { background: #fff7f2; }
.rs-pick input, .rs-pick-all input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: #b33a36; }
.rs-pick.is-on { background: #fff1ea; }
.rs-people-field small, .rs-entry .f > small { color: var(--muted); font-size: 13px; font-weight: 600; }
.rs-form-actions { display: flex; justify-content: flex-end; align-items: end; gap: 8px; min-height: 46px; }
.rs-repeat { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-repeat span { font-weight: 700; font-size: 14px; white-space: nowrap; }
.rs-repeat select {
  width: auto; min-width: 118px; height: 36px; padding: 0 28px 0 12px;
  border-radius: 999px; font-size: 14px; font-weight: 700;
}
.rs-repeat .thai-date { width: auto; flex: 0 0 auto; }
.rs-repeat .thai-date-btn {
  width: auto; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.rs-date { position: relative; display: inline-flex; }
.rs-date-btn {
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fffdf9; color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.rs-date input[type="date"] {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.rs-me {
  font-style: normal; font-size: 11px; font-weight: 700; margin-left: 4px;
  background: #e06b66; color: #fff; border-radius: 99px; padding: 1px 6px; vertical-align: 1px;
}
.rs-who.is-me { background: #fff4ea; }
.rs-mine {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
  max-width: 820px;
}
.rs-mine-head { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.rs-mine-day {
  min-height: 46px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 6px; display: flex; flex-direction: column; align-items: stretch; gap: 2px;
}
.rs-mine-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.rs-mine-top b { font-size: 13px; line-height: 1; }
.rs-mine .rs-tag { flex: 0 1 auto; font-size: 10px; padding: 0 5px; }
.rs-mine-day.is-out { opacity: .38; }
.rs-mine-day.is-today { box-shadow: inset 0 0 0 2px #e06b66; }
.rs-mine-day.is-today > .rs-mine-top b { color: #e06b66; }
.rs-mine-day.is-off { background: #fff6f1; }
.rs-mini {
  display: block; max-width: 100%; border-radius: 6px; padding: 1px 5px;
  background: color-mix(in srgb, var(--c, #0f766e) 14%, #fff); color: var(--c, #0f766e);
  font-size: 11px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rs-mine-in { color: #0f766e; font-size: 10px; font-weight: 700; }
.rs-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.rs-stats span {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 14px; color: var(--ink-2);
}
.rs-stats b { font-size: 16px; }
.rs-note { margin: 0; color: var(--muted); font-size: 14px; }
.rs-palette { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rs-palette-tag {
  color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 0 2px; white-space: nowrap;
}
.rs-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 8px 12px 8px 10px; cursor: pointer; color: var(--ink); text-align: left;
}
.rs-chip.is-on {
  border-color: var(--c, #0f766e);
  background: color-mix(in srgb, var(--c, #0f766e) 14%, #fff);
}
.rs-chip i { width: 8px; height: 32px; border-radius: 99px; background: var(--c, #0f766e); }
.rs-chip b, .rs-chip small { display: block; line-height: 1.2; }
.rs-chip b { font-size: 14px; }
.rs-chip small { color: var(--muted); font-size: 12px; font-weight: 500; }
.rs-legend { display: flex; flex-wrap: wrap; gap: 12px 16px; color: var(--muted); font-size: 13px; }
.rs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rs-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c, #ccc); display: inline-block; }
.rs-legend i.rs-legend-badge {
  width: 18px; height: 18px; border-radius: 6px; background: var(--c, #0f766e); color: #fff;
  display: inline-grid; place-items: center;
}
.rs-legend i.rs-legend-badge .ico { width: 12px; height: 12px; }
.rs-legend i.is-leave { background: #dcfce7; box-shadow: inset 0 0 0 1px #86efac; }
.rs-legend i.is-off { background: repeating-linear-gradient(-45deg, #f3d0c4, #f3d0c4 3px, #fff 3px, #fff 6px); }
.rs-legend i.is-in { background: #ccfbf1; box-shadow: inset 0 0 0 1px #0f766e; }
.rs-personal-title { margin: 18px 0 10px; font-size: 22px; }
.rs-wrap.is-personal { margin-bottom: 18px; }
.rs-wrap.is-personal .rs-scroll {
  height: clamp(360px, 52vh, 560px);
  min-height: 360px;
}
body.page-roster:has(#rosterBoard) {
  height: auto; min-height: 100dvh; overflow: auto;
}
body.page-roster:has(#rosterBoard) .shell,
body.page-roster:has(#rosterBoard) .main {
  height: auto; min-height: 100dvh; overflow: visible;
}
body.page-roster:has(#rosterBoard) .main { display: flex; flex-direction: column; }
body.page-roster:has(#rosterBoard) .content {
  flex: none; height: auto; min-height: 0; overflow: visible;
  display: flex; flex-direction: column; padding-bottom: 16px;
}
body.page-roster:has(#rosterBoard) .rs-wrap {
  display: flex; flex-direction: column;
  flex: none; min-height: 0; overflow: visible;
}
body.page-roster:has(#rosterBoard) .rs-scroll {
  flex: none;
  height: clamp(360px, 52vh, 560px);
  min-height: 360px;
}
.rs-assign { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.rs-assign select {
  width: 300px; height: auto; min-height: 44px;
  padding: 8px 40px 8px 16px; line-height: 1.5; font-size: 16px;
  border-radius: 999px;
}
.rs-scroll {
  overflow-x: auto; overflow-y: hidden; max-height: none; min-height: 0; height: 100%;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.rs-board {
  --rs-scale: 64px;
  --rs-lane: 240px;
  display: grid;
  grid-template-columns: var(--rs-scale) repeat(7, minmax(0, 1fr));
  min-width: 0;
  user-select: none;
}
.rs-board [hidden] { display: none !important; }
.rs-h, .rs-who, .rs-scale, .rs-cell, .rs-dept { border-bottom: 1px solid #f6e4d4; }
.rs-h {
  position: sticky; top: 0; z-index: 5;
  background: #fffdf9; text-align: center; padding: 8px 4px;
  border-right: 1px solid #f6e4d4;
}
.rs-h b { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.rs-h strong { display: block; font-size: 20px; line-height: 1.1; }
.rs-h .rs-count { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.rs-h.is-today { background: #ffe8e2; }
.rs-h.is-today strong { color: #e06b66; }
.rs-h.is-scale { left: 0; z-index: 7; text-align: left; padding-left: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rs-dept {
  grid-column: 1 / -1; background: #fff4ec; padding: 7px 12px;
  font-size: 13px; font-weight: 700; position: sticky; left: 0; z-index: 4;
}
.rs-dept span { position: sticky; left: 12px; }
.rs-who {
  position: sticky; left: 0; z-index: 4;
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px; background: #fffdf9;
  border-right: 1px solid var(--line);
}
.rs-who b { display: block; font-size: 14px; line-height: 1.25; }
.rs-who small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.rs-avatar { width: 32px; height: 32px; font-size: 14px; flex: 0 0 auto; }
.rs-scale {
  position: sticky; left: 0; z-index: 4;
  background: #fffdf9; border-right: 1px solid #f6e4d4; align-self: start;
}
.rs-scale-body { position: relative; height: var(--rs-lane); }
.rs-scale-body span {
  position: absolute; right: 6px; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1;
}
.rs-now-pin {
  position: absolute; left: 4px; z-index: 6; transform: translateY(-50%);
  background: #e06b66; color: #fff; border-radius: 999px; padding: 2px 6px;
  font-size: 11px; line-height: 1.2; box-shadow: 0 4px 10px rgba(224,107,102,.35);
}
.rs-now-pin[hidden] { display: none !important; }
.rs-now {
  position: absolute; left: 0; right: 0; z-index: 4; height: 0;
  border-top: 2px dashed #e06b66; pointer-events: none;
}
.rs-now.is-today { border-top-style: solid; }
.rs-now[hidden] { display: none !important; }
.rs-tagslot { height: 22px; display: flex; align-items: center; padding: 0 3px; }
.rs-tag {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 999px; padding: 1px 6px; font-size: 10px; font-weight: 700;
}
.rs-tag.is-leave { background: #dcfce7; color: #166534; }
.rs-tag.is-wait { background: #ffedd5; color: #9a3412; }
.rs-tag.is-off { background: #f3d0c4; color: #8a3d36; }
.rs-cell {
  display: flex; flex-direction: column; min-width: 0;
  border-right: 1px solid #f6e4d4; background: #fff;
}
.rs-cell.is-today { background: #fff8f6; }
.rs-lane {
  position: relative; height: var(--rs-lane);
  background-color: #fff;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(100% / 12 - 1px), rgba(92,46,44,.08) calc(100% / 12 - 1px), rgba(92,46,44,.08) calc(100% / 12)),
    linear-gradient(to bottom, rgba(194,65,12,.09) 0 33.333%, rgba(29,78,216,.09) 33.333% 66.666%, rgba(91,33,182,.11) 66.666% 100%);
}
.rs-lane.is-hot { box-shadow: inset 0 0 0 2px #e06b66; }
.rs-lane.is-off::after,
.rs-lane.is-blocked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
}
.rs-lane.is-off::after {
  background: repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(138,61,54,.08) 6px, rgba(138,61,54,.08) 12px);
}
.rs-lane.is-blocked { cursor: not-allowed; }
.rs-lane.is-blocked::after { background: rgba(22,163,74,.14); }
body.is-roster-edit .rs-lane { cursor: default; }
.rs-shift {
  position: absolute; z-index: 1;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c, #0f766e) 16%, #fff);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--c, #0f766e), inset 0 0 0 1px color-mix(in srgb, var(--c, #0f766e) 34%, #fff);
  overflow: hidden;
}
body.is-roster-edit .rs-shift { cursor: pointer; }
.rs-shift.is-on {
  z-index: 2;
  box-shadow: inset 3px 0 0 var(--c, #0f766e), inset 0 0 0 2px var(--c, #0f766e);
}
.rs-shift.is-dim { opacity: .35; }
.rs-shift-face {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  height: 100%; padding: 4px 3px 4px 7px; min-width: 0; pointer-events: none;
}
.rs-shift-who {
  display: flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0;
}
.rs-shift-ico {
  width: 16px; height: 16px; border-radius: 5px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--c, #0f766e); color: #fff;
}
.rs-shift-ico .ico { width: 11px; height: 11px; }
.rs-shift-who b, .rs-shift-face small {
  display: block; line-height: 1.2; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.rs-shift-who b { font-size: 11px; font-weight: 700; color: var(--ink); min-width: 0; }
.rs-shift-face small { font-size: 11px; font-weight: 700; color: var(--ink-2, var(--ink)); }
.rs-handle { position: absolute; left: 6px; right: 22px; height: 8px; z-index: 2; cursor: ns-resize; }
.rs-handle-n { top: 0; }
.rs-handle-s { bottom: 0; }
.rs-x {
  position: absolute; top: 2px; right: 2px; z-index: 3;
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.88); color: #7f1d1d; font-size: 12px; line-height: 16px;
  padding: 0; cursor: pointer; opacity: 0;
}
.rs-shift:hover .rs-x, .rs-shift:focus-within .rs-x { opacity: 1; }
.rs-actual {
  font-size: 11px; font-weight: 700; color: #0f766e;
  padding: 2px 4px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rs-ghost {
  position: fixed; z-index: 45; pointer-events: none;
  border-radius: 8px; background: color-mix(in srgb, var(--c, #0f766e) 16%, #fff); color: var(--ink);
  padding: 4px 6px; overflow: hidden;
  box-shadow: inset 3px 0 0 var(--c, #0f766e), 0 8px 18px rgba(90,40,30,.16);
}
.rs-ghost[hidden] { display: none !important; }
.rs-ghost b, .rs-ghost small { display: block; line-height: 1.2; }
.rs-ghost b { font-size: 11px; color: var(--c, #0f766e); }
.rs-ghost small { font-size: 11px; font-weight: 700; color: var(--ink); }
body.rs-dragging { cursor: grabbing; }
.rs-pop {
  position: fixed; z-index: 50; width: min(300px, calc(100vw - 16px));
  background: #fffdf9; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px;
}
.rs-pop[hidden] { display: none !important; }
.rs-pop-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-pop-h b { font-size: 16px; }
.rs-pop label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.rs-pop input[type="text"], .rs-pop > label > select {
  width: 100%; height: 40px; padding: 6px 10px; border-radius: 12px;
}
.rs-clock { display: flex; align-items: center; gap: 4px; }
.rs-clock select {
  flex: 1; min-width: 0; height: 40px; padding: 6px 4px; border-radius: 12px;
  text-align: center; font-variant-numeric: tabular-nums; font-weight: 700;
}
.rs-clock > span { color: var(--ink); font-weight: 800; }
.rs-pop-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-pop-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rs-pop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.rs-add {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 4px; height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer;
}
.rs-add:hover { background: #fff4ea; }
@media (max-width: 860px) {
  .rs-nav b { min-width: 0; font-size: 13px; }
  .rs-stats { margin-left: 0; }
  .rs-toolbar select, .rs-assign select { width: 100%; }
  .rs-board { --rs-scale: 52px; }
  .rs-mine { max-width: none; gap: 3px; }
  .rs-mine-day { min-height: 40px; padding: 3px 4px; border-radius: 8px; }
  .rs-mini { font-size: 10px; }
  body.page-roster:has(#rosterBoard),
  body.page-roster:has(#rosterBoard) .shell,
  body.page-roster:has(#rosterBoard) .main {
    height: auto; min-height: 100dvh; overflow: visible;
  }
  body.page-roster:has(#rosterBoard) .content {
    flex: none; height: auto; min-height: 0; overflow: visible;
    padding-bottom: calc(118px + var(--safe-b));
  }
  body.page-roster:has(#rosterBoard) .rs-wrap,
  body.page-roster:has(#rosterBoard) .rs-scroll,
  .rs-wrap.is-personal .rs-scroll {
    overflow: visible; height: auto; min-height: 0; flex: none;
  }
  body.page-roster:has(#rosterBoard) .rs-scroll {
    border: 0; background: transparent; border-radius: 0;
  }
  .rs-nav { flex: 1 1 100%; }
  .rs-nav b { flex: 1; }
  .rs-legend { gap: 8px 12px; }
  .rs-people-list { max-height: 200px; }
  .rs-form-line, .rs-form-when { grid-template-columns: 1fr; }
  .rs-form-actions { justify-content: stretch; }
  .rs-form-actions .btn { flex: 1; }
  .rs-board {
    display: flex; flex-direction: column; gap: 0;
    width: 100% !important; min-width: 0 !important;
    background: transparent;
  }
  .rs-board > .rs-h.is-scale,
  .rs-board > .rs-scale,
  .rs-now,
  .rs-now-pin,
  .rs-handle,
  .rs-x { display: none !important; }
  .rs-board > .rs-h:nth-child(2) { order: 1; }
  .rs-board > .rs-cell:nth-child(10) { order: 2; }
  .rs-board > .rs-h:nth-child(3) { order: 3; }
  .rs-board > .rs-cell:nth-child(11) { order: 4; }
  .rs-board > .rs-h:nth-child(4) { order: 5; }
  .rs-board > .rs-cell:nth-child(12) { order: 6; }
  .rs-board > .rs-h:nth-child(5) { order: 7; }
  .rs-board > .rs-cell:nth-child(13) { order: 8; }
  .rs-board > .rs-h:nth-child(6) { order: 9; }
  .rs-board > .rs-cell:nth-child(14) { order: 10; }
  .rs-board > .rs-h:nth-child(7) { order: 11; }
  .rs-board > .rs-cell:nth-child(15) { order: 12; }
  .rs-board > .rs-h:nth-child(8) { order: 13; }
  .rs-board > .rs-cell:nth-child(16) { order: 14; }
  .rs-board > .rs-h {
    position: static; display: flex; align-items: baseline; gap: 8px;
    text-align: left; border: 0; background: transparent;
    padding: 14px 2px 6px;
  }
  .rs-board > .rs-h b,
  .rs-board > .rs-h strong,
  .rs-board > .rs-h .rs-count { display: inline; }
  .rs-board > .rs-h strong { font-size: 22px; }
  .rs-board > .rs-h .rs-count { margin-left: auto; font-size: 14px; }
  .rs-board > .rs-h.is-today {
    background: #ffe8e2; border-radius: 12px; padding-left: 10px; padding-right: 10px;
  }
  .rs-add {
    display: inline-flex; align-items: center; height: 28px; margin-top: 0; padding: 0 10px;
    border: 0; border-radius: 999px; background: #fff; color: var(--ink);
    font-size: 13px; font-weight: 700;
  }
  .rs-cell { border: 0; background: transparent; }
  .rs-cell.is-today { background: transparent; }
  .rs-lane {
    height: auto !important; min-height: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 0 0 4px; background: transparent; background-image: none;
  }
  .rs-lane:not(:has(.rs-shift:not([hidden]))) { display: none; }
  .rs-shift {
    position: relative !important; top: auto !important; left: auto !important;
    width: 100% !important; height: auto !important; right: auto !important;
    border-radius: 14px;
  }
  .rs-shift-face {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
    align-items: center; height: auto; padding: 12px 14px;
  }
  .rs-shift-who { grid-column: 1; grid-row: 1 / span 2; gap: 8px; }
  .rs-shift-ico { width: 28px; height: 28px; border-radius: 8px; }
  .rs-shift-ico .ico { width: 16px; height: 16px; }
  .rs-shift-who b { font-size: 16px; }
  .rs-in, .rs-out { grid-column: 2; font-size: 15px; text-align: right; }
  .rs-in { grid-row: 1; }
  .rs-out { grid-row: 2; }
}

/* Employee dashboard */
.me-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, .7fr);
  gap: 22px;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  color: #fff9f2;
  border-radius: 28px;
  padding: 28px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 250, 143, .28), transparent 34%),
    linear-gradient(145deg, #7a2422 0%, #b33a36 46%, #e08a4a 100%);
  box-shadow: 0 22px 50px rgba(140, 40, 36, .22);
}
.me-card::before,
.me-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}
.me-card::before { width: 280px; height: 280px; right: -90px; top: -110px; }
.me-card::after { width: 180px; height: 180px; left: -60px; bottom: -80px; }
.me-id, .me-pay { position: relative; z-index: 1; }
.me-id { display: flex; gap: 18px; align-items: center; min-width: 0; }
.me-avatar {
  width: 88px; height: 88px; border-radius: 28px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #F5FA8F, #FACA8F);
  color: #5c2e2c;
  font-family: var(--display);
  font-size: 38px; font-weight: 700;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .16);
}
.me-kicker {
  margin: 0;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  color: #f8c8c0;
}
.me-card h2 {
  margin: 4px 0 8px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
}
.me-code {
  display: inline-block;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: 2px 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.me-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.me-chip {
  background: rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
}
.me-chip span { display: block; color: #f8c8c0; font-size: 11px; font-weight: 600; }
.me-pay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 249, 242, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 22px;
  padding: 18px;
}
.me-pay small { color: #f8c8c0; font-size: 13px; }
.me-pay b {
  display: block;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.me-pay span { color: #fde8c8; font-size: 14px; }
.me-pay .btn { margin-top: 14px; align-self: flex-start; }
.me-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.me-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.me-month b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.me-month span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.me-slip { margin-bottom: 16px; }
.me-slip .me-money { padding: 16px 18px 8px; }
.me-money { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.me-money article {
  background: #fffaf5;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
}
.me-money .lbl { color: var(--muted); font-size: 13px; font-weight: 700; }
.me-money strong {
  display: block;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.me-money p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.me-money .is-deduct strong { color: #b33a36; }
.me-money .is-ot strong { color: #166534; }
.me-money .is-net { background: linear-gradient(160deg, #fff6ee, #fffdf9); }
.me-days { display: flex; flex-direction: column; }
.me-day {
  display: grid;
  grid-template-columns: 168px minmax(180px, 1fr) 120px minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f5e0c8;
}
.me-day:last-child { border-bottom: 0; }
.me-day b { display: block; font-size: 16px; line-height: 1.25; }
.me-day small { color: var(--muted); font-size: 13px; }
.me-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.me-times div {
  background: #fff6ee;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
}
.me-times span, .me-times small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.me-times b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.me-times small { font-weight: 600; }
.me-hours { font-weight: 700; }
.me-day .atr-late { text-align: right; }
@media (max-width: 1080px) {
  .me-card, .me-money, .me-stats { grid-template-columns: 1fr 1fr; }
  .me-pay { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .me-card, .me-money, .me-stats { grid-template-columns: 1fr; }
  .me-id { align-items: flex-start; }
  .me-card h2 { font-size: 26px; }
  .me-pay b { font-size: 34px; }
  .me-day { grid-template-columns: 1fr; gap: 8px; }
  .me-day .atr-late, .me-hours { text-align: left; }
}
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: stretch; }
.pay-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(160, 70, 60, .05);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.pay-box:hover {
  transform: translateY(-2px);
  border-color: #e7b08a;
  box-shadow: 0 16px 32px rgba(160, 70, 60, .1);
}
.pay-box-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pay-ava {
  width: 46px; height: 46px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #F5FA8F, #FACA8F);
  color: #5c2e2c;
  font-family: var(--display);
  font-size: 22px; font-weight: 700;
}
.pay-box-who div { min-width: 0; }
.pay-box-who b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.pay-box-who small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.pay-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-tags span {
  background: #fff6ee;
  border: 1px solid #f3dcc4;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.pay-tags .is-late { color: #b33a36; background: #fff1f2; border-color: #fecdd3; }
.pay-box-foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.pay-box-net {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(160deg, #fff6ee, #fffdf9);
  border: 1px solid #f3dcc4;
  border-radius: 16px;
  padding: 10px 12px;
}
.pay-box-net span { color: var(--muted); font-size: 12px; font-weight: 700; }
.pay-box-net strong {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pay-box-net strong.is-empty { color: var(--muted); font-size: 20px; font-weight: 600; }
.pay-figs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.pay-figs div { min-width: 0; padding: 0 10px 0 0; }
.pay-figs div + div { border-left: 1px solid #f3dcc4; padding-left: 10px; }
.pay-figs span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.pay-figs b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.pay-figs b.is-empty, .pay-figs b.is-zero { color: var(--muted); font-weight: 600; }
.pay-figs b.is-empty { font-size: 14px; }
.pay-figs .is-deduct b { color: #b33a36; }
.pay-figs .is-ot b { color: #166534; }
.pay-totals { margin-bottom: 16px; }
.pay-totals .dk-lbl { letter-spacing: 0; text-transform: none; font-size: 13px; }
.pay-totals .dk-val { font-size: 28px; font-variant-numeric: tabular-nums; }
.pay-totals .dk-sub { font-size: 13px; }
.pay-totals .is-deduct { color: #b33a36; }
.pay-totals .is-ot { color: #166534; }
.pay-foot td { font-weight: 700; }
#createModal.modal-bg,
#useModal.modal-bg,
#addModal.modal-bg,
#editModal.modal-bg { z-index: 80; }
.stk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stk-stat {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 16px;
  box-shadow: 0 10px 24px rgba(160, 70, 60, .05);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.stk-stat:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(160, 70, 60, .09); }
.stk-stat.is-on {
  border-color: transparent;
  background:
    linear-gradient(#fffdf9, #fffdf9) padding-box,
    linear-gradient(135deg, #FA948F, #FACA8F) border-box;
  box-shadow: 0 14px 30px rgba(200, 100, 90, .14);
}
.stk-stat-ico {
  width: 46px; height: 46px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #fff1e8; color: #b4534a;
}
.stk-stat-ico .ico { width: 22px; height: 22px; }
.stk-stat.is-ok .stk-stat-ico { background: #ecfdf3; color: #15803d; }
.stk-stat.is-low .stk-stat-ico { background: #fff7ed; color: #c2410c; }
.stk-stat.is-out .stk-stat-ico { background: #fef2f2; color: #dc2626; }
.stk-stat-copy { min-width: 0; }
.stk-stat-copy em { display: block; font-style: normal; color: var(--muted); font-size: 13px; font-weight: 600; }
.stk-stat b { display: block; margin-top: 1px; font-family: var(--display); font-size: 30px; line-height: 1.05; font-weight: 600; }
.stk-stat.is-ok b { color: #15803d; }
.stk-stat.is-low b { color: #c2410c; }
.stk-stat.is-out b { color: #dc2626; }
.stk-tabs { margin-bottom: 14px; }
.stk-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }
.stk-panel .panel-h { flex-wrap: wrap; }
.stk-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; min-width: 0; }
.stk-cat-filter { flex: 0 1 190px; min-width: 150px; }
.stk-cat-filter select {
  height: 42px; padding: 0 32px 0 12px; border-radius: 14px;
  font-size: 15px; background-color: #fffaf5;
}
.stk-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; min-width: 220px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 14px; background: #fffaf5; color: var(--muted);
}
.stk-search .ico { width: 18px; height: 18px; }
.stk-search input {
  border: 0; background: transparent; padding: 0; height: 40px;
  width: 0; flex: 1 1 auto; min-width: 0; border-radius: 0; box-shadow: none; font-size: 15px;
}
.stk-search input:focus { outline: none; }
.stk-search:focus-within { border-color: #e7a08a; background: #fff; color: var(--ink); }
.stk-list, .stk-hlist { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: linear-gradient(180deg, #fff8f3, #fffdf9); }
.stk-card, .stk-hcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #f3d7c4;
  border-left-width: 4px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(180, 90, 70, .04);
}
.stk-card.is-ok { border-left-color: #4ade80; }
.stk-card.is-low { border-left-color: #fb923c; background: linear-gradient(90deg, #fffaf4, #fff 42%); }
.stk-card.is-out { border-left-color: #f87171; background: linear-gradient(90deg, #fff6f6, #fff 42%); }
.stk-card[hidden], .stk-empty[hidden] { display: none !important; }
.stk-no {
  width: 38px; height: 38px; border-radius: 14px;
  display: grid; place-items: center;
  background: #fff1e8; color: var(--ink-2);
  font-weight: 700; font-size: 14px;
}
.stk-main { min-width: 0; }
.stk-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.stk-title b, .stk-main b { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.stk-cat {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  background: #fff1e8; color: #9a4e46;
  font-size: 12px; font-weight: 700; line-height: 1.4;
}
.stk-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stk-meter { height: 7px; margin-top: 10px; border-radius: 99px; background: #f6e6da; overflow: hidden; }
.stk-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4ade80, #16a34a); }
.stk-card.is-low .stk-meter i { background: linear-gradient(90deg, #fdba74, #ea580c); }
.stk-card.is-out .stk-meter i { background: linear-gradient(90deg, #fca5a5, #dc2626); }
.stk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; }
.stk-qtyline { display: flex; align-items: center; gap: 12px; }
.stk-count { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.stk-count strong, .stk-hqty strong { font-family: var(--display); font-size: 30px; line-height: 1; font-weight: 600; letter-spacing: -.03em; }
.stk-count span, .stk-hqty span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stk-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.stk-actions form { margin: 0; }
.stk-quiet {
  background: #fffdf9; border: 1px solid var(--line); color: var(--ink-2);
  min-width: 0; padding: 8px 12px; box-shadow: none;
}
.stk-quiet:hover { background: #fff1e8; color: var(--ink); }
.stk-quiet-danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.stk-quiet-danger:hover { background: #fef2f2; color: #b91c1c; }
.stk-hcard { border-left-color: #f0a39a; }
.stk-hqty { display: flex; align-items: baseline; gap: 5px; color: #b4534a; }
.stk-hqty strong { color: #b4534a; }
.stk-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.stk-empty .ico { width: 36px; height: 36px; color: var(--gold); margin-bottom: 8px; }
.stk-empty b { display: block; color: var(--ink); font-size: 18px; }
.stk-empty p { margin: 4px 0 0; }
.stk-filters {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(120px, 1fr) 150px 150px auto;
  gap: 10px;
  align-items: end;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
}
.stk-filter-btn { height: 46px; }
.stk-modal { border: 1px solid var(--line); box-shadow: var(--shadow); }
.stk-modal .form-grid { margin-top: 8px; }
.stk-modal-sub { margin: 0; color: var(--muted); font-size: 14px; }
.stk-modal-warn { margin: 0; color: #b91c1c; font-size: 14px; }
.stk-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 980px) {
  .stk-card, .stk-hcard { grid-template-columns: auto minmax(0, 1fr); }
  .stk-side, .stk-hqty {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f6e4d2;
  }
  .stk-actions { flex: 1 1 220px; justify-content: flex-end; }
}
@media (max-width: 860px) {
  .stk-stats { grid-template-columns: 1fr 1fr; }
  .stk-filters { grid-template-columns: 1fr 1fr; }
  .stk-filter-btn { grid-column: 1 / -1; }
  .stk-panel .panel-h { align-items: stretch; }
  .stk-tools {
    flex: 1 1 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .stk-search, .stk-cat-filter { min-width: 0; width: 100%; flex: none; }
  .stk-tools .btn { width: 100%; }
  .stk-side { flex-direction: column; align-items: stretch; }
  .stk-qtyline, .stk-actions { justify-content: flex-start; }
}
.log-who small, .log-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.log-detail { max-width: 460px; white-space: normal; line-height: 1.45; }
.log-pages { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 22px 18px; }
.log-ok { --b: #166534; }
.log-fail { --b: #dc2626; }
.log-muted { --b: #78716c; }

/* Work orders */
.wo-page { display: flex; flex-direction: column; gap: 14px; }
.wo-wait-note { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.wo-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.wo-board:empty { display: none; }
.wo-modal { width: min(680px, 100%); }
.wo-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
#woModal { z-index: 80; }
.wo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr);
  gap: 18px;
  align-items: start;
}
.wo-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; z-index: 2; }
.wo-filter-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 16px 18px 8px;
}
.wo-filter-card .wo-pills { padding: 8px 18px 16px; }
.wo-modal .modal-head { align-items: center; }
.wo-modal .modal-head h3 { flex: 1; margin: 0; }
.wo-filter-h h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}
.wo-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wo-pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.wo-pills a b {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff1e8;
  color: #9a4e46;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.wo-pills a.is-on {
  background: linear-gradient(90deg, #FA948F, #FACA8F);
  border-color: transparent;
  color: #5c2e2c;
}
.wo-pills a.is-on b { background: rgba(255,253,249,.72); color: #5c2e2c; }
.wo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--wo, #e7c3b4);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 18px 14px;
}
.wo-card.st-open { --wo: #f59e0b; }
.wo-card.st-accepted { --wo: #60a5fa; }
.wo-card.st-in_progress { --wo: #a78bfa; }
.wo-card.st-completed { --wo: #4ade80; }
.wo-card.st-cancelled { --wo: #f87171; }
.wo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wo-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-prio, .wo-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.wo-prio.is-urgent { background: #ffe4e6; color: #be123c; }
.wo-prio.is-urgent::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.wo-prio.is-normal { background: #f3f4f6; color: #6b7280; }
.wo-card.st-open .wo-state { background: #fff7ed; color: #c2410c; }
.wo-card.st-accepted .wo-state { background: #eff6ff; color: #1d4ed8; }
.wo-card.st-in_progress .wo-state { background: #f5f3ff; color: #6d28d9; }
.wo-card.st-completed .wo-state { background: #ecfdf3; color: #166534; }
.wo-card.st-cancelled .wo-state { background: #fef2f2; color: #b91c1c; }
.wo-ticket { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.wo-card h3 { margin: 10px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.wo-meta, .wo-desc, .wo-parts { margin: 4px 0 0; }
.wo-meta, .wo-parts { color: var(--muted); font-size: 13px; font-weight: 500; }
.wo-desc { font-size: 15px; color: var(--ink); }
.wo-photo {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 10px;
}
.wo-step-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.wo-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.wo-status-form { margin: 0; }
.wo-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff6ee;
  color: #c4a098;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 4px;
  text-align: center;
  white-space: nowrap;
}
button.wo-step {
  appearance: none;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  color: #8a4a44;
  background: #fffdf9;
  box-shadow: inset 0 0 0 1.5px #e7b2a4;
}
button.wo-step:hover {
  background: linear-gradient(90deg, #FA948F, #FACA8F);
  color: #5c2e2c;
  box-shadow: none;
}
.wo-step.is-now {
  background: linear-gradient(90deg, #FA948F, #FACA8F);
  color: #5c2e2c;
  box-shadow: none;
}
.wo-step.is-done { background: #fde8df; color: #8a4a44; }
.wo-parts-in { margin-top: 10px; }
.wo-done-at { margin: 8px 0 0; color: #166534; font-size: 13px; font-weight: 700; }
.wo-assign, .wo-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.wo-side-actions { margin-bottom: 0; }
.wo-assign select { min-width: 0; padding: 8px 12px; font-size: 14px; flex: 1 1 160px; width: auto; }
.wo-btn-ghost { background: #fffdf9; border: 1px solid var(--line); color: var(--ink); }
.wo-btn-cancel { background: transparent; color: #b91c1c; padding-inline: 8px; }
.wo-finished, .wo-cancelled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
}
.wo-finished { background: #ecfdf3; color: #166534; }
.wo-finished small { color: #15803d; font-weight: 600; }
.wo-cancelled { background: #fef2f2; color: #b91c1c; }
.wo-card.st-completed { background: linear-gradient(180deg, #fffdf9 0%, #f7fdf8 100%); }
@media (max-width: 1080px) {
  .wo-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .wo-step { font-size: 13px; padding: 9px 2px; }
  .wo-assign { width: 100%; }
  .wo-assign select { flex: 1; }
}

.me-ot-head {
  padding: 4px 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.me-ot-empty { margin: 0; padding: 4px 18px 16px; color: var(--muted); font-weight: 600; }
.me-ots { display: flex; flex-direction: column; padding-bottom: 6px; }
.me-ot {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #f5e0c8;
}
.me-ot:last-child { border-bottom: 0; }
.me-ot b { font-size: 15px; }
.me-ot span { display: block; font-weight: 700; }
.me-ot small { display: block; color: var(--muted); font-size: 13px; }
.me-ot strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: #166534;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ot-rows { display: flex; flex-direction: column; }
.ot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f5e0c8;
}
.ot-row:last-child { border-bottom: 0; }
.ot-row b { display: block; font-size: 16px; }
.ot-row small { display: block; color: var(--muted); font-size: 13px; }
.ot-row-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ot-row-side strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .me-month { align-items: flex-start; flex-wrap: wrap; }
  .me-ot { grid-template-columns: 1fr auto; }
  .me-ot b { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ot-row { align-items: flex-start; }
  .ot-row-side { flex-direction: column; align-items: flex-end; }
}

.ot-layout { display: grid; grid-template-columns: minmax(320px, .92fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.ot-form { display: grid; gap: 12px; }
.ot-base {
  background: #fffaf5;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--ink);
}
.ot-warn { margin: 0; color: #9a3412; font-weight: 600; }
.ot-warn a { color: #9a3412; }
.ot-types { display: grid; gap: 8px; }
.ot-type {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: #fffdf9;
  cursor: pointer;
}
.ot-type input { width: 18px; height: 18px; margin: 0; accent-color: #b33a36; }
.ot-type b { display: block; color: var(--ink); font-size: 15px; }
.ot-type small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.ot-type strong { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ot-type.is-on { border-color: #e08a4a; background: #fff1ec; box-shadow: inset 0 0 0 1px #e08a4a; }
.ot-when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ot-when .ot-date { grid-column: 1 / -1; }
.ot-when .thai-date-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ot-chip {
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ot-chip.is-on { background: linear-gradient(90deg, #FA948F, #FACA8F); border-color: transparent; }
.ot-math {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #fff6ee, #fffdf9);
  border: 1px solid var(--line);
}
.ot-math span { color: var(--muted); font-size: 13px; font-weight: 700; }
.ot-math b {
  display: block;
  margin: 2px 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ot-math p { margin: 0; color: var(--muted); font-weight: 600; }
.ot-note { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num { font-weight: 700; }
@media (max-width: 1080px) {
  .ot-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ot-when { grid-template-columns: 1fr; }
  .ot-type { grid-template-columns: auto minmax(0, 1fr); }
  .ot-type strong { grid-column: 2; }
}
