/* =====================================================================
   Royal PMS — luxury hotel management UI
   Royal navy · champagne gold · ivory · soft grey.
   Logical CSS properties throughout so RTL and LTR share one sheet.
   ===================================================================== */
:root {
  --navy-950: #070E1C;
  --navy-900: #0B1529;
  --navy-800: #12203B;
  --navy-700: #1B2A4A;
  --navy-600: #2A3D63;
  --navy-100: #E6EAF2;
  --gold-600: #9C7A43;
  --gold-500: #B8955A;
  --gold-400: #CFAE74;
  --gold-200: #EADBBD;
  --gold-100: #F6EFE2;
  --ivory: #F8F6F1;
  --surface: #FFFFFF;
  --gray-50: #FAFAF8;
  --gray-100: #F1EFEA;
  --gray-200: #E5E1D8;
  --gray-300: #D3CEC2;
  --text: #18202F;
  --text-2: #444C5E;
  --muted: #7A8192;

  --st-new: #6B7A99;       --st-new-bg: #EDF0F6;
  --st-pending: #B9862E;   --st-pending-bg: #FBF2DF;
  --st-confirmed: #2C6A9A; --st-confirmed-bg: #E4EFF8;
  --st-checked_in: #2D7A58;--st-checked_in-bg: #E3F2EA;
  --st-checked_out: #7F8592;--st-checked_out-bg: #EEEFF1;
  --st-cancelled: #B0473E; --st-cancelled-bg: #F8E6E4;
  --st-no_show: #74508A;   --st-no_show-bg: #F0E8F4;
  --ok: #2D7A58; --warn: #B9862E; --danger: #B0473E;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(11, 21, 41, .05), 0 1px 1px rgba(11, 21, 41, .03);
  --shadow-2: 0 8px 28px -10px rgba(11, 21, 41, .18), 0 2px 6px rgba(11, 21, 41, .05);
  --shadow-3: 0 30px 60px -20px rgba(7, 14, 28, .45);
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --display: 'Cormorant Garamond', 'Amiri', Georgia, serif;
  --sidebar-w: 268px;
}
[dir="rtl"] { --display: 'Amiri', 'Cormorant Garamond', serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--text);
  background: var(--ivory); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--gold-600); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }

/* ------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #C9D0DE; display: flex; flex-direction: column;
  border-inline-end: 1px solid rgba(207, 174, 116, .12);
}
.sidebar::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; color: #fff; }
.brand:hover { color: #fff; }
.brand strong { display: block; font-family: var(--display); font-size: 21px; line-height: 1.15; color: #fff; font-weight: 600; }
.brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); margin-top: 2px; }
[dir="rtl"] .brand small { letter-spacing: 0; text-transform: none; }
.crest {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); color: var(--navy-900); font-size: 19px;
  box-shadow: 0 6px 18px -6px rgba(207, 174, 116, .6), inset 0 1px 0 rgba(255,255,255,.35);
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #24324f transparent; }
.nav-section { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #6E7A93; padding: 18px 12px 8px; }
[dir="rtl"] .nav-section { letter-spacing: 0; font-size: 11.5px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-block: 2px; border-radius: 10px;
  color: #B9C2D3; font-weight: 500; transition: background .15s, color .15s;
}
.sidebar nav a i { font-size: 17px; width: 20px; text-align: center; color: #7F8BA5; transition: color .15s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(207, 174, 116, .16), rgba(207, 174, 116, .03)); color: #fff;
  box-shadow: inset 2px 0 0 var(--gold-400);
}
[dir="rtl"] .sidebar nav a.active { background: linear-gradient(270deg, rgba(207, 174, 116, .16), rgba(207, 174, 116, .03)); box-shadow: inset -2px 0 0 var(--gold-400); }
.sidebar nav a.active i { color: var(--gold-400); }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.who { display: flex; gap: 10px; align-items: center; }
.who strong { display: block; color: #fff; font-size: 13.5px; font-weight: 600; }
.who small { color: var(--gold-400); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--navy-600); color: var(--gold-200); font-weight: 600; border: 1px solid rgba(207, 174, 116, .35);
}
.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: rgba(248, 246, 241, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}
.page-title { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--navy-800); white-space: nowrap; }
.topbar-date {
  margin-inline-start: auto; display: flex; gap: 14px; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--gray-200); cursor: pointer; font-size: 13px; color: var(--text-2);
  transition: border-color .15s;
}
.topbar-date:hover { border-color: var(--gold-400); }
.topbar-date .sep { width: 1px; height: 16px; background: var(--gray-300); }
.topbar-date .h { color: var(--gold-600); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--navy-700); font-weight: 600; font-size: 14px; padding: 0 8px;
}
.icon-btn:hover { border-color: var(--gold-400); color: var(--gold-600); }
.icon-btn i { font-size: 18px; }
.content { padding: 26px 28px 60px; max-width: 1640px; width: 100%; }
.only-mobile { display: none; }
.scrim { display: none; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface);
  border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button, .dropdown-menu a {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: start; border: 0; background: none;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--gray-100); }
.dropdown-menu form { margin: 0; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--gray-300); background: var(--surface); color: var(--navy-700);
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: var(--navy-600); color: var(--navy-800); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); border-color: var(--gold-500); color: var(--navy-950);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px -6px rgba(156, 122, 67, .7);
}
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-500), var(--gold-600)); color: #fff; border-color: var(--gold-600); }
.btn-danger { color: var(--danger); border-color: #E4C3BF; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--gray-100); border-color: transparent; }
.btn-group { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 10px; overflow: hidden; background: var(--surface); }
.btn-group button { border: 0; background: none; padding: 0 14px; height: 36px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.btn-group button + button { border-inline-start: 1px solid var(--gray-200); }
.btn-group button.on { background: var(--navy-700); color: #fff; }

/* ------------------------------------------------------------- cards & layout */
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-2e { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-1);
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; font-weight: 600; color: var(--navy-800); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.section-title { font-family: var(--display); font-size: 20px; color: var(--navy-800); margin: 4px 0 12px; }

.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 30px; color: #fff; margin-bottom: 20px;
  background:
    radial-gradient(circle at 85% -20%, rgba(207, 174, 116, .35), transparent 45%),
    radial-gradient(circle at 0% 120%, rgba(42, 61, 99, .9), transparent 50%),
    linear-gradient(120deg, var(--navy-800), var(--navy-950));
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 14px);
}
.hero h2 { font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1.15; }
.hero .hdate { font-size: 15px; color: var(--gold-200); margin-top: 6px; }
.hero .hdate b { color: #fff; font-weight: 500; }
.hero .hero-stats { margin-inline-start: auto; display: flex; gap: 30px; position: relative; z-index: 1; }
.hero .hs strong { display: block; font-size: 28px; font-weight: 600; color: #fff; font-family: var(--display); }
.hero .hs span { font-size: 12.5px; color: #AEB8CC; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: conic-gradient(var(--gold-400) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--navy-900); }
.ring b { position: relative; font-size: 20px; font-family: var(--display); }

.kpi { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; position: relative; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: inherit; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none;
  background: var(--navy-100); color: var(--navy-700); }
.kpi .ic.gold { background: var(--gold-100); color: var(--gold-600); }
.kpi .ic.green { background: var(--st-checked_in-bg); color: var(--st-checked_in); }
.kpi .ic.red { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.kpi .ic.amber { background: var(--st-pending-bg); color: var(--st-pending); }
.kpi .ic.blue { background: var(--st-confirmed-bg); color: var(--st-confirmed); }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-size: 25px; font-weight: 600; color: var(--navy-800); line-height: 1.2; margin-top: 2px; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.room-bars { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--gray-100); }
.room-bars span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--gray-100); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12.5px; color: var(--muted); }
.date-chip { text-align: center; min-width: 52px; padding: 5px 6px; border-radius: 10px; background: var(--gold-100); color: var(--gold-600); line-height: 1.1; }
.date-chip b { display: block; font-size: 18px; color: var(--navy-800); }
.date-chip small { font-size: 10.5px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 30px; display: block; margin-bottom: 8px; color: var(--gray-300); }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: var(--gray-100); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-new { background: var(--st-new-bg); color: var(--st-new); }
.b-pending { background: var(--st-pending-bg); color: var(--st-pending); }
.b-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed); }
.b-checked_in { background: var(--st-checked_in-bg); color: var(--st-checked_in); }
.b-checked_out { background: var(--st-checked_out-bg); color: var(--st-checked_out); }
.b-cancelled { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.b-no_show { background: var(--st-no_show-bg); color: var(--st-no_show); }
.r-available { background: var(--st-checked_in-bg); color: var(--st-checked_in); }
.r-occupied { background: var(--st-confirmed-bg); color: var(--st-confirmed); }
.r-dirty { background: var(--st-pending-bg); color: var(--st-pending); }
.r-cleaning { background: #FFF6E0; color: #A3761D; }
.r-out_of_service { background: var(--st-cancelled-bg); color: var(--st-cancelled); }
.vip { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); font-size: 10.5px; padding: 1px 7px; border-radius: 5px; font-weight: 700; letter-spacing: .04em; }

/* ------------------------------------------------------------- toolbar & tables */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 420px; }
.search i { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-inline-start: 38px !important; }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--gray-300); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(207, 174, 116, .22);
}
.input.sm, select.input.sm { height: 36px; font-size: 13.5px; width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; color: var(--danger); }
.field small { color: var(--muted); font-size: 12px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(176, 71, 62, .12); }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.form-grid > * { grid-column: span 6; }
.form-grid .s3 { grid-column: span 3; } .form-grid .s4 { grid-column: span 4; } .form-grid .s2 { grid-column: span 2; }
.form-grid .s8 { grid-column: span 8; } .form-grid .s12 { grid-column: span 12; }
.fieldset { border: 1px solid var(--gray-200); border-radius: 12px; padding: 16px; margin: 0 0 16px; background: var(--gray-50); }
.fieldset > legend, .fieldset > .legend { font-family: var(--display); font-size: 17px; color: var(--navy-800); padding: 0 6px; font-weight: 600; }
.fieldset > .legend { padding: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.fieldset > .legend i { color: var(--gold-500); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--navy-700); }
.form-error { background: var(--st-cancelled-bg); color: var(--danger); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; border: 1px solid #EBCBC7; }
.form-note { background: var(--gold-100); color: var(--gold-600); border-radius: 10px; padding: 10px 14px; font-size: 13px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.dt th {
  text-align: start; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
[dir="rtl"] .dt th { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.dt th.sortable { cursor: pointer; user-select: none; }
.dt th.sortable:hover { color: var(--navy-700); }
.dt th .arr { opacity: .35; font-size: 10px; margin-inline-start: 4px; }
.dt th.sorted .arr { opacity: 1; color: var(--gold-600); }
.dt td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.dt tbody tr { transition: background .1s; }
.dt tbody tr:hover { background: #FBFAF6; }
.dt tbody tr.clickable { cursor: pointer; }
.dt td.end, .dt th.end { text-align: end; }
.dt .strong { font-weight: 600; color: var(--navy-800); }
.dt-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.dt-foot .pager { margin-inline-start: auto; display: flex; gap: 6px; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.due { color: var(--danger); font-weight: 600; }
.amount.ok { color: var(--ok); }

/* ------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 16px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--navy-800); border-bottom-color: var(--gold-500); }

/* ------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(7, 14, 28, .55); backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; animation: fade .15s;
}
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 640px; box-shadow: var(--shadow-3); animation: rise .2s;
  border-top: 3px solid var(--gold-400);
}
.modal.lg { max-width: 980px; } .modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--gray-100); }
.modal-head h3 { font-family: var(--display); font-size: 22px; color: var(--navy-800); flex: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--gray-100); background: var(--gray-50); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* ------------------------------------------------------------- toasts */
.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--navy-800); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-2);
  display: flex; gap: 10px; align-items: flex-start; animation: rise .2s; font-size: 13.5px; border-inline-start: 3px solid var(--gold-400);
}
.toast.err { background: #5A1F1A; border-color: #E08A80; }
.toast.ok { border-color: #6FCF9D; }
.toast i { font-size: 17px; margin-top: 1px; }

/* ------------------------------------------------------------- date picker */
.dp-input { position: relative; }
.dp-input input { cursor: pointer; padding-inline-end: 38px !important; }
.dp-input > i { position: absolute; inset-inline-end: 12px; top: 11px; color: var(--gold-500); pointer-events: none; }
.dp-sub { font-size: 12px; color: var(--gold-600); min-height: 18px; display: block; }
.dp-pop {
  position: absolute; z-index: 300; width: 336px; background: var(--surface); border: 1px solid var(--gray-200);
  border-radius: 16px; box-shadow: var(--shadow-3); padding: 14px; animation: rise .15s;
}
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-head .t { flex: 1; text-align: center; line-height: 1.2; }
.dp-head .t b { display: block; font-size: 15px; color: var(--navy-800); }
.dp-head .t small { color: var(--gold-600); font-size: 12px; }
.dp-head button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--gray-200); background: none; cursor: pointer; }
.dp-head button:hover { border-color: var(--gold-400); }
.dp-mode { display: flex; justify-content: center; margin-bottom: 10px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-grid .wd { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.dp-grid button {
  border: 0; background: none; border-radius: 9px; height: 42px; cursor: pointer; line-height: 1.05; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dp-grid button b { font-size: 14px; font-weight: 600; color: var(--text); }
.dp-grid button small { font-size: 10px; color: var(--gold-600); }
.dp-grid button:hover:not(:disabled) { background: var(--gold-100); }
.dp-grid button.out b { color: var(--gray-300); }
.dp-grid button.today { box-shadow: inset 0 0 0 1px var(--gold-400); }
.dp-grid button.sel { background: var(--navy-700); }
.dp-grid button.sel b, .dp-grid button.sel small { color: #fff; }
.dp-grid button.range { background: var(--navy-100); }
.dp-grid button:disabled { opacity: .3; cursor: not-allowed; }
.dp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); font-size: 12px; }
.nights-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--navy-700); color: #fff; font-weight: 600; }
.nights-pill b { font-size: 18px; color: var(--gold-200); }

/* ------------------------------------------------------------- calendar (tape chart) */
.tape { --cell: 46px; --rowh: 46px; --label: 150px; position: relative; overflow: auto; max-height: calc(100vh - 230px); border-radius: 0 0 var(--radius) var(--radius); }
.tape.day { --cell: 220px; } .tape.month { --cell: 38px; }
.tape-grid { display: grid; grid-template-columns: var(--label) repeat(var(--days), var(--cell)); position: relative; min-width: max-content; }
.tape .hd { position: sticky; top: 0; z-index: 5; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); text-align: center; padding: 6px 2px; line-height: 1.15; border-inline-start: 1px solid var(--gray-100); }
.tape .hd b { display: block; font-size: 14px; color: var(--navy-800); }
.tape .hd small { display: block; font-size: 10px; color: var(--muted); }
.tape .hd .hj { color: var(--gold-600); }
.tape .hd.we { background: #F5F2EA; }
.tape .hd.today { background: var(--gold-100); }
.tape .hd.today b { color: var(--gold-600); }
.tape .corner { position: sticky; inset-inline-start: 0; top: 0; z-index: 7; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding: 10px 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tape .rl {
  position: sticky; inset-inline-start: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--gray-100);
  border-inline-end: 1px solid var(--gray-200); padding: 0 12px; display: flex; align-items: center; gap: 8px; height: var(--rowh);
}
.tape .rl b { font-size: 14px; color: var(--navy-800); min-width: 38px; }
.tape .rl small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape .rl .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tape .floor-row { grid-column: 1 / -1; background: var(--navy-100); color: var(--navy-700); font-size: 11.5px; font-weight: 600; padding: 4px 14px; position: sticky; inset-inline-start: 0; letter-spacing: .04em; }
.tape .cell { height: var(--rowh); border-bottom: 1px solid var(--gray-100); border-inline-start: 1px solid var(--gray-100); }
.tape .cell.we { background: #FBFAF6; }
.tape .cell.today { background: rgba(246, 239, 226, .6); }
.tape .cell.drop { background: var(--gold-100); box-shadow: inset 0 0 0 2px var(--gold-400); }
.tape .cell.bad { background: var(--st-cancelled-bg); }
.bar {
  position: absolute; height: calc(var(--rowh) - 12px); border-radius: 8px; padding: 0 10px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #fff; overflow: hidden; white-space: nowrap; cursor: grab; z-index: 3;
  box-shadow: 0 2px 6px -2px rgba(7, 14, 28, .35); transition: transform .1s, box-shadow .1s; user-select: none;
}
.bar:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(7, 14, 28, .55); z-index: 6; }
.bar.dragging { opacity: .45; }
.bar.s-new { background: var(--st-new); } .bar.s-pending { background: var(--st-pending); }
.bar.s-confirmed { background: var(--st-confirmed); } .bar.s-checked_in { background: var(--st-checked_in); }
.bar.s-checked_out { background: #A4A9B3; cursor: default; } .bar.s-no_show { background: var(--st-no_show); cursor: default; }
.bar.s-cancelled { background: repeating-linear-gradient(45deg, #C98A84 0 6px, #B0473E 6px 12px); cursor: default; }
.bar .due { width: 7px; height: 7px; border-radius: 50%; background: #FFD27A; flex: none; }
.bar .ttl { overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------- room cards */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.room-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.room-card .ph { height: 112px; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); position: relative; display: grid; place-items: center; color: var(--gold-200); font-size: 30px; }
.room-card .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.room-card .ph .no { position: absolute; inset-inline-start: 12px; bottom: 10px; font-family: var(--display); font-size: 28px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.room-card .ph .badge { position: absolute; inset-inline-end: 10px; top: 10px; }
.room-card .bd { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.room-card .bd .t { font-weight: 600; color: var(--navy-800); }
.room-card .bd .m { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.room-card .ft { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--gray-100); flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--gray-100); color: var(--text-2); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos .p { width: 110px; height: 80px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--gray-200); }
.photos .p img { width: 100%; height: 100%; object-fit: cover; }
.photos .p button { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }

/* ------------------------------------------------------------- folio / booking view */
.folio-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.folio-head .id h2 { font-family: var(--display); font-size: 30px; color: var(--navy-800); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.folio-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stay-strip { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 18px 20px; }
.stay-strip .d { line-height: 1.35; }
.stay-strip .d .lbl { font-size: 12px; color: var(--muted); }
.stay-strip .d b { display: block; font-size: 16px; color: var(--navy-800); }
.stay-strip .d .h { color: var(--gold-600); font-size: 13px; }
.stay-strip .mid { text-align: center; color: var(--muted); }
.stay-strip .mid b { display: block; font-size: 26px; font-family: var(--display); color: var(--navy-800); }
.totals { width: 100%; }
.totals div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--gray-200); font-size: 14px; }
.totals div:last-child { border-bottom: 0; }
.totals .grand { font-size: 17px; font-weight: 700; color: var(--navy-800); border-bottom: 1px solid var(--gray-300); padding-top: 10px; }
.totals .bal { font-size: 16px; font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px; padding-inline-start: 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--gray-200); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------- housekeeping */
.hk-cols { grid-template-columns: repeat(3, 1fr); }
.hk-card { padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.hk-card .top { display: flex; align-items: center; gap: 8px; }
.hk-card .top b { font-family: var(--display); font-size: 22px; color: var(--navy-800); }
.hk-card.high { border-inline-start: 3px solid var(--danger); }

/* ------------------------------------------------------------- login */
.login-body { background: var(--navy-950); }
.login-wrap { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 8vh 7vw; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(circle at 80% 10%, rgba(207,174,116,.28), transparent 40%), radial-gradient(circle at 10% 90%, rgba(42,61,99,.9), transparent 55%), linear-gradient(140deg, var(--navy-800), var(--navy-950));
}
.login-hero .crest { width: 64px; height: 64px; font-size: 28px; border-radius: 18px; margin-bottom: 26px; }
.login-hero h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.05; color: #fff; }
.login-hero .tag { color: var(--gold-400); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; margin: 12px 0 34px; }
[dir="rtl"] .login-hero .tag { letter-spacing: 0; font-size: 18px; }
.login-date { display: inline-flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(207,174,116,.25); width: max-content; max-width: 100%; }
.login-date .g { font-size: 16px; } .login-date .h { color: var(--gold-200); }
.hero-lines { position: absolute; inset: 0; pointer-events: none; opacity: .06; background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 16px); }
.login-panel { background: var(--ivory); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; position: relative; }
.lang-switch { position: absolute; top: 22px; inset-inline-end: 24px; display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--gray-200); border-radius: 10px; padding: 3px; }
.lang-switch a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.lang-switch a.on { background: var(--navy-700); color: #fff; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-family: var(--display); font-size: 28px; color: var(--navy-800); margin-bottom: 8px; }
.login-form .btn { height: 46px; font-size: 15px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1280px) { .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-3); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(7,14,28,.45); z-index: 35; }
  .main { margin-inline-start: 0; }
  .only-mobile { display: inline-grid; }
  .cols-3, .hk-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 16px 16px 50px; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .page-title { font-size: 21px; }
  .topbar-date { order: 5; width: 100%; margin: 0; justify-content: center; font-size: 12px; }
  .topbar-actions { margin-inline-start: auto; }
  .hide-xs { display: none !important; }
  .cols-2e { grid-template-columns: 1fr; }
  .form-grid > *, .form-grid .s3, .form-grid .s4, .form-grid .s8, .form-grid .s2 { grid-column: span 12; }
  .form-grid .s3.keep, .form-grid .keep { grid-column: span 6; }
  .hero { padding: 20px; } .hero h2 { font-size: 25px; }
  .hero .hero-stats { margin: 0; gap: 18px; width: 100%; justify-content: space-between; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; gap: 10px; } .kpi .ic { width: 34px; height: 34px; font-size: 16px; } .kpi .val { font-size: 20px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 24px 30px; min-height: auto; }
  .modal-back { padding: 0; } .modal { border-radius: 0; min-height: 100vh; }
  .stay-strip { grid-template-columns: 1fr; text-align: center; }
  .tape { --label: 96px; max-height: none; } .tape .rl small { display: none; }
  .search { min-width: 0; max-width: none; flex-basis: 100%; }
  .dp-pop { width: calc(100vw - 32px); max-width: 360px; }
}

/* ------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .toolbar, .no-print, .toasts { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ------------------------------------------------------------- calendar range selection */
.cal-hint { padding: 8px 20px; font-size: 12.5px; color: var(--muted); background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.cal-hint i { color: var(--gold-500); }
.tape .cell { cursor: cell; user-select: none; }
.tape .cell.pick { background: rgba(207, 174, 116, .35); box-shadow: inset 0 0 0 1px var(--gold-500); }
.tape .cell.pick-bad { background: var(--st-cancelled-bg); box-shadow: inset 0 0 0 1px #E4C3BF; }
.sel-bar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(980px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 18px; border-radius: 16px; flex-wrap: wrap;
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-3); border-top: 2px solid var(--gold-400); animation: rise .18s;
}
.sel-bar .sb-dates { line-height: 1.35; }
.sel-bar .sb-dates small { display: block; color: var(--gold-200); font-size: 12px; }
.sel-bar .sb-count { display: flex; gap: 14px; }
.sel-bar .sb-count span { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 12px; white-space: nowrap; }
.sel-bar .sb-count b { font-size: 18px; color: var(--gold-400); margin-inline-end: 4px; }
.sel-bar .sb-rooms { flex: 1; min-width: 120px; font-size: 13px; color: #C9D0DE; }
.sel-bar .sb-warn { color: #F2B8B0; font-size: 12px; margin-top: 2px; }
.sel-bar .btn-ghost { color: #fff; }
.sel-bar .btn-ghost:hover { background: rgba(255,255,255,.1); }
.nights-pill input { width: 64px; height: 30px; border: 0; border-radius: 7px; background: rgba(255,255,255,.12); color: var(--gold-200); font-size: 18px; font-weight: 700; text-align: center; }
.nights-pill input:focus { outline: 2px solid var(--gold-400); }
@media (max-width: 760px) { .sel-bar { bottom: 0; width: 100vw; border-radius: 16px 16px 0 0; } .sel-bar .btn-gold { flex: 1; } }

/* ------------------------------------------------------------- floor board */
.board-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 18px 24px; border-radius: 18px; margin-bottom: 16px; color: #fff;
  background: radial-gradient(circle at 90% -30%, rgba(207,174,116,.35), transparent 45%), linear-gradient(120deg, var(--navy-800), var(--navy-950)); box-shadow: var(--shadow-2); }
.board-head .bh-co { color: var(--gold-400); font-size: 13px; letter-spacing: .08em; }
.board-head h2 { font-family: var(--display); font-size: 28px; color: #fff; }
.board-head .bh-date { display: flex; flex-direction: column; line-height: 1.35; margin-inline-start: auto; text-align: end; }
.board-head .bh-date span { color: var(--gold-200); }
.board-head .bh-clock { font-size: 40px; font-weight: 600; font-family: var(--display); color: var(--gold-200); direction: ltr; min-width: 110px; text-align: center; }
.board-head .bh-actions { display: flex; gap: 6px; }
.board-head .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.board-kpis { grid-template-columns: repeat(6, 1fr); margin-bottom: 16px; }
.board-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.board-left, .board-right { display: grid; gap: 16px; min-width: 0; }
.board-right .bl .list li { padding: 10px 16px; }
.board-right .bl .list { max-height: 330px; overflow-y: auto; }
.board-foot { margin-top: 12px; text-align: center; }
.btiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.btile { position: relative; border-radius: 12px; padding: 10px 12px 12px; border: 1px solid var(--gray-200); background: var(--surface); min-height: 108px;
  border-top: 4px solid var(--gray-300); transition: transform .12s, box-shadow .12s; overflow: hidden; }
.btile[role=link] { cursor: pointer; } .btile[role=link]:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btile .bt-head { display: flex; align-items: baseline; gap: 8px; }
.btile .bt-head b { font-family: var(--display); font-size: 26px; color: var(--navy-800); line-height: 1; }
.btile .bt-head span { font-size: 11.5px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btile .bt-head i { font-size: 16px; }
.btile .bt-who { font-weight: 600; margin-top: 8px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy-800); }
.btile .bt-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.btile .bt-agent { font-size: 11.5px; color: var(--gold-600); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btile .bt-free { margin-top: 10px; font-weight: 600; color: var(--st-checked_in); }
.btile .bt-due { position: absolute; bottom: 8px; inset-inline-end: 8px; font-size: 10.5px; background: var(--st-cancelled-bg); color: var(--danger); padding: 1px 6px; border-radius: 6px; font-weight: 600; }
.btile.st-inhouse { border-top-color: var(--st-confirmed); background: linear-gradient(180deg, #F2F7FC, #fff 60%); } .btile.st-inhouse .bt-head i { color: var(--st-confirmed); }
.btile.st-arriving { border-top-color: var(--gold-500); background: linear-gradient(180deg, var(--gold-100), #fff 60%); } .btile.st-arriving .bt-head i { color: var(--gold-600); }
.btile.st-departing { border-top-color: var(--st-pending); background: linear-gradient(180deg, #FFF4DE, #fff 60%); } .btile.st-departing .bt-head i { color: var(--st-pending); }
.btile.st-free { border-top-color: var(--st-checked_in); } .btile.st-free .bt-head i { color: var(--st-checked_in); }
.btile.st-dirty { border-top-color: #D9A93C; background: repeating-linear-gradient(135deg, #fff 0 10px, #FFFAEE 10px 20px); } .btile.st-dirty .bt-head i { color: #C48F1E; }
.btile.st-oos { border-top-color: var(--danger); background: var(--st-cancelled-bg); opacity: .85; } .btile.st-oos .bt-head i { color: var(--danger); }
.legend .lg { width: 12px; height: 4px; border-radius: 2px; display: inline-block; margin-inline-end: 6px; vertical-align: middle; }
.lg.st-inhouse { background: var(--st-confirmed); } .lg.st-arriving { background: var(--gold-500); } .lg.st-departing { background: var(--st-pending); }
.lg.st-free { background: var(--st-checked_in); } .lg.st-dirty { background: #D9A93C; } .lg.st-oos { background: var(--danger); }
.tape.mini { --cell: 40px; --rowh: 36px; --label: 120px; max-height: none; }
.tape.mini .bar { font-size: 11px; height: calc(var(--rowh) - 10px); }
.tape.mini .cell { cursor: default; }
/* TV / wall-display mode */
body.tv .sidebar, body.tv .topbar, body.tv .scrim { display: none !important; }
body.tv .main { margin: 0; }
body.tv .content { max-width: none; padding: 18px 22px 20px; }
body.tv .tape.mini { --cell: 44px; }
@media (max-width: 1280px) { .board-main { grid-template-columns: 1fr; } .board-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .board-kpis { grid-template-columns: 1fr 1fr; } .board-head .bh-date { margin: 0; text-align: start; } .board-head .bh-clock { font-size: 30px; }
  .btiles { grid-template-columns: repeat(2, 1fr); } }
