/* ============================================================
   Syafira Hotel Management — Modern Redesign v3
   Mobile-first, soft & friendly. Theme-aware with dark mode.
   ============================================================ */

/* -------- THEME SETUP -------- */

:root,
[data-theme="honey"] {
  --bg: #F8F5F0;
  --bg-2: #F2EBE1;
  --paper: #FFFFFF;
  --paper-2: #FAF8F4;
  --card: #FFFFFF;
  --ink-1: #1A1714;
  --ink-2: #4A443E;
  --ink-3: #7D756D;
  --ink-4: #B0A8A0;
  --rule: #E6DFD4;
  --rule-2: #F0EAE0;

  --gold: #A6752D;
  --gold-ink: #7A531C;
  --gold-soft: #FBF2E1;
  --blue: #245A8B;
  --blue-ink: #1B3D5E;
  --blue-soft: #E1E9F1;
  --green: #246B42;
  --green-soft: #E1F1E8;
  --green-ink: #184A2D;
  --red: #A32E25;
  --red-soft: #FDE9E7;
  --slate-soft: #F2EFED;

  --primary: #A6752D;
  --primary-ink: #7A531C;
  --primary-soft: #FBF2E1;
  --accent: #246B42;
  --accent-soft: #E1F1E8;
  --accent-ink: #184A2D;
  --warn: #A65A21;
  --warn-soft: #FDEEDF;
  --danger: #A32E25;
  --danger-soft: #FDE9E7;
  --info: #245A8B;
  --info-soft: #E1E9F1;

  --shadow-1: 0 2px 4px rgba(0,0,0,.02), 0 1px 2px rgba(0,0,0,.04);
  --shadow-2: 0 8px 24px rgba(40,30,20,.08), 0 2px 6px rgba(40,30,20,.04);
  --shadow-3: 0 24px 60px rgba(40,30,20,.16), 0 8px 24px rgba(40,30,20,.08);
  --shadow-1: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-2: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-3: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* -------- THEME B: Sage Cream -------- */
[data-theme="sage"] {
  --bg: #F5F4EE;
  --bg-2: #ECEDE3;
  --paper: #FFFFFF;
  --paper-2: #F2F2EA;
  --card: #FFFFFF;
  --ink-1: #1F2A22;
  --ink-2: #4F5A50;
  --ink-3: #7E887E;
  --ink-4: #ADB4A9;
  --rule: #E2E5D7;
  --rule-2: #ECEEE2;

  --gold: #B5763A;
  --gold-ink: #7C4E1A;
  --gold-soft: #F4E4CC;
  --blue: #3A6F8A;
  --blue-ink: #2A5A77;
  --blue-soft: #DDE8EE;
  --green: #4F8264;
  --green-soft: #DDEBDF;
  --green-ink: #2F5C40;
  --red: #B23A3F;
  --red-soft: #F5DCDD;
  --slate-soft: #ECECEC;

  --primary: #4F8264;
  --primary-ink: #2F5C40;
  --primary-soft: #DDEBDF;
  --accent: #B5763A;
  --accent-soft: #F4E4CC;
  --accent-ink: #7C4E1A;
  --warn: #C28330;
  --warn-soft: #F7E6CB;
  --danger: #B23A3F;
  --danger-soft: #F5DCDD;
  --info: #3A6F8A;
  --info-soft: #DDE8EE;

  --shadow-1: 0 1px 2px rgba(20,30,20,.04);
  --shadow-2: 0 2px 12px rgba(30,50,30,.06), 0 1px 3px rgba(30,50,30,.04);
  --shadow-3: 0 12px 40px rgba(30,50,30,.12), 0 4px 12px rgba(30,50,30,.06);
}

/* -------- THEME C: Rose -------- */
[data-theme="rose"] {
  --bg: #FBF6F4;
  --bg-2: #F5ECEA;
  --paper: #FFFFFF;
  --paper-2: #FAF4F0;
  --card: #FFFFFF;
  --ink-1: #2A1F1D;
  --ink-2: #5C4745;
  --ink-3: #8B7976;
  --ink-4: #B5A3A0;
  --rule: #ECDDDA;
  --rule-2: #F4EDED;

  --gold: #D97B6E;
  --gold-ink: #A54939;
  --gold-soft: #F5D9D3;
  --blue: #8B6F9E;
  --blue-ink: #6B5A7F;
  --blue-soft: #EAE1F0;
  --green: #6B8B79;
  --green-soft: #E0EDE5;
  --green-ink: #4A6353;
  --red: #C24749;
  --red-soft: #FCE3E5;
  --slate-soft: #F4EDED;

  --primary: #D97B6E;
  --primary-ink: #A54939;
  --primary-soft: #F5D9D3;
  --accent: #6B8B79;
  --accent-soft: #E0EDE5;
  --accent-ink: #4A6353;
  --warn: #D88C6E;
  --warn-soft: #FCE8DD;
  --danger: #C24749;
  --danger-soft: #FCE3E5;
  --info: #8B6F9E;
  --info-soft: #EAE1F0;

  --shadow-1: 0 1px 2px rgba(40,30,28,.04);
  --shadow-2: 0 2px 12px rgba(60,45,42,.06), 0 1px 3px rgba(60,45,42,.04);
  --shadow-3: 0 12px 40px rgba(60,45,42,.12), 0 4px 12px rgba(60,45,42,.06);
}

/* -------- THEME D: Peach -------- */
[data-theme="peach"] {
  --bg: #FBF6F0;
  --bg-2: #F5EFEA;
  --paper: #FFFFFF;
  --paper-2: #FAF5EE;
  --card: #FFFFFF;
  --ink-1: #2A241A;
  --ink-2: #5C5145;
  --ink-3: #8B8276;
  --ink-4: #B5A895;
  --rule: #EDD9C8;
  --rule-2: #F4EDDF;

  --gold: #E8A574;
  --gold-ink: #B57538;
  --gold-soft: #F7DEC9;
  --blue: #5A8CB4;
  --blue-ink: #3A6A98;
  --blue-soft: #DFE9F2;
  --green: #6B9277;
  --green-soft: #E0EEE8;
  --green-ink: #4A6B53;
  --red: #D25D56;
  --red-soft: #FDDDDB;
  --slate-soft: #F5EDED;

  --primary: #E8A574;
  --primary-ink: #B57538;
  --primary-soft: #F7DEC9;
  --accent: #6B9277;
  --accent-soft: #E0EEE8;
  --accent-ink: #4A6B53;
  --warn: #E89966;
  --warn-soft: #FCE4D3;
  --danger: #D25D56;
  --danger-soft: #FDDDDB;
  --info: #5A8CB4;
  --info-soft: #DFE9F2;

  --shadow-1: 0 1px 2px rgba(40,30,20,.04);
  --shadow-2: 0 2px 12px rgba(60,45,28,.06), 0 1px 3px rgba(60,45,28,.04);
  --shadow-3: 0 12px 40px rgba(60,45,28,.12), 0 4px 12px rgba(60,45,28,.06);
}

/* -------- THEME E: Sky -------- */
[data-theme="sky"] {
  --bg: #F4F8FC;
  --bg-2: #E8EFF7;
  --paper: #FFFFFF;
  --paper-2: #F0F4FA;
  --card: #FFFFFF;
  --ink-1: #1B2E3F;
  --ink-2: #4A5F75;
  --ink-3: #7A8FA5;
  --ink-4: #A8BAC8;
  --rule: #D8E3F0;
  --rule-2: #E4EBF2;

  --gold: #4682B4;
  --gold-ink: #2E5E8C;
  --gold-soft: #D6E5F3;
  --blue: #2C5AA4;
  --blue-ink: #1A3A7A;
  --blue-soft: #D5E5F4;
  --green: #4A8B6F;
  --green-soft: #D9EBE6;
  --green-ink: #2F6B55;
  --red: #CD5C5C;
  --red-soft: #FCE3E0;
  --slate-soft: #EBF0F6;

  --primary: #2C5AA4;
  --primary-ink: #1A3A7A;
  --primary-soft: #D5E5F4;
  --accent: #4A8B6F;
  --accent-soft: #D9EBE6;
  --accent-ink: #2F6B55;
  --warn: #6B92C1;
  --warn-soft: #E2F0F8;
  --danger: #CD5C5C;
  --danger-soft: #FCE3E0;
  --info: #4682B4;
  --info-soft: #E3EEF8;

  --shadow-1: 0 1px 2px rgba(20,30,45,.04);
  --shadow-2: 0 2px 12px rgba(30,50,70,.06), 0 1px 3px rgba(30,50,70,.04);
  --shadow-3: 0 12px 40px rgba(30,50,70,.12), 0 4px 12px rgba(30,50,70,.06);
}

/* -------- DARK MODE overrides -------- */
[data-mode="dark"][data-theme="honey"] {
  --bg: #1A1612;
  --bg-2: #221C16;
  --paper: #25201A;
  --paper-2: #2C261F;
  --card: #25201A;
  --ink-1: #F5EFE3;
  --ink-2: #C9C0B0;
  --ink-3: #968D7E;
  --ink-4: #6B6358;
  --rule: #3A332A;
  --rule-2: #2F2922;

  --gold: #E2A85C;
  --gold-ink: #F5D5A0;
  --blue: #8BB0D1;
  --blue-ink: #C4D9E8;
  --green: #5FA379;
  --green-soft: #1F3A28;
  --red: #DD6B63;
  --slate-soft: #2A2622;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 2px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,.5);
}

[data-mode="dark"][data-theme="sage"] {
  --bg: #161A17;
  --bg-2: #1C211D;
  --paper: #1F2620;
  --paper-2: #252D26;
  --card: #1F2620;
  --ink-1: #ECEEE2;
  --ink-2: #B6BBAE;
  --ink-3: #828A82;
  --ink-4: #5C625B;
  --rule: #303830;
  --rule-2: #272D27;

  --gold: #D4985A;
  --gold-ink: #F0D5B0;
  --blue: #6FA5C4;
  --blue-ink: #A8CCE0;
  --green: #76AE8C;
  --green-soft: #1E3326;
  --red: #DD5F64;
  --slate-soft: #282E2A;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 2px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,.5);
}

[data-mode="dark"][data-theme="rose"] {
  --bg: #1A1414;
  --bg-2: #221A1A;
  --paper: #251F1E;
  --paper-2: #2C2624;
  --card: #251F1E;
  --ink-1: #F5EDED;
  --ink-2: #C9BFBD;
  --ink-3: #968E8C;
  --ink-4: #6B6360;
  --rule: #3A3330;
  --rule-2: #2F2928;

  --gold: #E89C92;
  --gold-ink: #F5D0C8;
  --blue: #9FA9C8;
  --blue-ink: #D0C8E0;
  --green: #7FA392;
  --green-soft: #1F332A;
  --red: #E88480;
  --slate-soft: #2A2520;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 2px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,.5);
}

[data-mode="dark"][data-theme="peach"] {
  --bg: #1A1612;
  --bg-2: #221C16;
  --paper: #251F1A;
  --paper-2: #2C261F;
  --card: #251F1A;
  --ink-1: #F5EFEA;
  --ink-2: #C9C0B8;
  --ink-3: #968D84;
  --ink-4: #6B6358;
  --rule: #3A332A;
  --rule-2: #2F2922;

  --gold: #EEBB94;
  --gold-ink: #F5D9C0;
  --blue: #8BACD3;
  --blue-ink: #C0D9E8;
  --green: #7FA391;
  --green-soft: #1F332A;
  --red: #E89080;
  --slate-soft: #2A2620;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 2px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,.5);
}

[data-mode="dark"][data-theme="sky"] {
  --bg: #141E2D;
  --bg-2: #1A2635;
  --paper: #1D2E40;
  --paper-2: #232F42;
  --card: #1D2E40;
  --ink-1: #E8EEF5;
  --ink-2: #B6C2D4;
  --ink-3: #8294B0;
  --ink-4: #5C6B80;
  --rule: #2E3F52;
  --rule-2: #27334A;

  --gold: #7AABDB;
  --gold-ink: #AACEF0;
  --blue: #6B9BD9;
  --blue-ink: #A0CCEA;
  --green: #78B39F;
  --green-soft: #1E3730;
  --red: #E89490;
  --slate-soft: #2A3540;

  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 2px 12px rgba(0,0,0,.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,.5);
}

/* -------- BORDER RADIUS SCALE -------- */
[data-radius="sharp"] {
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
}

[data-radius="soft"] {
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 32px;
}

[data-radius="rounded"] {
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

[data-radius="pill"] {
  --radius: 999px;
  --radius-sm: 999px;
  --radius-lg: 999px;
}

/* ============================================================
   RESET & CORE
   ============================================================ */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-3); }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--paper-2);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
}

.brand {
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--rule);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 12px;
  display: block;
  background: var(--primary-soft);
  color: var(--primary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink-1);
  line-height: 1.2;
}

.brand-tag {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 500;
}

nav {
  flex: 1;
  padding: 12px 0 16px;
}

.nav-sec {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 12px 14px 6px;
  font-weight: 600;
}

.nav-i {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-weight: 500;
}

.nav-i:hover {
  background: var(--bg);
  color: var(--ink-1);
}

.nav-i.active {
  background: var(--primary);
  color: var(--primary-soft);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-ic {
  font-size: 18px;
  width: 20px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-ic svg {
  width: 20px;
  height: 20px;
  color: inherit;
}

.nav-i.active .nav-ic { color: inherit; }

.side-foot {
  padding: 14px 14px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--ink-3);
}

/* ============================================================
   MAIN AREA
   ============================================================ */

.main-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 56px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.tb-l, .tb-r {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tb-crumb {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

.tb-date {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--card);
  border: 1px solid var(--rule);
}

.tb-av {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 30px;
  background: var(--bg);
}

/* ============================================================
   PAGE HEADING
   ============================================================ */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
}

.page-head h2 {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  margin: 0;
  line-height: 1.1;
}

.page-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ============================================================
   CARDS & SURFACES
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}

.sh {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.stl {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}

/* Stat cards */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }

.sc {
  background: var(--card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.sc-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.sc-v { font-size: 20px; font-weight: 800; font-family: var(--font-display); }
.sc-v.gv { color: var(--green); }
.sc-v.rv { color: var(--red); }
.sc-v.bv { color: var(--blue); }
.sc-v.yv { color: var(--gold-ink); }

/* ============================================================
   MOBILE CARD LISTS
   ============================================================ */

.list-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}

.m-card:hover { box-shadow: var(--shadow-2); }
.m-card:active { transform: scale(.98); }

.m-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.m-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

.m-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.m-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  font-weight: 700;
}

.m-card-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.m-card-foot {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-2);
}

.m-card-foot .btn {
  flex: 1;
  height: 38px;
  font-size: 13px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-1);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  letter-spacing: -.005em;
  white-space: nowrap;
  -webkit-touch-callout: none;
}

.btn:active { transform: scale(.97); box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:hover { background: var(--paper-2); border-color: var(--primary); }

.btn-p {
  background: var(--primary);
  color: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, var(--shadow-1);
}
.btn-p:hover { background: var(--primary-ink); border-color: var(--primary-ink); }

.btn-s {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-s:hover { filter: brightness(.95); }

.btn-d {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-d:hover { filter: brightness(.95); }

.btn-i {
  background: var(--info);
  color: #fff;
  border-color: var(--info);
}
.btn-i:hover { filter: brightness(.95); }

.btn-o { background: transparent; color: var(--ink-1); border-color: var(--rule); }

.btn-xs {
  height: 44px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  min-width: 44px;
}

/* ============================================================
   FORMS
   ============================================================ */

.fg { margin-bottom: 16px; }
.fg label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; margin-left: 2px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-1);
  transition: all 0.2s ease;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--bg-2);
}
input::placeholder { color: var(--ink-4); }

textarea {
  height: auto;
  min-height: 80px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.4;
}

input[type="date"] { font-variant-numeric: tabular-nums; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--ink-4); }

.tot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
}

/* ============================================================
   TABLES
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  background: var(--paper-2);
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--paper-2); }

.right { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  text-align: center;
  color: var(--ink-4);
  font-style: italic;
  padding: 32px 16px;
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  background: var(--bg-2);
  color: var(--ink-2);
  white-space: nowrap;
  border: none;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.badge.no-dot::before { display: none; }

.b-g { background: var(--accent-soft); color: var(--accent-ink); }
.b-r { background: var(--danger-soft); color: var(--danger); }
.b-y { background: var(--warn-soft); color: var(--warn); }
.b-blue { background: var(--info-soft); color: var(--info); }
.b-gray { background: var(--slate-soft); color: var(--ink-3); }

/* ============================================================
   ROOM GRID
   ============================================================ */

.room-g {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rc {
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.12s;
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  color: var(--ink-1);
  border-color: var(--rule);
}

.rc:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.rc:active { transform: scale(.96); }

.rno {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rtg {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.s-av { background: var(--info-soft); color: var(--info); border-color: transparent; }
.s-paid, .s-oc { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.s-oc { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.s-rs { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.s-mn { background: var(--slate-soft); color: var(--ink-3); border-color: var(--rule); }
.s-cl { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }

.rc-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 3px;
}

.rc:hover .rc-actions { display: flex; }

.rc-act {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background 0.1s, box-shadow 0.1s;
}

.rc-act:hover { background: #fff; box-shadow: var(--shadow-2); }
.rc-act-del:hover { color: var(--danger); }

/* ============================================================
   MODAL & SHEETS
   ============================================================ */

.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(40,30,15,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--rule);
  animation: popIn .22s cubic-bezier(.2,.9,.3,1.1);
}

.modal-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-1);
}

.modal-x {
  background: var(--bg-2);
  border: none;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 18px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  line-height: 1;
  flex-shrink: 0;
}

.modal-x:hover { background: var(--rule); color: var(--ink-1); }

.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ============================================================
   LEGEND & VISUALIZATION
   ============================================================ */

.leg { display: flex; flex-wrap: wrap; gap: 16px; }

.leg-i {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-3);
}

.leg-d {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.notif-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
  font-size: 13px;
}

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

.abar {
  height: 6px;
  background: var(--rule);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 6px;
}

.afill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.3s;
}

/* ============================================================
   MISC
   ============================================================ */

.room-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  margin: 2px;
  font-variant-numeric: tabular-nums;
}

.avail-tbl th, .avail-tbl td { text-align: center; }
.avail-tbl tbody tr:hover td { background: var(--paper-2); }

/* ============================================================
   TABS
   ============================================================ */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: -1px;
  transition: all 0.12s;
}

.tab:hover { color: var(--ink-1); }
.tab.active { color: var(--primary-ink); border-bottom-color: var(--primary); font-weight: 600; }

/* ============================================================
   MENU CARDS
   ============================================================ */

.menu-g {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.menu-c {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}

.menu-c:hover {
  background: var(--card);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* ============================================================
   INVOICE
   ============================================================ */

.invoice-doc {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.invoice-doc::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}

.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink-1);
}

/* ============================================================
   TOAST
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink-1);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.22s;
  pointer-events: none;
  z-index: 9999;
}

.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes popIn {
  from { transform: scale(.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   HEADER (mobile)
   ============================================================ */

/* ============================================================
   HEADER (mobile)
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 245, 240, 0.85);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  padding: 14px 20px;
  display: none;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
}

.app-header.show { display: flex; }

.app-header .logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}

.app-header .title {
  flex: 1;
  min-width: 0;
}

.app-header h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.app-header .sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.app-header .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
  font-size: 18px;
  position: relative;
  min-width: 42px;
}

.app-header .icon-btn:active { transform: scale(.92); background: var(--bg-2); }

.app-header .icon-btn .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
}

/* ============================================================
   BOTTOM TAB BAR
   ============================================================ */

/* ============================================================
   BOTTOM TAB BAR (FLOATING)
   ============================================================ */

.tab-bar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.8) blur(20px);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  max-width: 440px;
  margin: 0 auto;
}

.tab-bar.show { display: flex; }

/* ============================================================
   MODALS & BOTTOM SHEETS
   ============================================================ */

.modal-ov {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 8, 5, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-ov.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-ov.show .modal {
  transform: scale(1) translateY(0);
}

/* Mobile Bottom Sheet specific */
@media (max-width: 900px) {
  .modal-ov {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: none;
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    margin-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-ov.show .modal {
    transform: translateY(0);
  }

  .modal-h {
    padding-top: 24px;
  }

  /* Handle bar for bottom sheet */
  .modal::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background: var(--rule);
    border-radius: 10px;
  }
}

.modal-h {
  padding: 20px 24px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-1);
}

.modal-x {
  background: var(--bg-2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--ink-3);
  cursor: pointer;
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-foot {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  background: var(--bg);
}

.modal-foot .btn {
  flex: 1;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 16px;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  position: relative;
}

.tab:active { transform: scale(.9); }

.tab .ic {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all .2s ease;
}

.tab .ic svg {
  width: 22px;
  height: 22px;
  color: inherit;
}

.tab-label {
  display: block;
  font-size: 10px;
  opacity: 0.8;
  transition: all .2s ease;
}

.tab.active {
  color: var(--primary);
}

.tab.active .ic {
  transform: translateY(-2px);
  color: var(--primary);
}

.tab.active .tab-label {
  opacity: 1;
  font-weight: 700;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  width: 16px;
  height: 3px;
  background: var(--primary);
  border-radius: 10px;
}

/* ============================================================
   TWEAKS PANEL
   ============================================================ */

.tw-fab {
  position: fixed;
  right: 16px;
  bottom: 90px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  transition: transform .18s ease;
  font-size: 20px;
}

.tw-fab:hover { transform: scale(1.08); }
.tw-fab:active { transform: scale(.94); }

.tw-back {
  position: fixed;
  inset: 0;
  background: rgba(20,18,12,.32);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
}

.tw-back.show { display: block; }

.tw-panel {
  position: fixed;
  right: 16px;
  bottom: 150px;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 20px;
  box-shadow: var(--shadow-3);
  z-index: 9999;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 0;
  animation: twSlide .22s cubic-bezier(.2,.9,.3,1);
}

.tw-panel.show { display: flex; }

@keyframes twSlide {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.tw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tw-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-1);
}

.tw-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 18px;
  flex-shrink: 0;
}

.tw-close:hover { background: var(--rule); color: var(--ink-1); }

.tw-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin: 14px 0 8px;
}

.tw-section:first-of-type { margin-top: 0; }

.tw-row {
  margin-bottom: 12px;
}

.tw-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.tw-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tw-pill {
  flex: 1;
  min-width: 60px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
  font: 600 12px/1 inherit;
  cursor: pointer;
  transition: all .12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.tw-pill:hover {
  background: var(--bg);
  color: var(--ink-1);
}

.tw-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tw-swatches {
  display: flex;
  gap: 10px;
}

.tw-swatch {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform .12s ease;
  position: relative;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.tw-swatch:hover { transform: scale(1.08); }

.tw-swatch.active {
  border-color: var(--ink-1);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink-2);
}

/* ============================================================
   SHEET OVERLAY
   ============================================================ */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,15,8,.4);
  z-index: 100;
  animation: fadeIn .18s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-overlay.center {
  align-items: center;
  padding: 16px;
}

.sheet {
  background: var(--card);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 18px calc(20px + max(env(safe-area-inset-bottom), 0px));
  animation: slideUp .26s cubic-bezier(.2,.9,.3,1.05);
  box-shadow: var(--shadow-3);
}

.sheet.center {
  border-radius: var(--radius-lg);
  max-height: 80vh;
  max-width: 440px;
  animation: popIn .22s cubic-bezier(.2,.9,.3,1.1);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.sheet-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 1px;
}

.sheet-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink-2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  @page { margin: 12mm 14mm; }
  .sidebar, .topbar, .app-header, .page-head, .btn, #tab-bar, .tw-fab, .tw-back, .tw-panel, .mobile-sidebar-overlay, .mobile-sidebar {
    display: none !important;
  }
  .main {
    padding: 0;
    background: #fff;
    overflow: visible;
  }
  .shell {
    display: block;
    height: auto;
    overflow: visible;
  }
  .card {
    box-shadow: none;
    border: none;
    margin: 0;
  }
  body { background: #fff; }
  /* Scale invoice to fit one page — zoom overrides all inline margins/paddings */
  .card.invoice-doc {
    zoom: 0.78;
    max-width: 100% !important;
    margin: 0 auto !important;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none !important;
  }
  .brand-name, .brand-tag, .nav-sec, .nav-i span:not(.nav-ic), .side-foot {
    display: none;
  }
  .nav-i {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }
  .nav-ic {
    font-size: 20px;
  }
  .g2, .g3, .g4 {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 16px;
    padding-bottom: 100px;
  }
  .page-head h2 {
    font-size: 22px;
  }
  .topbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .g2, .g3, .g4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MOBILE SIDEBAR DRAWER
   ============================================================ */

.mobile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.4);
  z-index: 40;
  display: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.mobile-sidebar-overlay.show {
  display: block;
}

.mobile-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--paper-2);
  color: var(--ink-2);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar.show {
  transform: translateX(0);
}

.mobile-sidebar .brand {
  padding: 16px 14px;
  border-bottom: 1px solid var(--rule);
}

.mobile-sidebar .brand-name {
  font-size: 13px;
}

.mobile-sidebar .brand-tag {
  font-size: 10px;
}

.mobile-sidebar nav {
  flex: 1;
  padding: 10px 0;
}

.mobile-sidebar .nav-i {
  padding: 12px 14px;
  font-size: 13px;
  flex-direction: row;
  gap: 12px;
}

.mobile-sidebar .side-foot {
  padding: 12px 14px;
  font-size: 10px;
}

/* ============================================================
   MOBILE FIRST (375px and below)
   ============================================================ */

@media (max-width: 480px) {
  /* Shell & Layout */
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none !important;
  }

  .app-header.show {
    display: flex;
  }

  .tab-bar.show {
    display: flex;
  }

  .main {
    padding: 12px 12px 90px 12px;
    overflow-y: auto;
  }

  /* Page Heading */
  .page-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    gap: 8px;
  }

  .page-head h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  .page-sub {
    font-size: 12px;
  }

  /* Cards & Spacing */
  .card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
  }

  .sh {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
  }

  /* Grid adjustments */
  .g2, .g3, .g4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Stat Cards */
  .sc {
    padding: 12px;
  }

  .sc-v {
    font-size: 22px;
  }

  /* Button sizing on mobile */
  .btn {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    width: 100%;
    margin-top: 8px;
  }

  .btn-xs {
    height: 44px;
    width: 100%;
    margin-top: 6px;
  }

  /* Forms */
  input, select, textarea {
    height: 46px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .fg {
    margin-bottom: 14px;
  }

  .fg label {
    font-size: 13px;
    margin-bottom: 8px;
  }

  /* Tables - make scrollable on mobile */
  .card > table,
  table {
    font-size: 12px;
    display: block;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
  }

  table thead,
  table tbody {
    display: block;
  }

  th {
    padding: 10px 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  /* Scrollable table wrapper for mobile */
  .table-scroll {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }

  /* Notification row */
  .notif-row {
    padding: 10px 0;
    gap: 8px;
    font-size: 12px;
    flex-wrap: wrap;
    word-break: break-word;
  }

  /* Badges */
  .badge {
    padding: 4px 10px;
    font-size: 11px;
  }

  /* Room grid */
  .room-g {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .rc {
    padding: 10px 8px;
    border-radius: var(--radius-sm);
  }

  .rno {
    font-size: 18px;
  }

  /* Modal */
  .modal {
    width: calc(100% - 24px);
    max-width: 100%;
    border-radius: var(--radius);
    padding: 18px;
  }

  .modal-title {
    font-size: 16px;
  }

  /* Typography */
  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }

  body {
    font-size: 14px;
    line-height: 1.4;
  }

  /* Topbar - hide on mobile */
  .topbar {
    display: none !important;
  }

  /* Menu grid */
  .menu-g {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  /* Tweaks FAB adjust */
  .tw-fab {
    bottom: 70px;
    right: 12px;
    width: 48px;
    height: 48px;
  }

  .tw-panel {
    right: 8px;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    bottom: 100px;
    padding: 14px;
  }

  /* Tweaks panel adjustments for mobile */
  .tw-pills {
    gap: 4px;
  }

  .tw-pill {
    font-size: 11px;
    height: 40px;
    padding: 0 10px;
  }

  .tw-swatch {
    width: 40px;
    height: 40px;
  }

  /* Improve tab bar sizing for mobile */
  .tab-bar {
    max-width: 100%;
  }

  .tab {
    min-width: 44px;
    min-height: 50px;
    padding: 6px 8px;
  }

  .tab .ic {
    width: 28px;
    height: 28px;
  }

  .tab-label {
    font-size: 9px;
  }
}

/* ============================================================
   CALENDAR / GANTT VIEW
   ============================================================ */

.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-nav-l {
  display: flex;
  gap: 6px;
}

.cal-range-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.cal-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  margin-bottom: 12px;
}

table.cal-tbl {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 12.5px;
  display: table;
  table-layout: fixed;
  overflow-x: visible;
  border: none;
  border-radius: 0;
}

table.cal-tbl thead {
  display: table-header-group;
}

table.cal-tbl tbody {
  display: table-row-group;
}

table.cal-tbl tr {
  display: table-row;
}

.cal-room-hd,
.cal-room-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--paper-2);
  border-right: 2px solid var(--rule);
}

.cal-room-hd {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  z-index: 3;
  width: 110px;
  min-width: 110px;
}

.cal-room-label {
  padding: 6px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  width: 110px;
  min-width: 110px;
}

.cal-room-no {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.2;
}

.cal-room-type {
  display: block;
  font-size: 10px;
  color: var(--ink-4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-day-hd {
  text-align: center;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule-2, var(--rule));
  min-width: 48px;
  background: var(--paper-2);
  vertical-align: top;
  overflow: hidden;
}

.cal-today-hd {
  background: var(--primary-soft);
}

.cal-day-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-1);
  line-height: 1.1;
}

.cal-today-num {
  color: var(--primary);
}

.cal-day-name {
  font-size: 10px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-empty {
  background: var(--bg, var(--paper));
  border-right: 1px solid var(--rule-2, var(--rule));
  border-bottom: 1px solid var(--rule-2, var(--rule));
  height: 42px;
  padding: 0;
}

.cal-empty-add {
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.cal-empty-add:hover {
  background: var(--primary-soft, rgba(var(--primary-rgb, 37,99,235), 0.06));
}
.cal-empty-add::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-5, #d0d0d0);
  opacity: 0;
  transition: opacity 0.15s;
}
.cal-empty-add:hover::after { opacity: 1; }

.cal-bk {
  padding: 0 6px;
  vertical-align: middle;
  cursor: pointer;
  height: 42px;
  border-bottom: 1px solid var(--rule-2, var(--rule));
  border-right: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: filter 0.1s;
}

.cal-bk:hover { filter: brightness(0.92); }

.cal-bk-inner {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 42px;
}

.cal-bk-res {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-left: 3px solid var(--gold);
}

.cal-bk-ok {
  background: var(--green-soft);
  color: var(--green-ink);
  border-left: 3px solid var(--green);
}

.cal-bk-debt {
  background: var(--red-soft);
  color: var(--red);
  border-left: 3px solid var(--red);
}

.cal-bk-done {
  background: var(--slate-soft);
  color: var(--ink-4);
  border-left: 3px solid var(--ink-4);
}

@media (max-width: 700px) {
  table.cal-tbl {
    display: table;
    font-size: 11px;
    overflow-x: visible;
    border: none;
    min-width: 480px;
  }

  table.cal-tbl thead { display: table-header-group; }
  table.cal-tbl tbody { display: table-row-group; }
  table.cal-tbl tr   { display: table-row; }

  .cal-day-hd {
    min-width: 32px;
    padding: 4px 2px;
  }

  .cal-day-num { font-size: 13px; }

  .cal-room-hd,
  .cal-room-label {
    width: 72px;
    min-width: 72px;
  }

  .cal-room-type { display: none; }
  .cal-bk-inner  { font-size: 10px; }
  .cal-bk, .cal-empty { height: 36px; }
  .cal-bk-inner { line-height: 36px; }
}
