/* css/style.css - Housekeeping Hub design system */
/* Deep-navy corporate SaaS look. Plain CSS, mobile-first, desktop-excellent. */

:root {
  --navy: #1a2332; --navy-800: #232f42; --navy-700: #2d3b52;
  --surface: #ffffff; --canvas: #f4f6f9; --border: #e2e7ef;
  --ink: #1f2733; --slate: #556072; --slate-light: #8b95a5;
  --accent: #0e9591; --accent-dark: #0b7673; --accent-soft: #e2f4f3;
  --green: #2f8f5b; --green-soft: #e6f4ec;
  --red: #c0392b; --red-soft: #fbeae8;
  --amber: #b8842b; --amber-soft: #f8f0e0;
  --blue: #2a6f97; --blue-soft: #e6f0f6;
  --grey: #6b7280; --grey-soft: #eef0f3;
  --purple: #6b4c9a; --purple-soft: #efe9f6;
  --shadow: 0 1px 3px rgba(20,30,50,0.08), 0 1px 2px rgba(20,30,50,0.06);
  --shadow-lg: 0 8px 28px rgba(20,30,50,0.14);
  --radius: 8px; --radius-sm: 6px;
  --fs-1: 28px; --fs-2: 20px; --fs-3: 16px; --fs-4: 14px; --fs-5: 12px;
  --sidebar-w: 232px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--canvas); color: var(--ink);
  font-size: var(--fs-3); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* Typography scale */
h1 { font-size: var(--fs-1); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2); font-weight: 600; line-height: 1.3; }
h3 { font-size: var(--fs-3); font-weight: 600; }
.muted { color: var(--slate); }
.small { font-size: var(--fs-4); }
.tiny { font-size: var(--fs-5); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: var(--fs-4); font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, box-shadow .15s, opacity .15s;
  background: var(--navy); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--navy-700); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--canvas); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #a93226; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: var(--fs-5); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: var(--fs-3); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: var(--fs-4); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); margin-bottom: 12px; }

/* Forms */
label { display: block; font-size: var(--fs-4); font-weight: 600; margin-bottom: 6px; color: var(--ink); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: var(--fs-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 140px; }

/* Badges (pill status) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-5); font-weight: 700; text-transform: capitalize; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-grey { background: var(--grey-soft); color: var(--grey); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-4); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--canvas); font-weight: 700; color: var(--slate); position: sticky; top: 0; }
tbody tr:hover { background: var(--canvas); }

/* Toast */
#toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 220px; max-width: 340px; padding: 12px 16px; border-radius: var(--radius-sm); color: #fff; box-shadow: var(--shadow-lg); font-size: var(--fs-4); animation: toast-in .2s ease-out; }
.toast-success { background: var(--green); } .toast-error { background: var(--red); } .toast-info { background: var(--navy-700); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,30,50,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 9000; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; padding: 22px; }
.modal h2 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Skeleton loaders */
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #e2e7ef 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-line { height: 14px; margin: 8px 0; } .skel-card { height: 84px; }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--slate); }
.empty .empty-icon { font-size: 34px; margin-bottom: 8px; }

/* App shell: sidebar (desktop) + bottom tabs (mobile) */
.app { min-height: 100vh; }
.sidebar { display: none; }
.topbar { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 100; }
.topbar .brand { font-weight: 700; font-size: var(--fs-3); }
.topbar .spacer { flex: 1; }
.main { padding: 16px; padding-bottom: 84px; max-width: 1200px; margin: 0 auto; }

/* Page header */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 180px; }
.breadcrumb { font-size: var(--fs-5); color: var(--slate-light); margin-bottom: 4px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .kpi-val { font-size: var(--fs-1); font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.kpi .kpi-val:not(.skeleton) { height: auto !important; width: auto !important; }
.kpi .kpi-label { font-size: var(--fs-5); color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }

/* Room grid */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.room-tile { border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; cursor: pointer; border: 1px solid var(--border); background: #fff; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.room-tile .rn { font-weight: 700; font-size: var(--fs-3); }
.room-tile .rt { font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.st-clean { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.st-dirty { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.st-inprogress { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.st-inspected { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.st-ooo { background: var(--grey-soft); border-color: var(--grey); color: var(--grey); }
.st-dnd { background: var(--purple-soft); border-color: var(--purple); color: var(--purple); }

/* Bottom tab bar (mobile) */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); display: flex; z-index: 100; }
.tabbar a { flex: 1; text-align: center; padding: 8px 2px; font-size: 10px; color: var(--slate); display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 56px; justify-content: center; }
.tabbar a.active { color: var(--accent-dark); font-weight: 700; }
.tabbar .ic { font-size: 18px; }

/* Utility */
.row { display: flex; gap: 12px; align-items: center; } .wrap { flex-wrap: wrap; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}
.grow{flex:1}.right{margin-left:auto}.center{text-align:center}
.hidden { display: none !important; }
.progress { height: 8px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.checkitem { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; min-height: 44px; }
.checkitem input[type=checkbox] { width: 22px; height: 22px; min-height: 22px; }

/* Login split screen */
.auth-wrap { display: flex; min-height: 100vh; }
.auth-brand { display: none; }
.auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }

/* Desktop */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar { display: flex; flex-direction: column; background: var(--navy); color: #fff; min-height: 100vh; position: sticky; top: 0; padding: 16px 10px; }
  .sidebar .brand { font-weight: 700; font-size: var(--fs-2); padding: 8px 12px 16px; }
  .sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: #c7cfdb; font-size: var(--fs-4); font-weight: 600; }
  .sidebar a:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
  .sidebar a.active { background: var(--accent); color: #fff; }
  .sidebar .side-foot { margin-top: auto; padding: 10px 12px; }
  .topbar { display: none; }
  .tabbar { display: none; }
  .main { padding: 28px 32px; padding-bottom: 32px; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .auth-brand { display: flex; flex: 1; background: var(--navy); color: #fff; align-items: center; justify-content: center; flex-direction: column; padding: 40px; text-align: center; }
  .auth-brand h1 { color: #fff; margin-bottom: 12px; }
  .auth-brand p { color: #c7cfdb; max-width: 360px; }
}

/* Print (reports) */
@media print {
  .sidebar, .tabbar, .topbar, .btn, .no-print { display: none !important; }
  body, .main { background: #fff; padding: 0; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .app { display: block; }
}

/* Login page - premium upgrade (brand panel, trust signals, footer) */
.auth-brand-inner { max-width: 380px; text-align: left; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .02em; box-shadow: 0 4px 14px rgba(14,149,145,.4); }
.auth-logo-text { font-weight: 700; font-size: var(--fs-2); color: #fff; }
.auth-points { list-style: none; margin: 24px 0 0; padding: 0; }
.auth-points li { display: flex; align-items: flex-start; gap: 10px; color: #c7cfdb; font-size: var(--fs-4); line-height: 1.45; margin-bottom: 12px; text-align: left; }
.auth-tick { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 999px; background: rgba(14,149,145,.18); color: #7fe3df; font-size: 0; }
.auth-tick::before { content: ""; display: block; width: 6px; height: 10px; border: solid #7fe3df; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }
.auth-secure { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; margin-bottom: 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: var(--fs-5); font-weight: 700; letter-spacing: .02em; }
.auth-lock { display: inline-block; width: 11px; height: 9px; margin-top: 3px; border: 2px solid var(--accent-dark); border-radius: 2px; position: relative; font-size: 0; }
.auth-lock::before { content: ""; position: absolute; left: 50%; top: -6px; width: 7px; height: 7px; border: 2px solid var(--accent-dark); border-bottom: none; border-radius: 6px 6px 0 0; transform: translateX(-50%); }
.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--fs-5); color: var(--slate-light); }
.auth-foot-brand { font-weight: 700; color: var(--slate); }
.auth-foot-sep { color: var(--border); }
.auth-foot a { color: var(--slate); font-weight: 600; }
.auth-foot-note { flex-basis: 100%; margin-top: 8px; color: var(--slate-light); line-height: 1.4; }
.auth-card { box-shadow: var(--shadow-lg); border: 1px solid var(--border); padding: 28px; }
@media (min-width: 900px) {
  .auth-brand { align-items: center; text-align: left; }
  .auth-brand-inner { text-align: left; }
  .auth-brand h1 { font-size: 30px; line-height: 1.2; }
  .auth-card { max-width: 400px; }
}

/* ---- Free trial bar + plan page + branding logo (stage 1) ---- */
.trial-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; font-size: var(--fs-4); font-weight: 600; }
.trial-bar.trial-soon { background: var(--amber-soft); color: var(--amber); }
.trial-bar.trial-ended { background: var(--red-soft); color: var(--red); }
.trial-cta { background: var(--navy); color: #fff !important; padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 700; white-space: nowrap; }
.trial-cta:hover { text-decoration: none; opacity: 0.9; }
.brand-logo { height: 26px; width: auto; vertical-align: middle; margin-right: 8px; border-radius: 4px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.plan-card.featured { border: 2px solid var(--accent); }
.plan-card .plan-price { font-size: 30px; font-weight: 800; color: var(--ink); }
.plan-card .plan-price small { font-size: 14px; font-weight: 500; color: var(--slate); }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.plan-card li::before { content: "\2713"; color: var(--accent); font-weight: 800; margin-right: 8px; }
.plan-card .btn { margin-top: auto; }

/* ---- Housekeeping board / task companion / console (OPERA-style, stage 2) ---- */
.st-pickup { background: #fff7e6; border-color: var(--amber); color: var(--amber); border-style: dashed; }
.st-oos { background: var(--grey-soft); border-color: var(--grey); color: var(--grey); border-style: dashed; }
.room-tile { position: relative; }
.room-tile .rs { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.room-tile .flags { position: absolute; top: 3px; right: 5px; font-size: 11px; line-height: 1; display: flex; gap: 2px; }
.room-tile .fo { position: absolute; top: 3px; left: 5px; font-size: 9px; font-weight: 800; background: rgba(255,255,255,0.85); color: var(--ink); border-radius: 4px; padding: 1px 4px; }
.room-tile.picked-bulk { outline: 3px solid var(--navy); outline-offset: 1px; }
.room-tile.has-disc { box-shadow: inset 0 0 0 2px var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.legend .code { font-weight: 800; margin-right: 3px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: var(--fs-4); font-weight: 600; cursor: pointer; min-height: 38px; color: var(--ink); }
.seg button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.day-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--blue-soft); color: var(--blue);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-weight: 600; font-size: var(--fs-4); }
.bulk-bar { position: sticky; bottom: 70px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius); margin-top: 12px; }
.bulk-bar select { max-width: 180px; min-height: 38px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--accent); }
.kpi-grid.six { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .kpi-grid.six { grid-template-columns: repeat(6, 1fr); } }
.task-card.current { border: 2px solid var(--accent); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.instr { background: var(--amber-soft); color: #7a5617; border-radius: var(--radius-sm); padding: 8px 10px; font-size: var(--fs-4); margin-top: 10px; white-space: pre-wrap; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 22px; color: var(--accent-dark); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.att-card .big { font-size: 26px; font-weight: 800; }
.alert-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--red); background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.sheet { break-inside: avoid; }
.sheet table { width: 100%; border-collapse: collapse; font-size: var(--fs-4); }
.sheet th, .sheet td { border-bottom: 1px solid var(--border); padding: 6px 4px; text-align: left; vertical-align: top; }
@media print {
  .no-print, .sidebar, .topbar, .tabbar, .trial-bar { display: none !important; }
  .sheet { page-break-after: always; border: none !important; }
}
