:root {
  --brand: #0F766E;
  --brand-dark: #115E59;
  --brand-soft: #CCFBF1;
  --brand-tint: #F0FDFA;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --ok: #16A34A;
  --ok-bg: #DCFCE7;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --bad: #DC2626;
  --bad-bg: #FEE2E2;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font-family: inherit; }

/* Top Prototype Bar */
.proto-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: #0F172A; color: #F8FAFC;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.proto-brand { display: flex; align-items: center; gap: 10px; }
.proto-logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff;
  font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.proto-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.proto-badge { font-size: 11px; font-weight: 600; background: rgba(255,255,255,.14); padding: 2px 8px; border-radius: 99px; color: #CCFBF1; }
.proto-sub { font-size: 11.5px; color: #94A3B8; margin-top: 2px; }

.role-tabs { display: flex; gap: 6px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 12px; }
.role-tab {
  border: 0; background: transparent; color: #CBD5E1; padding: 7px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.role-tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.role-tab.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

.proto-actions { display: flex; gap: 8px; }
.btn-outline-sm {
  border: 1px solid rgba(255,255,255,.22); background: transparent; color: #E2E8F0;
  padding: 6px 11px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-outline-sm:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Stage */
.stage { padding: 20px 16px 40px; min-height: calc(100vh - 60px); }

/* Mobile Demo Layout (Phone + Side Guide on Desktop) */
.mobile-stage {
  max-width: 980px; margin: 0 auto;
  display: grid; grid-template-columns: 396px 1fr; gap: 28px; align-items: start;
}
.phone-shell {
  width: 396px; min-height: 760px; max-height: 820px;
  background: #0F172A; border-radius: 44px; padding: 11px;
  box-shadow: 0 24px 60px rgba(15,23,42,.22), 0 0 0 1px rgba(255,255,255,.08) inset;
  position: sticky; top: 76px;
}
.phone-screen {
  background: #F8FAFC; border-radius: 34px; height: 738px;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.phone-screen.dark-screen { background: #0B1220; color: #F8FAFC; }

.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px 6px; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.notch { width: 92px; height: 22px; background: #0F172A; border-radius: 99px; }
.phone-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; }
.phone-body::-webkit-scrollbar { width: 4px; }
.phone-body::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }

.bottom-nav {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--border); padding: 8px 6px 12px; flex-shrink: 0;
}
.nav-item {
  border: 0; background: none; color: #64748B; font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; padding: 2px 0;
}
.nav-item .ni-ic { font-size: 17px; line-height: 1; }
.nav-item.active { color: var(--brand); }

/* Mobile UI Components */
.m-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.m-brand-wrap { display: flex; align-items: center; gap: 10px; }
.m-brand-icon {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.m-brand-name { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.m-brand-loc { font-size: 11.5px; color: var(--muted); }
.m-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; position: relative;
}
.m-dot { width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; position: absolute; top: 6px; right: 7px; }

.m-greet { font-size: 22px; font-weight: 800; margin: 2px 0 2px; }
.m-sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

.m-search-row { display: flex; gap: 6px; margin-bottom: 12px; }
.m-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; background: #fff; color: var(--text); outline: none;
}
.m-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip {
  border: 1px solid var(--border); background: #fff; color: #334155;
  padding: 5px 11px; border-radius: 99px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }

.villa-card {
  background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(15,23,42,.05); margin-bottom: 12px;
}
.villa-img-wrap { position: relative; height: 170px; background: #E2E8F0; overflow: hidden; }
.villa-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-avail {
  position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
}
.badge-photo {
  position: absolute; bottom: 10px; right: 10px; background: rgba(15,23,42,.72); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px;
}
.villa-body { padding: 12px 14px 14px; }
.villa-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.villa-title { font-weight: 800; font-size: 15.5px; }
.villa-rate { font-size: 12.5px; font-weight: 700; color: #0F172A; white-space: nowrap; }
.villa-meta { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.villa-price { font-size: 16px; font-weight: 800; color: var(--brand); }
.villa-price span { font-size: 12px; font-weight: 500; color: var(--muted); }

.m-box {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 13px; margin-bottom: 12px;
}
.m-box-title { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-cell { background: #F8FAFC; border: 1px solid var(--border); border-radius: 11px; padding: 8px; }
.quick-lbl { font-size: 10.5px; color: var(--muted); }
.quick-val { font-size: 12px; font-weight: 800; color: var(--brand); margin-top: 2px; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn-primary {
  border: 0; background: var(--brand); color: #fff; padding: 11px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; transition: .15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary {
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand); padding: 10px 14px;
  border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; text-align: center;
}
.btn-secondary:hover { background: var(--brand-tint); }
.btn-ghost {
  border: 1px solid var(--border); background: #fff; color: #334155; padding: 9px 12px;
  border-radius: 10px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn-danger {
  border: 1px solid #FECACA; background: #FEF2F2; color: #B91C1C; padding: 9px 12px;
  border-radius: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.btn-full { width: 100%; display: block; }

.m-topbar {
  display: flex; align-items: center; gap: 10px; padding: 6px 0 12px;
}
.m-back {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
}
.m-page-title { font-weight: 800; font-size: 16px; flex: 1; text-align: center; margin-right: 34px; }

/* Facilities grid */
.fac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.fac-item {
  border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 9px 6px;
  text-align: center; font-size: 11.5px; font-weight: 700;
}
.fac-item span { display: block; font-size: 16px; margin-bottom: 3px; }

/* Calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-dow { font-size: 11px; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.cal-day {
  height: 36px; border-radius: 10px; border: 1px solid transparent; background: #fff;
  font-size: 12.5px; font-weight: 700; cursor: pointer; color: #0F172A;
}
.cal-day:hover:not(:disabled) { border-color: var(--brand); }
.cal-day.booked { background: #E2E8F0; color: #94A3B8; text-decoration: line-through; cursor: not-allowed; }
.cal-day.selected { background: var(--brand); color: #fff; }
.cal-day.in-range { background: var(--brand-soft); color: var(--brand-dark); }
.cal-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.dot-sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.alert-mint {
  background: var(--brand-soft); color: var(--brand-dark); border-radius: 12px;
  padding: 10px 12px; font-size: 12px; font-weight: 600; margin: 10px 0; display: flex; gap: 8px; align-items: center;
}
.alert-warn {
  background: var(--warn-bg); color: var(--warn); border-radius: 12px;
  padding: 9px 12px; font-size: 12.5px; font-weight: 700; text-align: center; margin-bottom: 10px;
}
.alert-bad {
  background: var(--bad-bg); color: var(--bad); border-radius: 12px;
  padding: 9px 12px; font-size: 12px; font-weight: 600; margin: 8px 0;
}

/* QR & Voucher */
.qr-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 16px; text-align: center; margin-bottom: 12px;
}
.qr-svg-wrap { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.booking-code { font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 800; letter-spacing: 1.5px; margin: 8px 0; }
.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed #E2E8F0; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { color: #0F172A; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.pill-ok { background: var(--ok-bg); color: #166534; }
.pill-warn { background: var(--warn-bg); color: #92400E; }
.pill-info { background: #DBEAFE; color: #1E40AF; }
.pill-bad { background: var(--bad-bg); color: #991B1B; }
.pill-muted { background: #E2E8F0; color: #475569; }

/* In-Stay Tiles */
.instay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.instay-tile {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 13px;
  text-align: left; cursor: pointer; transition: .15s;
}
.instay-tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.instay-ic { font-size: 22px; margin-bottom: 6px; display: block; }
.instay-name { font-weight: 800; font-size: 13px; color: #0F172A; }
.instay-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Staff Dark Scanner */
.scanner-box {
  background: #131E33; border-radius: 20px; padding: 26px 18px; text-align: center;
  border: 1px solid rgba(255,255,255,.08); position: relative; margin-bottom: 12px;
}
.scanner-frame {
  width: 170px; height: 170px; margin: 0 auto; position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #22C55E; border-radius: 18px; background: rgba(255,255,255,.04);
}
.scan-line {
  position: absolute; left: 8px; right: 8px; height: 3px; background: #22C55E;
  box-shadow: 0 0 12px #22C55E; animation: scan 2.2s ease-in-out infinite;
}
@keyframes scan { 0%, 100% { top: 18px; } 50% { top: 148px; } }
.dark-card {
  background: #151F32; border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  padding: 14px; margin-bottom: 12px;
}
.dark-kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: #CBD5E1; }
.dark-kv b { color: #fff; }
.dark-input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
  background: #0F172A; color: #fff; font-size: 13px; font-family: ui-monospace, Consolas, monospace;
}

/* Side Guide Panel on Desktop */
.guide-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px;
  box-shadow: 0 6px 24px rgba(15,23,42,.05);
}
.guide-h { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.guide-p { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.flow-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flow-step {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: #F8FAFC; cursor: pointer; text-align: left; width: 100%;
}
.flow-step:hover { border-color: var(--brand); }
.flow-step.active { background: var(--brand-tint); border-color: var(--brand); }
.flow-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.flow-txt { font-size: 13px; font-weight: 700; color: #0F172A; }
.flow-fr { font-size: 11px; color: var(--muted); margin-left: auto; font-weight: 700; }

.qa-box {
  background: #F8FAFC; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  font-size: 12.5px; line-height: 1.55;
}
.qa-box b { color: #0F172A; }

/* Admin Web Dashboard */
.admin-shell {
  max-width: 1240px; margin: 0 auto; background: #fff; border-radius: 20px;
  border: 1px solid var(--border); box-shadow: 0 10px 36px rgba(15,23,42,.07);
  overflow: hidden; min-height: 700px;
}
.browser-bar {
  background: #1E293B; padding: 10px 16px; display: flex; align-items: center; gap: 12px;
}
.browser-dots { display: flex; gap: 6px; }
.browser-dots span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.browser-url {
  background: #0F172A; color: #CBD5E1; font-size: 12px; padding: 5px 14px; border-radius: 8px;
  font-family: ui-monospace, Consolas, monospace; flex: 1; max-width: 460px;
}
.admin-layout { display: grid; grid-template-columns: 235px 1fr; min-height: 650px; }
.admin-side { border-right: 1px solid var(--border); padding: 18px 14px; background: #fff; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.admin-nav-btn {
  border: 0; background: transparent; color: #475569; padding: 10px 12px; border-radius: 11px;
  text-align: left; font-size: 13.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.admin-nav-btn:hover { background: #F1F5F9; color: #0F172A; }
.admin-nav-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

.admin-main { padding: 24px 28px; background: #F8FAFC; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.admin-h1 { font-size: 22px; font-weight: 800; margin: 0; }
.admin-sub { font-size: 13px; color: var(--muted); margin: 3px 0 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.kpi-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 22px; font-weight: 800; margin-top: 6px; color: #0F172A; }
.kpi-sub { font-size: 11.5px; color: var(--brand); margin-top: 4px; font-weight: 600; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.admin-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; }

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.swatch {
  width: 38px; height: 38px; border-radius: 11px; border: 3px solid transparent; cursor: pointer;
}
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0F172A; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid #F1F5F9;
}
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: #CBD5E1; border-radius: 99px; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider:before { transform: translateX(20px); }

.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th, .adm-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid #E2E8F0; }
.adm-table th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #F8FAFC; }

/* Toast & Modal */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(24px);
  background: #0F172A; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.6); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 150;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 18px; max-width: 440px; width: 100%; padding: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}

/* Responsive */
@media (max-width: 900px) {
  .mobile-stage { grid-template-columns: 1fr; justify-items: center; }
  .phone-shell { position: static; }
  .guide-panel { width: 100%; max-width: 520px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .stage { padding: 10px 8px 28px; }
  .phone-shell { width: 100%; border-radius: 26px; padding: 6px; min-height: 700px; }
  .phone-screen { border-radius: 20px; }
}
