/* Original stylesheet for the StayDesk sample recreation. */
:root {
  --primary: #3c8dbc; --primary-dark: #2f6f96; --danger: #dd4b39; --ok: #16a34a;
  --side: #1f2a30; --side-2: #2a363c; --side-text: #c4ccd1; --top: #34444c;
  --bg: #f3f4f6; --card: #fff; --line: #e2e6ea; --text: #1f2933; --muted: #6b7280;
  --head: #3b4a52; --radius: 6px; --top-h: 56px; --notice-h: 32px; --side-w: 250px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
h1 { font-size: 24px; font-weight: 500; margin: 0; }
h1 small { font-size: 15px; color: var(--muted); margin-left: 8px; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .right { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.green { color: var(--ok); } .red { color: #9b1c1c; }

/* ---------- top bar & notice ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top-h); display: flex; align-items: center; gap: 14px; background: var(--top); color: #fff; z-index: 30; padding-right: 12px; }
.brand { width: var(--side-w); height: 100%; background: #19232a; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 700; font-size: 20px; }
.review-link { color: #fde68a; text-decoration: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 4px; min-width: 32px; height: 32px; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); padding: 0 6px; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.light { background: transparent; border: 0; color: #fff; position: relative; }
.icon-btn sup { position: absolute; top: 0; right: -2px; font-size: 9px; background: #64748b; border-radius: 3px; padding: 0 3px; }
#notif-count:empty { display: none; }
.user { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: #fff; cursor: pointer; font: inherit; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--top); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.has-drop { position: relative; }
.dropdown { position: absolute; right: 0; top: 40px; background: #fff; color: var(--text); min-width: 220px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px 0; z-index: 40; }
.dropdown h4 { margin: 4px 14px 8px; font-size: 13px; }
.dropdown ul { list-style: none; margin: 0; padding: 0; }
.dropdown li { padding: 6px 14px; } .dropdown li a { color: var(--text); text-decoration: none; display: block; }
.dropdown li:hover { background: #f1f5f9; }
.notice { position: fixed; top: var(--top-h); left: var(--side-w); right: 0; height: var(--notice-h); background: #fff; color: #b91c1c; text-align: center; line-height: var(--notice-h); z-index: 20; border-bottom: 1px solid var(--line); font-size: 13px; }

/* ---------- sidebar ---------- */
.sidebar { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); background: var(--side); color: var(--side-text); overflow-y: auto; z-index: 25; display: flex; flex-direction: column; }
.hotel-card { background: #fff; color: var(--text); display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.hotel-card .logo { width: 56px; height: 40px; border: 1px dashed #cbd5e1; font-size: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.hotel-card small { display: block; color: var(--muted); }
.menu { list-style: none; margin: 0; padding: 0; flex: 1; }
.menu > li > a { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--side-text); text-decoration: none; border-left: 4px solid transparent; }
.menu > li.active > a { color: #fff; border-left-color: #22c55e; background: #18222a; }
.menu > li > a:hover { color: #fff; background: #18222a; }
.mi { width: 20px; text-align: center; } .ml { flex: 1; } .caret { transition: transform .15s; }
.menu > li.open .caret { transform: rotate(-90deg); }
.menu ul { list-style: none; margin: 0; padding: 0; background: var(--side-2); display: none; }
.menu > li.open ul { display: block; }
.menu ul a { display: block; padding: 9px 18px 9px 48px; color: #9fb0b9; text-decoration: none; }
.menu ul a:hover, .menu ul li.current a { color: #fff; }
.version { padding: 10px 16px; font-size: 12px; color: #7f8c93; }
body.collapsed .sidebar { transform: translateX(-100%); }
body.collapsed .content, body.collapsed .notice { left: 0; margin-left: 0; }
.admin-panel { position: fixed; top: var(--top-h); right: 0; bottom: 0; width: 260px; background: #1f2a30; color: #e5e7eb; padding: 16px; transform: translateX(100%); transition: transform .2s; z-index: 35; }
.admin-panel.open { transform: none; }
.admin-panel ul { list-style: none; padding: 0; } .admin-panel a { color: #e5e7eb; text-decoration: none; display: block; padding: 8px 0; }

/* ---------- content ---------- */
.content { position: fixed; top: calc(var(--top-h) + var(--notice-h)); left: var(--side-w); right: 0; bottom: 0; overflow: auto; padding: 18px 22px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-bottom: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-top: 4px; } .crumbs span { margin: 0 4px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 16px; margin-bottom: 16px; border-top: 3px solid transparent; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.kpi { min-height: 180px; } .big { font-size: 46px; text-align: center; margin-top: 30px; }
.avail-list { list-style: none; padding: 0; margin: 0; font-size: 18px; color: #6b7280; } .avail-list b { color: #7f1d1d; }
.btn { border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #9cc3da; cursor: not-allowed; }
.btn-light { background: #fff; border: 1px solid #cbd5e1; color: var(--text); } .btn-light:hover { background: #f1f5f9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-round { background: var(--primary); color: #fff; border-radius: 50%; width: 34px; height: 34px; padding: 0; font-size: 18px; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .btn-row.wrap { margin-bottom: 14px; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; }
.link:disabled { color: var(--muted); cursor: default; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar.right { justify-content: flex-end; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.field > span { color: #374151; }
input, select, textarea { font: inherit; border: 1px solid #cbd5e1; border-radius: 4px; padding: 7px 9px; background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: var(--primary); }
input:disabled, select:disabled { background: #f1f5f9; }
.invalid { border-color: #dc2626 !important; background: #fef2f2; }
.err { color: #dc2626; font-size: 12px; font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; margin-right: 10px; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
fieldset { border: 0; padding: 0; margin: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } legend { font-weight: 600; margin-bottom: 6px; padding: 0; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: space-between; align-items: center; }
.inline { display: flex; align-items: flex-end; gap: 10px; }
.short { width: 110px; }
.opt-num { display: flex; align-items: center; gap: 8px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.disabled-msg { color: #dc3545; font-weight: 500; font-size: 26px; margin: 16px 0; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.summary, .total-line { margin: 10px 0; }
.acting { background: #fde68a; color: #1f2933; border-radius: 4px; padding: 4px 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.acting[hidden] { display: none; }
.acting .btn { padding: 3px 8px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { background: #eef2f7; border-radius: 12px; padding: 2px 4px 2px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.chip button { border: 0; background: none; cursor: pointer; color: #9b1c1c; font-size: 13px; }
.setup-type { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.setup-type h4 { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-on { color: var(--ok); font-weight: 600; } .status-off { color: #b91c1c; font-weight: 600; }
.alert { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.assign { margin-top: 14px; }
.tag { background: #e0f2fe; color: #075985; border-radius: 10px; padding: 1px 8px; font-size: 11px; }
code { background: #f1f5f9; border-radius: 3px; padding: 1px 4px; font-size: 12px; word-break: break-all; } code.clip { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; background: #fff; border-radius: var(--radius); }
.table-wrap.tall { max-height: 62vh; }
table { border-collapse: collapse; width: 100%; }
.grid th { background: var(--head); color: #fff; font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.grid tr.total td { font-weight: 700; background: #f8fafc; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid tr.clickable { cursor: pointer; } .grid tr.clickable:hover td { background: #f0f7fc; }
.no-data { text-align: center; color: var(--muted); padding: 22px !important; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 10px; background: #fff; border-radius: 0 0 var(--radius) var(--radius); color: var(--muted); }
.pager select { padding: 3px 6px; }
.report td:first-child { font-weight: 600; }
.small-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* ---------- stay view ---------- */
.stay-head { gap: 10px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.status-legend i, .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.counters { display: flex; gap: 18px; }
.counters div { display: flex; flex-direction: column; align-items: center; color: #15803d; font-weight: 600; font-size: 13px; }
.counters b { background: var(--primary); color: #fff; border-radius: 50%; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; padding: 0 4px; }
.stay-grid { table-layout: fixed; min-width: 900px; }
.stay-grid th { background: var(--head); color: #fff; padding: 8px 4px; font-weight: 500; border-left: 1px solid #56656d; }
.stay-grid th.today { background: var(--primary); }
.stay-grid .rooms-col { width: 190px; }
.stay-grid td { border: 1px solid #edf0f2; height: 40px; padding: 0 6px; }
.stay-grid .group-row td { background: #f3f4f6; font-weight: 600; letter-spacing: .3px; }
.stay-grid .free-count { color: var(--muted); font-size: 11px; text-align: center; font-weight: 400; }
.stay-grid td.free { cursor: pointer; } .stay-grid td.free:hover { background: #eef6fb; }
.room-no { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.hk { background: none; border: 0; cursor: pointer; font-size: 15px; }
.hk.clean { color: #334155; } .hk.dirty { color: #ea580c; }
.bk-cell { padding: 3px !important; }
.bar { width: 100%; border: 0; border-radius: 4px; padding: 7px 8px; color: #111; text-align: left; font: inherit; font-size: 12.5px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar.hit { outline: 3px solid #f59e0b; }
.stay-grid.group .rate { color: #f87171; float: right; }
.stay-grid.group tr.sub td { background: #f8fafc; font-size: 12.5px; }
.banquet td.slot { cursor: pointer; padding: 0; } .banquet td.slot.free:hover { background: #eef6fb; }
.banquet th { font-size: 12px; }

/* ---------- rooms view ---------- */
.rv-section { background: #fff; border-radius: var(--radius); margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rv-head { display: flex; justify-content: space-between; align-items: center; background: #f3f4f6; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
.rv-head h3 { margin: 0; font-weight: 500; font-size: 19px; border-bottom: 3px solid var(--primary); padding-bottom: 6px; }
.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 14px; }
.room-card { border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.12); cursor: pointer; background: #fff; }
.room-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.rc-head { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 16px; }
.rc-body { padding: 8px 10px; min-height: 42px; font-size: 13px; } .rc-body small { display: block; color: var(--muted); }

/* ---------- rate grids ---------- */
.rate-grid { min-width: 1000px; }
.rate-grid th, .rate-grid td { border: 1px solid #edf0f2; padding: 6px 8px; }
.rate-grid thead th { background: var(--head); color: #fff; position: sticky; top: 0; z-index: 2; font-weight: 600; }
.rate-grid tr.dark th, .rate-grid tr.dark td { background: var(--head); color: #fff; }
.rate-grid .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 230px; text-align: left; }
.rate-grid thead .sticky-col, .rate-grid tr.dark .sticky-col { background: var(--head); z-index: 3; }
.rate-grid td.center { text-align: center; }
.rate-in { width: 92px; } .rate-in.dirty { background: #fffbeb; border-color: #f59e0b; } .rate-in.stopsell { outline: 2px solid #dc2626; }
.date-nav { display: flex; align-items: center; gap: 4px; } .date-nav input { width: 140px; }
.switch { width: 38px; height: 20px; border-radius: 10px; border: 0; background: #9ca3af; position: relative; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #7f1d1d; transition: left .15s; }
.switch.on { background: #93c5fd; } .switch.on::after { left: 21px; background: var(--primary); }
.calendar td { height: 76px; vertical-align: top; border: 1px solid var(--line); padding: 6px; font-size: 12px; width: 14.28%; }
.calendar td.today { background: #eff6ff; } .calendar th { padding: 8px; background: #f3f4f6; }
.mapping .ota-col { min-width: 230px; } .mapping .ota-col input { width: 100%; margin: 6px 0; } .ota-name { font-size: 16px; margin-bottom: 6px; }
.mapping td { vertical-align: top; }

/* ---------- misc widgets ---------- */
.seg { display: inline-flex; border-radius: 4px; overflow: hidden; } .seg button { border: 0; padding: 8px 14px; background: var(--primary); color: #fff; cursor: pointer; font: inherit; }
.seg button.on { background: #1e4f6e; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.donut { width: 120px; height: 120px; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; }
.donut::before { content: ""; position: absolute; inset: 22px; background: #fff; border-radius: 50%; }
.donut b { position: relative; font-size: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; justify-content: center; }
.legend i { border-radius: 2px; }
.chart svg { width: 100%; height: auto; } .chart .gl { stroke: #e5e7eb; } .chart .ax { font-size: 10px; fill: #6b7280; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-tile { text-align: center; border: 2px solid #1f2933; margin: 0; } .kpi-tile span { display: block; font-weight: 600; } .kpi-tile b { font-size: 26px; font-weight: 500; } .kpi-tile small { display: block; color: var(--muted); }
.pos-block { margin-bottom: 18px; background: #fff; border-radius: var(--radius); overflow: hidden; }
.pos-head { display: flex; justify-content: space-between; align-items: center; background: #4f7aa0; color: #fff; padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
.pos-head h3 { margin: 0; font-size: 20px; }
.threads { list-style: none; margin: 0; padding: 0; } .threads li { padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; } .threads li:hover { background: #f8fafc; } .threads p { margin: 4px 0 0; color: #374151; }
.chat { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .chat p { margin: 0; padding: 8px 10px; border-radius: 8px; max-width: 80%; }
.chat .guest { background: #f1f5f9; align-self: flex-start; } .chat .hotel { background: #dbeafe; align-self: flex-end; }
.photo-row { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-slot { width: 130px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.photo-slot img, .photo-slot .upload { width: 130px; height: 90px; object-fit: cover; border-radius: 4px; }
.photo-slot .upload { border: 2px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--muted); cursor: pointer; }
.photo-slot .x { position: absolute; top: 4px; right: 4px; background: #dc2626; color: #fff; border: 0; border-radius: 3px; cursor: pointer; }
.be-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stars { display: flex; gap: 4px; margin: 8px 0 14px; } .star { font-size: 28px; background: none; border: 0; color: #cbd5e1; cursor: pointer; } .star.on { color: #f59e0b; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 50; overflow: auto; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 8px; width: min(640px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .modal-head h3 { margin: 0; }
.modal-body { padding: 18px; } .modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #14532d; color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.2); max-width: 380px; }
.toast.err { background: #b91c1c; } .toast.info { background: #1e3a8a; }

/* ---------- sign-in ---------- */
.login-page { background: #d2d6de; display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.login-box { width: 360px; max-width: calc(100% - 32px); }
.login-logo { text-align: center; font-size: 34px; margin-bottom: 20px; } .login-logo a { color: #444; text-decoration: none; }
.login-card { background: #fff; padding: 20px; }
.login-msg { text-align: center; margin: 0 0 16px; color: #555; }
.input-icon { position: relative; margin-bottom: 14px; } .input-icon input { width: 100%; padding-right: 34px; } .input-icon span { position: absolute; right: 10px; top: 8px; color: #777; }
.login-row { display: flex; justify-content: space-between; align-items: center; }
.login-lang { text-align: center; margin-top: 14px; font-size: 13px; }
.login-lang a { color: inherit; }
.login-error { color: #dc2626; min-height: 20px; margin: 10px 0 0; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --side-w: 0px; }
  .brand { width: auto; } .review-link, #user-name { display: none; }
  .sidebar { width: 250px; transform: translateX(-100%); transition: transform .2s; }
  body.collapsed .sidebar { transform: none; }
  .content { padding: 14px 16px 40px; }
  .notice { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
  .topbar { gap: 6px; } .brand { padding: 0 10px; font-size: 17px; }
  .top-actions { gap: 0; } .top-actions > a.icon-btn, .top-actions > [data-act="toggleAdmin"] { display: none; }
}
