/* Ecomify Booking — staff panel styles on top of Bootstrap 5 (tokens from docs/DESIGN_SYSTEM.md) */
:root {
  --brand: #e23744;
  --brand-dark: #c81f2d;
  --brand-soft: #fdecee;
  --ink: #18181c;
  --ink2: #3b3b45;
  --muted: #6a6a76;
  --line: #e9eaf0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --leaf: #1f8a4c; --leaf-soft: #e3f5ea;
  --amber: #b45309; --amber-soft: #fff4e0;
  --blue: #1d4ed8; --blue-soft: #e8efff;
  --red: #b91c1c; --red-soft: #fde8e8;
  --slate: #334155; --slate-soft: #f1f5f9;
  --indigo: #4338ca; --indigo-soft: #eef2ff;
  --sidebar: #14141f;
  --sidebar-w: 248px;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 226, 55, 68;
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
}

body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }

.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
.text-brand { color: var(--brand) !important; }
.text-muted2 { color: var(--muted) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 15%, transparent); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .88rem; }

.card { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: .85rem 1.1rem; }
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table-hover tbody tr[data-href] { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sidebar); color: #c9cad6; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.sidebar .brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.sidebar .tenant { margin: 0 1rem 1rem; padding: .65rem .8rem; background: rgba(255,255,255,.06); border-radius: 10px; font-size: .82rem; }
.sidebar .tenant b { color: #fff; display: block; font-size: .9rem; }
.sidebar .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #6e7083; padding: .9rem 1.25rem .35rem; }
.sidebar a.nav-link { color: #c9cad6; display: flex; align-items: center; gap: .7rem; padding: .55rem 1.25rem; margin: 1px .6rem; border-radius: 9px; font-size: .92rem; }
.sidebar a.nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar a.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .85rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20; min-height: 60px; }
.topbar h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.content { padding: 1.5rem; }

@media (max-width: 991px) {
  .sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); z-index: 1050; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .content { padding: 1rem; }
  .topbar { padding: .65rem 1rem; flex-wrap: wrap; }
}

/* ---------- Stat tiles ---------- */
.stat { padding: 1.1rem 1.2rem; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; }
.icon-leaf { background: var(--leaf-soft); color: var(--leaf); }
.icon-blue { background: var(--blue-soft); color: var(--blue); }
.icon-amber { background: var(--amber-soft); color: var(--amber); }
.icon-brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- Status pills (always label + colour) ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pill-pending { background: var(--amber-soft); color: var(--amber); }
.pill-confirmed { background: var(--blue-soft); color: var(--blue); }
.pill-checked_in { background: var(--leaf-soft); color: var(--leaf); }
.pill-checked_out { background: var(--slate-soft); color: var(--slate); }
.pill-cancelled { background: var(--red-soft); color: var(--red); }
.pill-no_show { background: var(--indigo-soft); color: var(--indigo); }
.pill-paid { background: var(--leaf-soft); color: var(--leaf); }
.pill-partial { background: var(--amber-soft); color: var(--amber); }
.pill-unpaid { background: var(--red-soft); color: var(--red); }
.pill-muted { background: var(--slate-soft); color: var(--slate); }

/* ---------- Forecast bars ---------- */
.forecast { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.forecast .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .7rem; color: var(--muted); }
.forecast .fill { width: 100%; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--brand) 75%, #fff); min-height: 3px; }
.forecast .bar.today .fill { background: var(--brand); }
.forecast .pct { font-weight: 600; color: var(--ink2); margin-bottom: 2px; }

/* ---------- Rates & availability calendar ---------- */
.cal-wrap { overflow-x: auto; }
.cal { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 100%; }
.cal th, .cal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; background: #fff; }
.cal thead th { position: sticky; top: 0; background: #fafbfc; font-weight: 600; padding: .45rem .3rem; min-width: 74px; z-index: 2; }
.cal thead th.we { background: #fff7ed; }
.cal thead th small { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; }
.cal .rt { position: sticky; left: 0; z-index: 3; text-align: left; padding: .5rem .75rem; min-width: 180px; background: #fff; font-weight: 600; }
.cal thead .rt { z-index: 4; background: #fafbfc; }
.cal .rowlabel { position: sticky; left: 0; z-index: 3; text-align: left; padding: .3rem .75rem; color: var(--muted); font-size: .75rem; background: #fff; }
.cal .typehead td { background: #f8f9fc; }
.cal input { width: 100%; border: 0; background: transparent; text-align: center; padding: .4rem .2rem; font: inherit; font-variant-numeric: tabular-nums; }
.cal input:focus { outline: 2px solid var(--brand); background: #fff; }
.cal td.free-0 { background: var(--red-soft); }
.cal td.free-0 .v { color: var(--red); font-weight: 700; }
.cal td.stop { background: repeating-linear-gradient(135deg, var(--red-soft), var(--red-soft) 6px, #fff 6px, #fff 12px); }
.cal td.ovr input { color: var(--blue); font-weight: 600; }
.cal td .v { display: block; padding: .4rem .2rem; font-variant-numeric: tabular-nums; }
.cal td.saving { opacity: .5; }
.cal .flag { font-size: .65rem; color: var(--amber); display: block; line-height: 1; padding-bottom: .2rem; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .4rem .75rem; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.code-box { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .9rem 1rem; font-size: .8rem; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.room-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg, var(--brand-soft), #fff); display: grid; place-items: center; color: var(--brand); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 20% 10%, var(--brand-soft), transparent 40%), var(--bg); }
.auth .card { width: 100%; max-width: 440px; padding: 1.75rem; }

/* ---------- Print (invoice) ---------- */
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}
