:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --text: #0f172a;
  --brand: #0e7490;
  --brand-2: #0891b2;
  --accent: #f59e0b;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.06);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  color: var(--text);
  font-size: 13px;               /* global base size — kept compact */
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 20% -10%, #155e75 0%, #0f172a 55%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border-radius: 16px; box-shadow: var(--shadow); padding: 32px 28px;
}
.login-card h1 { font-size: 20px; margin: 0 0 2px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.brand-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--brand-2); margin-right:8px; }

/* ---------- Layout ---------- */
.topbar {
  height: 50px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 18px; position: sticky; top: 0; z-index: 10;
}
.topbar .logo { font-weight: 700; letter-spacing: .2px; }
.topbar .module-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: #fff; background: var(--brand); padding: 3px 8px; border-radius: 999px;
}
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 4px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.nav button {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.nav button.active { background: #ecfeff; color: var(--brand); }
.container { max-width: 1200px; margin: 0 auto; padding: 22px 20px 60px; }

/* ---------- Cards / KPI ---------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .cols-4,.cols-3,.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .cols-4,.cols-3,.cols-2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 13.5px; }
.kpi .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 21px; font-weight: 800; margin-top: 5px; }
.kpi .value small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Buttons / inputs ---------- */
.btn { border: 0; border-radius: 9px; padding: 8px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: #f1f5f9; color: var(--text); }
.btn.ok { background: var(--ok); color:#fff; }
.btn.warn { background: var(--warn); color:#fff; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label { display:block; font-size: 12px; color: var(--muted); font-weight: 600; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
  box-sizing: border-box;
}
/* Consistent control height so textboxes and comboboxes line up evenly */
input:not([type=checkbox]):not([type=radio]), select { height: 36px; line-height: 34px; }
textarea { padding: 10px 12px; min-height: 84px; line-height: 1.4; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center;
}
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid #a5f3fc; border-color: var(--brand-2); }
.row { display:flex; gap: 12px; } .row > * { flex: 1; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: #f8fafc; }
.right { text-align: right; }

/* ---------- Badges ---------- */
.badge { display:inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.b-green { background:#dcfce7; color:#166534; } .b-red { background:#fee2e2; color:#991b1b; }
.b-amber { background:#fef3c7; color:#92400e; } .b-blue { background:#dbeafe; color:#1e40af; }
.b-gray { background:#e2e8f0; color:#334155; }

/* ---------- Room map ---------- */
.roommap { display:grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.room {
  border-radius: 12px; padding: 12px; color:#fff; cursor:pointer; min-height: 96px;
  display:flex; flex-direction:column; justify-content:space-between; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: transform .06s ease;
}
.room:hover { transform: translateY(-2px); }
.room .num { font-size: 15px; font-weight: 800; }
.room .type { font-size: 11px; opacity:.9; }
.room .st { font-size: 11px; font-weight: 700; }
.room.vacant { background: #14b8a6; }
.room.occupied { background: #6366f1; }
.room.arrival { background: #f59e0b; }     /* check-in due today */
.room.departure { background: #f43f5e; }   /* check-out due today */
.room.out_of_order, .room.out_of_service { background: #94a3b8; }
.room .hk { font-size:10px; background: rgba(255,255,255,.25); padding:1px 6px; border-radius:999px; align-self:flex-start; }

/* ---------- POS ---------- */
.pos-layout { display:grid; grid-template-columns: 1fr 340px; gap: 16px; }
@media (max-width: 900px){ .pos-layout { grid-template-columns: 1fr; } }
.prodgrid { display:grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap:10px; }
.prod { background:#fff; border:1px solid var(--line); border-radius:10px; padding:12px; cursor:pointer; box-shadow:var(--shadow); }
.prod:hover { border-color: var(--brand-2); }
.prod .pn { font-weight:700; font-size:13px; } .prod .pp { color:var(--brand); font-weight:700; margin-top:6px; font-size:13px; }
.cart-line { display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#0f172a; color:#fff; padding:12px 18px; border-radius:10px; box-shadow:var(--shadow); z-index:100; font-size:13px; }
.hide { display:none !important; }
.muted { color: var(--muted); }
.center-note { text-align:center; color: var(--muted); padding: 40px; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
.modal-bg { position:fixed; inset:0; background:rgba(15,23,42,.5); display:grid; place-items:center; z-index:50; padding:16px; }
.modal { background:#fff; border-radius:14px; padding:22px; width:100%; max-width:460px; box-shadow:var(--shadow); max-height: 90vh; overflow:auto; }
.modal h3 { margin-top:0; }

/* =============================================================
   AERO THEME — glassy translucent panels over an aurora gradient
   (appended last so it layers over the base rules)
   ============================================================= */
body {
  min-height: 100vh;
  padding-bottom: 36px;                 /* room for the fixed footer */
  background:
    radial-gradient(1200px 720px at 6% -8%, rgba(56,189,248,.30), transparent 60%),
    radial-gradient(1100px 720px at 102% -4%, rgba(13,148,196,.24), transparent 55%),
    radial-gradient(1000px 680px at 50% 118%, rgba(45,212,191,.22), transparent 60%),
    linear-gradient(180deg, #eef5fc 0%, #e6eef7 100%);
  background-attachment: fixed;
}
.card {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 8px 28px rgba(2,32,64,.10), inset 0 1px 0 rgba(255,255,255,.75);
}
.topbar {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(255,255,255,.6);
  box-shadow: 0 2px 14px rgba(2,32,64,.06);
}
.nav {
  background: rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.5);
}
.nav button.active { background: rgba(14,116,144,.14); color: var(--brand); }
.btn.primary {
  background: linear-gradient(180deg, #12a3b7 0%, #0e7490 100%);
  box-shadow: 0 2px 10px rgba(14,116,144,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.primary:hover { background: linear-gradient(180deg, #17b8cc 0%, #0891b2 100%); }
.btn.ok { background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%); box-shadow: 0 2px 10px rgba(22,163,74,.32), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.warn { background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%); }
.btn.ghost { background: rgba(255,255,255,.6); border: 1px solid rgba(15,23,42,.06); }
.modal {
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 24px 70px rgba(2,32,64,.28);
}
.modal-bg { background: rgba(15,23,42,.42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.room { box-shadow: 0 6px 18px rgba(2,32,64,.14), inset 0 1px 0 rgba(255,255,255,.28); }

/* footer bar */
#vnc-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px;
  font-size: 11px; color: #475569;
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,.6);
}
#vnc-footer .ver { color: #94a3b8; }

/* area frames on the room map */
.area-frame { border: 1px solid rgba(14,116,144,.20); background: rgba(255,255,255,.28); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.area-head { font-weight: 700; font-size: 12px; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.area-head .area-name { flex: 1; }
.area-head .area-count, .area-head .cnt { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.area-frame .roommap { margin: 0; }

/* compact KPI row for the dashboard */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.kpi-row .card { padding: 12px; }
.kpi-row .value { font-size: 18px; }
@media (max-width: 1000px){ .kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px){ .kpi-row { grid-template-columns: 1fr 1fr; } }

/* extra-bed sign on room tiles + trace flag on bookings */
.room .ebed { font-size: 10px; font-weight: 700; background: rgba(0,0,0,.28); color: #fff; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.trace-flag { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  background: #ef4444; color: #fff; font-weight: 800; font-size: 12px; margin-left: 6px; cursor: pointer; vertical-align: middle; }

/* Housekeeping status shown on the room map (pill colour + tile ribbon) */
.room { position: relative; overflow: hidden; }
.hk-pill { color:#fff !important; font-weight:700; }
.hk-pill-clean     { background:#16a34a !important; }
.hk-pill-dirty     { background:#dc2626 !important; }
.hk-pill-inspected { background:#0ea5e9 !important; }
.hk-pill-cleaning  { background:#d97706 !important; }
.hk-pill-pickup    { background:#d97706 !important; }
/* A coloured ribbon along the tile bottom makes the HK status readable at a glance. */
.room::after { content:""; position:absolute; left:0; right:0; bottom:0; height:6px; background:#16a34a; }
.room.hk-dirty::after     { background:#dc2626; }
.room.hk-clean::after     { background:#16a34a; }
.room.hk-inspected::after { background:#0ea5e9; }
.room.hk-cleaning::after, .room.hk-pickup::after { background:#d97706; }
/* Dirty rooms get a faint diagonal hatch so they stand out even before reading text. */
.room.hk-dirty { background-image: repeating-linear-gradient(45deg, rgba(220,38,38,.22) 0 8px, transparent 8px 16px); }
