/* PMS – base styles. Warm neutrals, deep teal as the action colour, gold accent. */
:root {
  --red: #B5432A;
  --teal: #1B5E6B;
  --teal-dark: #154a55;
  --teal-soft: #e6f0f1;
  --dark: #23373a;
  --gold: #C6A66E;
  --gold-soft: #f6eedd;
  --cream: #F2EDE3;
  --brown: #8c5a45;
  --light: #f6f3ee;
  --ok: #2d8a4e;
  --warn: #c86a05;
  --muted: #7d8488;
  --line: #e6e1d8;
  --line-strong: #d6d0c5;
  --bg: #f4f1ec;
  --card: #ffffff;
  --text: #1f2d2c;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(35, 45, 44, .05), 0 1px 1px rgba(35, 45, 44, .03);
  --shadow-lg: 0 12px 40px rgba(20, 30, 32, .18);
  --focus: 0 0 0 3px rgba(27, 94, 107, .25);
  --sidebar-w: 236px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
h1, h2, h3, h4 { color: var(--dark); margin: 0; line-height: 1.25; }
h2 { font-size: 23px; font-weight: 700; letter-spacing: -.2px; }
h3 { font-size: 17px; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { background: rgba(198, 166, 110, .35); }

.boot { display: grid; place-items: center; height: 100vh; color: var(--brown); }
.boot.error { color: var(--red); }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.topbar, .scrim { display: none; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--dark); color: var(--cream);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50;
}
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #a8854a); color: #fff; font-weight: 800; font-size: 16px;
}
.brand-mark-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 26px; }
.brand-kicker { font-size: 14px; letter-spacing: 3px; color: #fff; font-weight: 800; line-height: 1.1; }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, .5); }
.hotel-name { font-size: 15px; font-weight: 600; color: #fff; }
.hotel-select {
  width: 100%; background: rgba(255, 255, 255, .07); color: #fff; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-sm); padding: 7px 9px; font: inherit;
}
.hotel-select option { color: var(--text); }
.nav { padding: 8px 10px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255, 255, 255, .38); padding: 8px 10px 4px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 14px; transition: background .12s, color .12s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, .11); box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.active .nav-icon { color: var(--gold); }
.nav-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex-shrink: 0; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { display: block; flex-shrink: 0; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(198, 166, 110, .22); color: var(--gold); font-weight: 700; font-size: 12px;
}
.user-meta { min-width: 0; }
.user-name { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255, 255, 255, .5); font-size: 12px; }
.foot-links { display: flex; gap: 6px; margin-top: 10px; }
.foot-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; font: inherit; font-size: 12.5px;
  color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .05); border: 0; cursor: pointer; text-decoration: none;
}
.foot-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.link-btn { color: var(--teal); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(27, 94, 107, .35); text-underline-offset: 2px; }
.link-btn:hover { text-decoration-color: currentColor; }

.content { flex: 1; padding: 26px 32px 40px; min-width: 0; outline: none; max-width: 1480px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .muted { margin-top: 3px; font-size: 13.5px; }
.loading { color: var(--muted); padding: 30px 0; display: flex; align-items: center; gap: 10px; }
.loading::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards, tables */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 16px; }
.card h4 { margin-bottom: 8px; }
.card > .table:only-child, .card > .table-wrap:only-child { margin: -6px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
  padding: 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; white-space: nowrap; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: #fbfaf7; }
.row-muted td { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge-ok { background: #e3f3e8; color: #23703f; }
.badge-error { background: #fbe7e3; color: #9b3822; }
.badge-muted { background: #efede9; color: var(--muted); }

.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid transparent; border-left-width: 4px; }
.alert-error { background: #fdf0ed; color: #842d1a; border-color: #f3cdc3; border-left-color: var(--red); }
.alert-ok { background: #edf7f0; color: #1f6a3a; border-color: #c9e7d3; border-left-color: var(--ok); }
.alert-info { background: #fdf8ec; color: #6b5420; border-color: #efe0b9; border-left-color: var(--gold); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; background: var(--teal); color: #fff; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.3;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
}
.btn:hover { background: var(--teal-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: #fff; color: var(--teal); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--teal-soft); border-color: #bcd3d6; }
.btn-danger { background: var(--red); }
.btn-small { padding: 4px 10px; font-size: 13px; font-weight: 500; border-radius: 6px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; border-radius: 6px; padding: 2px 6px; }
.icon-btn:hover { color: var(--text); background: var(--light); }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: #4b5a59; margin-bottom: 5px; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=color])), :where(select), :where(textarea) {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 14.5px; background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: #c2bbae; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: var(--light); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); width: 16px; height: 16px; }
.invalid { border-color: var(--red) !important; }
.invalid:focus { box-shadow: 0 0 0 3px rgba(181, 67, 42, .2) !important; }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.field-error:empty { display: none; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-narrow { max-width: 440px; }
.form-actions { margin-top: 8px; }

/* Login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #2f4b4f 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #3a3226 0%, transparent 55%), var(--dark);
}
.login-card { display: grid; grid-template-columns: 1fr 1.1fr; width: 100%; max-width: 720px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.login-brand { padding: 36px 32px; background: linear-gradient(160deg, var(--teal) 0%, #133f48 100%); color: rgba(255, 255, 255, .85); display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; min-height: 320px; }
.login-brand h1 { color: #fff; font-size: 30px; letter-spacing: 6px; margin-top: auto; }
.login-brand p { margin: 0; font-size: 14px; }
.login-form { padding: 36px 32px; }
.login-form h2 { font-size: 22px; }
.login-form > .muted { margin: 4px 0 22px; font-size: 14px; }
.login-form .btn { margin-top: 6px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(22, 32, 34, .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .14s ease-out; }
.modal-wide { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fcfbf9; border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { padding: 11px 16px; border-radius: var(--radius); color: #fff; background: #23703f; box-shadow: var(--shadow-lg); max-width: 400px; font-size: 14px; animation: pop .16s ease-out; }
.toast-error { background: #9b3822; }

/* Tabs, chips, swatches */
.tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 14px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--dark); }
.tab.active { color: var(--dark); font-weight: 600; border-bottom-color: var(--teal); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; background: var(--light); border: 1px solid var(--line); font-size: 12px; }
.chip-add { cursor: pointer; color: var(--teal); background: #fff; border-style: dashed; font: inherit; font-size: 12px; }
.chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.chip-x:hover { color: var(--red); }
.group-row td { background: var(--light); font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; }
.room-no { font-weight: 700; font-variant-numeric: tabular-nums; width: 70px; }
.small { font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid h4 { margin: 6px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--teal); }
.hint { line-height: 1.4; }
input[type=color] { height: 38px; padding: 2px 4px; }

/* Booking allocation */
.booking-summary { padding: 12px 18px; }
.summary-title { font-size: 12px; font-weight: 600; color: var(--brown); margin-bottom: 6px; }
.bulk-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff8e6; border: 1px solid #ecd9a8; border-radius: var(--radius); padding: 8px 14px; margin-bottom: 12px;
}
.col-check { width: 32px; text-align: center; }
.badge-toggle { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.badge-toggle:hover { border-color: currentColor; }

/* Calendar */
.cal-head { align-items: flex-end; }
.cal-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cal-controls input[type=date], .cal-controls select { width: auto; padding: 4px 8px; font-size: 13px; }
.cal-card { padding: 0; overflow: hidden; }
.cal-scroll { overflow: auto; max-height: calc(100vh - 190px); position: relative; }
.cal-grid { position: relative; user-select: none; -webkit-user-select: none; }
.cal-row { display: flex; height: var(--row-h); border-bottom: 1px solid var(--line); }
.cal-label {
  position: sticky; left: 0; z-index: 3; width: var(--label-w); min-width: var(--label-w);
  background: #fff; border-right: 1px solid var(--line); padding: 0 8px;
  display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; overflow: hidden;
}
.cal-section .cal-label { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; background: #fffdf6; line-height: 1.2; }
.cal-section { background: #fffdf6; }
.cal-room { font-weight: 700; min-width: 30px; font-variant-numeric: tabular-nums; }
.cal-type { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.cal-ch { margin-left: auto; font-size: 10px; font-weight: 700; color: #fff; background: #003580; border-radius: 3px; padding: 0 4px; }
.cal-track { position: relative; flex: 1; }
.cal-bg { position: absolute; inset: 0; display: flex; pointer-events: none; }
.cal-cell { width: var(--day-w); min-width: var(--day-w); border-right: 1px solid #f0ece4; }
.cal-cell.weekend { background: #faf7f1; }
.cal-cell.today { background: #fff4d6; }
.cal-days { position: sticky; top: 0; z-index: 4; height: 44px; background: var(--cream); }
.cal-days .cal-label { background: var(--dark); color: var(--cream); font-weight: 600; z-index: 5; }
.cal-days .cal-track { display: flex; }
.cal-day {
  width: var(--day-w); min-width: var(--day-w); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; border-right: 1px solid #e6e0d4; position: relative; line-height: 1.15;
}
.cal-day.weekend { background: #e8e3da; }
.cal-day.today { background: var(--gold); color: #fff; font-weight: 700; }
.cal-wd { font-size: 10px; opacity: .75; }
.cal-dn { font-size: 13px; font-weight: 600; }
.cal-mo { position: absolute; top: 1px; left: 3px; font-size: 9px; color: var(--brown); text-transform: uppercase; }
.cal-day.today .cal-mo { color: #fff; }

.cal-bar {
  position: absolute; top: 4px; height: calc(var(--row-h) - 9px); border-radius: 5px; z-index: 2;
  color: #fff; font-size: 12px; display: flex; align-items: center; overflow: hidden; cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); touch-action: none; border-bottom: 3px solid transparent;
}
.cal-bar:focus-visible { outline: 2px solid var(--dark); outline-offset: 1px; }
.cal-bar.locked { cursor: pointer; }
.cal-bar.dragging { opacity: .35; }
.cal-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar-txt { flex: 1; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.cal-b { display: inline-block; background: #003580; color: #fff; font-size: 10px; border-radius: 3px; padding: 0 3px; margin-right: 4px; }
.cal-multi { opacity: .8; }
.cal-h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.cal-h-l { left: 0; }
.cal-h-r { right: 0; }
.cal-h:hover { background: rgba(255, 255, 255, .35); }
.st-confirmed { background: var(--teal); }
.st-checked_in { background: var(--ok); }
.st-checked_out { background: #a59a8c; }
.st-incomplete { background: var(--gold); }
.src-booking { box-shadow: inset 3px 0 0 #003580, 0 1px 2px rgba(0, 0, 0, .2); }
.cal-ghost {
  position: absolute; top: 3px; height: calc(var(--row-h) - 7px); border: 2px dashed var(--teal); border-radius: 5px;
  background: rgba(27, 94, 107, .12); z-index: 6; font-size: 11px; color: var(--dark); display: flex; align-items: center;
  padding: 0 6px; white-space: nowrap; pointer-events: none;
}
.cal-ghost.bad { border-color: var(--red); background: rgba(181, 67, 42, .15); color: var(--red); }
body.cal-dragging, body.cal-dragging * { cursor: grabbing !important; }
.cal-marker {
  position: absolute; top: 5px; height: calc(var(--row-h) - 11px); border: 1px dashed var(--brown); border-radius: 5px;
  background: #fff8e6; color: var(--brown); font: inherit; font-size: 11px; padding: 0 6px; cursor: pointer; z-index: 2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--brown); margin-top: -4px; }
.cal-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.warn-list { margin: 0; padding-left: 18px; }
.warn-list li { margin-bottom: 8px; }
.dl { margin: 0 0 12px; }
.dl-row { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid #f2eee6; }
.dl dt { width: 110px; flex-shrink: 0; color: var(--brown); font-size: 13px; }
.dl dd { margin: 0; }
.table-compact td { padding: 5px 6px; }

/* Dashboard */
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin: 6px 0 10px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-tile {
  display: block; position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 16px 18px 15px; color: inherit; text-decoration: none; overflow: hidden; transition: box-shadow .15s, transform .15s;
}
.stat-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
a.stat-tile:hover { box-shadow: 0 6px 18px rgba(30, 40, 42, .09); transform: translateY(-1px); }
.stat-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--dark); line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-warn { margin-top: 6px; font-size: 12px; font-weight: 600; color: #8a5a00; }

/* Arrivals */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #e9e4db; }
.seg-btn { background: none; border: 0; padding: 5px 11px; font: inherit; font-size: 13px; color: #4b5a59; cursor: pointer; border-radius: 6px; white-space: nowrap; transition: background .12s, color .12s; }
.seg-btn:hover { color: var(--dark); background: rgba(255, 255, 255, .5); }
.seg-btn.active { background: #fff; color: var(--dark); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.arr-total { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 18px; }
.arr-day { padding: 12px 18px; }
.arr-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.arr-day-head h3 { font-size: 16px; }
.arr-when { margin-left: 8px; font-size: 12px; background: var(--gold); color: #fff; border-radius: 10px; padding: 1px 8px; vertical-align: 2px; }
.arr-day table { table-layout: fixed; }
.arr-day th:nth-child(1) { width: 17%; }
.arr-day th:nth-child(2) { width: 25%; }
.arr-day th:nth-child(3) { width: 26%; }
.arr-day th:nth-child(4), .arr-day th:nth-child(5) { width: 9%; }
.arr-day td { overflow: hidden; text-overflow: ellipsis; }
.badge-warn { background: #fff1d6; color: #8a5a00; }
.row-warn td { background: #fffaf0; }

@media print {
  .sidebar, .topbar, .scrim, .no-print, #toasts { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  body, html { background: #fff; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 760px) {
  .row2 { grid-template-columns: 1fr; }
  .cal-scroll { max-height: none; }
  .cal-type, .cal-section .cal-label .small { display: none; }
  .cal-label { padding: 0 6px; }
  .layout { flex-direction: column; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; height: 52px; padding: 0 10px;
    background: var(--dark); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  }
  .menu-btn { background: none; border: 0; color: #fff; padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
  .menu-btn:hover { background: rgba(255, 255, 255, .1); }
  .topbar-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; }
  .topbar-hotel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .brand-mark { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(84vw, 280px); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 22, 24, .45); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .content { padding: 16px 14px 32px; }
  .page-head { margin-bottom: 14px; }
  h2 { font-size: 20px; }
  .table { font-size: 13px; }
  .card { padding: 14px; }
  .login-card { grid-template-columns: 1fr; max-width: 420px; }
  .login-brand { min-height: 0; padding: 24px; flex-direction: row; align-items: center; gap: 14px; }
  .login-brand h1 { margin: 0; font-size: 24px; }
  .login-brand p { display: none; }
  .login-form { padding: 24px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 26px; }
  .modal-overlay { padding: 0; place-items: end stretch; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-foot { border-radius: 0; }
}

/* Reservation form & list */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.res-form h4 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.status-line { display: flex; gap: 10px; align-items: center; min-height: 38px; }
.stays { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.stay-row { display: grid; grid-template-columns: 1.1fr 1.6fr 70px 70px 28px; gap: 8px; align-items: start; }
.stay-row .field { margin-bottom: 0; }
.stay-head { font-size: 12px; font-weight: 600; color: var(--brown); }
.stays > .btn { align-self: flex-start; }
.modal-foot { align-items: center; }
.foot-left { margin-right: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #237040; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #963722; }
.btn-danger-ghost { background: transparent; color: var(--red); border: 1px solid #f1c3b8; }
.btn-danger-ghost:hover { background: #fbe7e3; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters select { width: auto; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: var(--teal-soft); }
.table-click tbody tr:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 8px 0 16px; }
textarea { resize: vertical; }
@media (max-width: 760px) {
  .row3 { grid-template-columns: 1fr; }
  .stay-row { grid-template-columns: 1fr 1fr 56px 56px 24px; }
  .foot-left { width: 100%; }
}

/* Imports & review */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h4 { margin: 0; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.review-item.open { border-left: 3px solid var(--warn); background: #fffdf6; }
.review-item:not(.open) { opacity: .7; }
.review-title { font-weight: 600; margin-bottom: 2px; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
a.btn { text-decoration: none; }
.text-error { color: var(--red); }
.nav-badge { margin-left: auto; background: var(--warn); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; min-width: 20px; text-align: center; }
@media (max-width: 760px) { .review-item { flex-direction: column; } .review-actions { justify-content: flex-start; } }
.alias-pick { display: inline-flex; gap: 6px; }
.alias-pick select { width: auto; padding: 4px 6px; font-size: 13px; }

/* Hotels (files) */
.hotel-card h3 { font-size: 18px; }
.hotel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.hotel-grid h4 { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--teal); }
.hotel-grid .dl dt { width: 55%; }
.plan-list { margin: 0 0 10px; padding-left: 20px; }
.plan-list li { margin-bottom: 3px; }
.plan-list.warn li { color: #8a5a00; }
code { font-size: 12px; background: var(--light); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 760px) { .hotel-grid { grid-template-columns: 1fr; } }

/* Allocation */
.alloc-list { display: flex; flex-direction: column; }
.alloc-row { display: grid; grid-template-columns: 1.4fr .8fr 1.6fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alloc-row:last-child { border-bottom: 0; }
.alloc-name { font-weight: 600; color: var(--dark); text-align: left; }
.alloc-pick { display: flex; gap: 6px; }
.alloc-pick select { padding: 5px 8px; font-size: 13px; }
.stat-attn::before { background: var(--warn); }
.stat-attn .stat-value { color: var(--warn); }
@media (max-width: 760px) { .alloc-row { grid-template-columns: 1fr; } }

/* Guests / ESTI */
.guest-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.guest-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.guest-actions { display: flex; gap: 4px; align-items: center; }
.search-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.search-hit { text-align: left; background: var(--light); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer; }
.search-hit:hover { border-color: var(--teal); }
details summary { cursor: pointer; color: var(--teal); margin: 6px 0; }
.nav-badge-red { background: var(--red); }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
@media (max-width: 760px) { .row4 { grid-template-columns: 1fr 1fr; } }
.cal-service .cal-track { background: repeating-linear-gradient(135deg, #f3f3f3 0 6px, #e9e9e9 6px 12px); }
.cal-service .cal-label { color: var(--muted); background: #f7f7f7; }
.audit-changes { max-width: 420px; word-break: break-word; }

/* Reports */
.rep-bar { display: inline-block; width: 120px; height: 10px; background: var(--light); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.rep-bar-fill { display: block; height: 100%; background: var(--teal); border-radius: 5px; }
.rep-table td.num, .rep-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-table tr.row-weekend td { background: #faf7f2; }
.rep-table tr.row-today td { font-weight: 600; }
.rep-tile .stat-value { font-size: 26px; }
.rep-export { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 24px; }
.rep-sub { margin: 18px 0 8px; font-size: 15px; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.card:has(> .table) { padding-top: 10px; padding-bottom: 10px; }
.cal-card { padding: 0 !important; }
.stay-head { color: #4b5a59; }
@media (max-width: 760px) {
  .cal-ch { display: none; }
  .stat-title { font-size: 11px; letter-spacing: .2px; }
}
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.stat-value { white-space: nowrap; }
@media (max-width: 760px) {
  .card { overflow-x: auto; }
  .rep-tile .stat-value { font-size: 21px; }
  .rep-bar { width: 60px; }
  .cal-controls { width: 100%; }
}
@media (max-width: 760px) { .login-brand { justify-content: flex-start; } }
.season-tag { margin-top: 8px; font-size: 12px; color: #bfe0ff; background: rgba(150, 200, 255, .12); border-radius: 6px; padding: 3px 8px; display: inline-block; }
.season-banner { border-left-color: #4a90c2; background: #eef5fb; border-color: #cfe2f1; color: #234a66; }
.filters .filter-date { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.filters .filter-date input { width: auto; padding: 6px 8px; font-size: 13px; }
.filters-spacer { flex: 1; }
.filters .btn { align-self: center; }
.undo-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 6px; }
.guests-count { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.guests-new { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); margin-bottom: 8px; }
.guests-new p { margin: 0; flex: 1; min-width: 220px; }
