:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --ink: #10262f;
  --muted: #667f8c;
  --line: #dfe8ed;
  --brand: #0d7f7a;
  --brand-d: #0a635f;
  --accent: #f59e0b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 38, 47, 0.08), 0 8px 24px -12px rgba(16, 38, 47, 0.16);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

b { font-weight: 700; }

small { font-size: 11.5px; color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.ta-right { text-align: right; }
.hid { display: none !important; }
.w-90 { width: 82px; }
.w-130 { width: 120px; }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 236px;
  width: 236px;
  background: linear-gradient(180deg, #0d2f37 0%, #0a3d3b 100%);
  color: #cfe3e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, #14b8a6, #0d7f7a);
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(20, 184, 166, 0.9);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { color: #fff; font-size: 15px; letter-spacing: 0.06em; }
.brand-txt span { font-size: 11px; color: #7fb3ac; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #a9cfca; text-decoration: none; font-size: 13.5px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav-item i, .nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #e6f4f2; }
.nav-item.active { background: rgba(20, 184, 166, 0.18); color: #fff; box-shadow: inset 2px 0 0 #14b8a6; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 10.5px; color: #5c8a85; line-height: 1.5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tb-left h1 { font-size: 19px; }
.tb-left p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.datenav { display: flex; align-items: center; gap: 6px; background: #f4f8fa; border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.date-input { width: 140px; border: none; background: transparent; padding: 6px 4px; }

.view { padding: 18px 22px 48px; flex: 1; }

/* ---------------------------------------------------------------- atoms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -10px rgba(13, 127, 122, 0.9); }
.btn-primary:hover { background: var(--brand-d); }
.btn-accent { background: var(--accent); color: #3b2606; }
.btn-accent:hover { background: #e08c07; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f4f8fa; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-warn { background: #b45309; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1; color: var(--ink); }
.icon-btn:hover { background: #f4f8fa; }

.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.input:focus { outline: 2px solid rgba(13, 127, 122, 0.2); border-color: var(--brand); }
.input-sm { padding: 6px 9px; font-size: 12.5px; border-radius: 8px; }
textarea.input { resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8fa3ae 50%), linear-gradient(135deg, #8fa3ae 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.st-pending { background: #fef3c7; color: #92400e; }
.st-confirmed { background: #d7f4f1; color: #0a6a66; }
.st-rescheduled { background: #ede9fe; color: #5b21b6; }
.st-cancelled { background: #eef2f5; color: #64748b; }
.st-noshow { background: #fee2e2; color: #b91c1c; }
.st-done { background: #dcfce7; color: #15803d; }
.vs-arrived { background: #d7f4f1; color: #0a6a66; }
.vs-waiting { background: #fef3c7; color: #92400e; }
.vs-consult { background: #dbeafe; color: #1e40af; }
.vs-treatment { background: #ede9fe; color: #5b21b6; }
.vs-done { background: #e2e8f0; color: #475569; }

.tag { display: inline-block; background: #eef3f6; color: #476672; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 600; }

.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-mini { font-size: 11.5px; color: #a8bcc5; text-align: center; padding: 14px 0; margin: 0; }
.error-box { background: #fff; border: 1px solid #fecaca; border-left: 4px solid #dc2626; border-radius: 12px; padding: 16px 18px; color: #7f1d1d; }
.error-box p { margin: 6px 0 10px; }
.section-title { font-size: 14px; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.count-pill { background: #e2ecef; color: #3f5c68; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; }

/* ---------------------------------------------------------------- schedule */
.sched-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: #e3ebef; border-radius: 11px; padding: 3px; }
.seg button { border: none; background: transparent; padding: 7px 15px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 38, 47, 0.14); }
.legend { display: flex; gap: 13px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .lg i { width: 9px; height: 9px; border-radius: 3px; }

.sched-scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 230px); box-shadow: var(--shadow); }
.sched-inner { display: grid; position: relative; }
.gutter-head { position: sticky; top: 0; left: 0; z-index: 7; background: #fff; border-bottom: 1px solid var(--line); }
.room-head { position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--line); border-left: 1px solid #f0f5f7; padding: 7px 8px; }
.rh-name { font-size: 12px; font-weight: 700; line-height: 1.25; min-height: 30px; display: flex; align-items: center; }
.rh-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 10.5px; color: var(--muted); }
.zone-tag { padding: 1px 5px; border-radius: 5px; background: #eef3f6; font-weight: 600; }
.z-doctor { background: #e0f2fe; color: #075985; }
.z-floor1 { background: #dcfce7; color: #166534; }
.z-floor2 { background: #fae8ff; color: #86198f; }
.rh-count { font-weight: 800; color: var(--brand); }

.gutter-body { position: sticky; left: 0; z-index: 5; background: #fbfdfe; border-right: 1px solid var(--line); }
.hour-label { position: absolute; right: 7px; transform: translateY(-7px); font-size: 10.5px; color: #93a8b2; font-variant-numeric: tabular-nums; }
.room-body { position: relative; border-left: 1px solid #f0f5f7; }
.slot { position: absolute; left: 0; right: 0; border-bottom: 1px solid #f2f7f9; }
.slot.alt { background: #fbfdfe; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #e11d48; z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e11d48; }

.bk {
  position: absolute; left: 4px; right: 4px; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid rgba(16, 38, 47, 0.08); border-left: 3px solid currentColor;
  border-radius: 8px; padding: 4px 6px; text-align: left; cursor: pointer;
  font: inherit; font-size: 11px; line-height: 1.25;
  box-shadow: 0 1px 2px rgba(16, 38, 47, 0.07);
  transition: transform 0.1s, box-shadow 0.15s;
}
.bk:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(16, 38, 47, 0.5); z-index: 3; }
.bk-time { font-weight: 800; font-size: 10.5px; opacity: 0.85; }
.bk-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-svc, .bk-perf { font-size: 10px; opacity: 0.78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk.st-cancelled { text-decoration: line-through; opacity: 0.75; }

.unassigned { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.unassigned h4 { font-size: 12.5px; margin-bottom: 8px; color: #92400e; }
.unassigned.outside h4 { color: #1e40af; }
.ua-list { display: flex; gap: 8px; flex-wrap: wrap; }
.ua-item { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ua-item:hover { background: #f4f8fa; }

.week-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.week-col { flex: 1 0 168px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 200px; }
.week-col.today { border-color: #b6e3de; background: #f6fefc; }
.week-col.sel { box-shadow: 0 0 0 2px rgba(13, 127, 122, 0.22); }
.week-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.wh-day { font-size: 12.5px; font-weight: 800; }
.wh-count { font-size: 10.5px; color: var(--muted); background: #eef3f6; border-radius: 999px; padding: 1px 7px; }
.mini-add { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; color: var(--brand); line-height: 1; }
.mini-add:hover { background: #e8f5f3; }
.week-list { display: flex; flex-direction: column; gap: 5px; }
.wk-chip { display: flex; flex-direction: column; gap: 0; text-align: left; border: none; border-left: 3px solid currentColor; border-radius: 7px; padding: 4px 7px; font: inherit; font-size: 11.5px; cursor: pointer; }
.wk-chip:hover { filter: brightness(0.97); }
.wk-time { font-weight: 800; font-size: 10.5px; opacity: 0.85; }
.wk-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-room { font-size: 10px; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- board */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-n { font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stat-l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.warn .stat-n { color: #b45309; }
.stat.danger .stat-n { color: #dc2626; }

.board-section { margin-top: 6px; }
.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.visit-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.visit-card.late { border-color: #fca5a5; box-shadow: 0 0 0 1px #fee2e2, var(--shadow); }
.vc-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(140deg, #14b8a6, #0d7f7a); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 36px; }
.vc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vc-id b { font-size: 14px; }
.vc-id small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-rows { display: flex; flex-direction: column; gap: 4px; }
.vc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed #eef3f6; }
.vc-row:last-child { border-bottom: none; }
.vc-row .k { color: var(--muted); flex: 0 0 auto; }
.vc-row .v { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vc-row .v.strong { font-weight: 700; color: var(--brand-d); }
.countdown { font-style: normal; font-size: 11px; color: var(--muted); }
.countdown.over { color: #dc2626; font-weight: 700; }
.vc-progress { display: flex; align-items: center; gap: 8px; }
.legs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.leg { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); }
.leg i { width: 7px; height: 7px; border-radius: 50%; background: #d5e0e5; }
.leg.done i { background: #16a34a; }
.leg.active i { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22); }
.leg b { font-weight: 600; }
.leg.active b { color: #b45309; }
.leg-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wait-flag { align-self: flex-start; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; }
.wait-flag.over { background: #fee2e2; color: #b91c1c; }
.vc-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vc-actions select.input-sm { width: auto; flex: 1 0 130px; }

.na-list { display: flex; flex-direction: column; gap: 6px; }
.na-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }
.na-time { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--brand-d); flex: 0 0 52px; }
.na-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.na-main b { font-size: 13.5px; }
.na-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.left-list { display: flex; gap: 6px; flex-wrap: wrap; }
.left-chip { background: #eef3f6; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: #476672; }

/* ---------------------------------------------------------------- tables / lists */
.list-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.list-toolbar .search { flex: 1; min-width: 200px; max-width: 420px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); background: #fbfdfe; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f2f7f9; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfdfe; }

.zone-section { margin-bottom: 8px; }
.room-grid, .staff-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.room-card, .staff-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.room-card.off, .staff-card.off { opacity: 0.55; }
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rc-head b { font-size: 13.5px; display: block; }
.rc-head small { display: block; }
.live-dot { color: #16a34a; font-size: 12px; line-height: 1; }
.rc-occ { display: flex; flex-direction: column; gap: 1px; background: #f6fafb; border-radius: 9px; padding: 7px 9px; font-size: 12px; min-height: 44px; justify-content: center; }
.occ-name { font-weight: 700; }
.occ-meta { font-size: 11px; color: var(--muted); }
.rc-stat { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.bar { height: 5px; border-radius: 999px; background: #eef3f6; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #0d7f7a); border-radius: 999px; }
.rc-controls { display: flex; gap: 10px; align-items: flex-end; }
.ctl { display: flex; flex-direction: column; gap: 3px; }
.ctl label { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stepper button { width: 26px; height: 30px; border: none; background: #f4f8fa; cursor: pointer; font-size: 14px; color: var(--ink); }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-size: 13px; }
.staff-card { flex-direction: row; align-items: center; flex-wrap: wrap; }
.sc-id { flex: 1; min-width: 100px; display: flex; flex-direction: column; }
.sc-id b { font-size: 13.5px; }
.sc-load { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); }
.staff-card .bar { flex: 1 0 100%; }

/* ---------------------------------------------------------------- modal */
.overlay { position: fixed; inset: 0; background: rgba(9, 26, 32, 0.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 24px 14px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 30px 70px -20px rgba(9, 26, 32, 0.5); display: flex; flex-direction: column; max-height: calc(100vh - 48px); animation: pop 0.16s ease-out; }
.modal-wide { max-width: 780px; }
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16.5px; }
.modal-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field-span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11.5px; font-weight: 700; color: #3f5c68; }
.field b { color: #dc2626; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 6px; }
.detail-grid .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.detail-grid .v { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.detail-grid .v small { font-weight: 400; }
.note-box { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; margin: 10px 0; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.subpanel { background: #f6fafb; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.subpanel h4 { font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { background: #fbfdfe; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; font-size: 12.5px; }
.conflict-box { background: #fff7ed; border: 1px solid #fdba74; border-radius: 11px; padding: 10px 12px; font-size: 12.5px; color: #7c2d12; }
.conflict-title { font-weight: 800; margin-bottom: 4px; }
.conflict-box ul { margin: 0; padding-left: 18px; }
.conflict-box li { margin: 3px 0; }
.conflict-hint { margin: 6px 0 0; font-size: 11.5px; opacity: 0.8; }
.confirm-text { font-size: 14px; margin: 0; line-height: 1.5; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: #10262f; color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 13px; font-weight: 600; box-shadow: 0 14px 30px -12px rgba(9, 26, 32, 0.6); transition: opacity 0.3s, transform 0.3s; }
.toast-error { background: #b91c1c; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-grid, .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1440px) {
  .room-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto; flex: none; flex-direction: row;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -6px 20px -10px rgba(9, 26, 32, 0.6);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 2px; padding: 6px; width: 100%; overflow-x: auto; }
  .nav-item { flex: 1 0 auto; flex-direction: column; gap: 3px; padding: 7px 9px; font-size: 10.5px; }
  .nav-item.active { box-shadow: none; background: rgba(20, 184, 166, 0.2); }
  .main { padding-bottom: 70px; }
  .topbar { padding: 12px 14px; }
  .view { padding: 14px 14px 32px; }
  .tb-left h1 { font-size: 17px; }
  .sched-scroll { max-height: none; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .tb-right { width: 100%; justify-content: space-between; }
  .date-input { width: 116px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overlay { padding: 0; align-items: stretch; }
  .modal { max-width: none; border-radius: 0; max-height: 100vh; }
  .modal-wide { max-width: none; }
}
