/* PMS interface — design tokens, app shell, components. Class names are shared by all templates. */
:root {
  --bg: #f4f6fb; --panel: #ffffff; --panel-2: #f8fafc; --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --line: #e6e9f0; --line-2: #d6dbe5;
  --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #eef2ff; --accent-ring: rgba(79, 70, 229, .18);
  --ok: #16a34a; --ok-soft: #ecfdf3; --warn: #d97706; --warn-soft: #fffbeb; --err: #dc2626; --err-soft: #fef2f2;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14); --sidebar-w: 240px; --topbar-h: 60px;
  --half: 22px; --row: 42px;
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 22px 0 12px; }
h3 { font-size: 14.5px; font-weight: 650; margin: 18px 0 8px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
details > summary { cursor: pointer; }
::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- app shell: sidebar + top bar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 60; transition: width .18s ease, transform .2s ease; }
.sb-head { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 14px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.sb-collapse { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; box-shadow: none; }
.sb-collapse:hover { background: var(--panel-2); color: var(--text); }
.sb-context { padding: 2px 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.sb-context select { font-size: 13px; padding: 7px 10px; background-color: var(--panel-2); }
.sb-account, .sb-prop { font-size: 13px; color: var(--text-2); padding: 7px 10px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-account { font-weight: 600; }
.sidebar .nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 14px 10px 4px; }
.sidebar .nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; white-space: nowrap; }
.sidebar .nav a .ic { color: #94a3b8; flex: none; transition: color .15s; }
.sidebar .nav a:hover { background: var(--panel-2); color: var(--text); }
.sidebar .nav a:hover .ic { color: var(--text-2); }
.sidebar .nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar .nav a.active .ic { color: var(--accent); }
.shell { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .18s ease; }
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 22px;
  background: rgba(244, 246, 251, .82); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar form { margin: 0; }
.tb-search { position: relative; width: min(420px, 50vw); }
.tb-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.tb-search input[type=search] { padding-left: 38px; min-height: 38px; background: var(--panel); border-color: var(--line); border-radius: 999px; }
.tb-search input[type=search]:focus { background: #fff; }
.tb-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; box-shadow: none; }
.tb-icon:hover { background: var(--panel); color: var(--text); }
#notif-count:not(:empty) { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.tb-user { display: inline-flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; color: var(--text-2); font-weight: 500; }
.tb-user:hover { background: var(--panel); color: var(--text); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  font-size: 13px; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.menu-toggle { display: none; background: none; border: 0; color: var(--text-2); padding: 6px; border-radius: 8px; box-shadow: none; }
.menu-toggle:hover { background: var(--panel); }
.sb-backdrop { display: none; }
main { padding: 24px 28px 40px; max-width: 1480px; margin: 0 auto; }
main.wide { max-width: none; }
body.guest main { padding-top: 0; }

/* collapsed sidebar (desktop) */
.sb-collapsed { --sidebar-w: 72px; }
.sb-collapsed .brand span, .sb-collapsed .sidebar .nav a span, .sb-collapsed .nav-group, .sb-collapsed .sb-context { display: none; }
.sb-collapsed .sb-head { flex-direction: column; justify-content: center; gap: 6px; height: auto; padding: 14px 0; }
.sb-collapsed .sidebar .nav a { justify-content: center; padding: 10px; }
.sb-collapsed .sidebar .nav { padding-top: 8px; }

/* phones and tablets: off-canvas sidebar */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); width: 272px; box-shadow: var(--shadow-lg); }
  .sb-collapsed .sidebar .nav a span, .sb-collapsed .brand span, .sb-collapsed .nav-group, .sb-collapsed .sb-context { display: revert; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 55; }
  .sb-collapse { display: none; }
  .shell, .sb-collapsed .shell { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .tb-name { display: none; }
  .tb-search { width: auto; flex: 1; min-width: 0; max-width: none; }
  .topbar .spacer { display: none; }  /* the search takes the free width, not half of it */
  main { padding: 16px 14px 32px; }
  h1 { font-size: 21px; }
}

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
  box-shadow: var(--shadow); }
.card > table.list:only-child, .card > .table-wrap:only-child { margin: -6px -8px; width: calc(100% + 16px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 18px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid > .wide { grid-column: span 2; }  /* long names (rooms like «Altyn City 25.4.62.11») must not be cut */
@media (max-width: 560px) { .grid > .wide { grid-column: auto; } }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
label.inline { display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; font-weight: 400; margin: 4px 16px 4px 0; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=url],
input[type=time], input[type=datetime-local], input[type=color], input[type=file], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit;
  color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #9aa4b5; }
input:hover, select:hover, textarea:hover { border-color: #c3cad8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
select[multiple] { min-height: 100px; background-image: none; padding-right: 12px; }
input[type=color] { padding: 4px; height: 40px; }
input[type=file] { padding: 6px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 2px; min-width: 0; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.req::after { content: " *"; color: var(--err); }

/* buttons: primary (default), .light = secondary, .danger, .small */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; min-height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .25); }
button:hover, .btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.btn.light, button.light { background: #fff; color: var(--text-2); border-color: var(--line-2); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn.light:hover, button.light:hover { background: var(--panel-2); color: var(--text); border-color: #c3cad8; }
.btn.danger, button.danger { background: #fff; color: var(--err); border-color: #f5c2c2; box-shadow: none; }
.btn.danger:hover, button.danger:hover { background: var(--err-soft); color: #b91c1c; border-color: #ef9a9a; }
.btn.small, button.small { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- tables */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2);
  position: sticky; top: var(--topbar-h); z-index: 1; white-space: nowrap; }
table.list tr:first-child th:first-child { border-top-left-radius: var(--radius-sm); }
table.list tr:first-child th:last-child { border-top-right-radius: var(--radius-sm); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fafbff; }
table.list tfoot td { font-weight: 650; background: var(--panel-2); border-top: 1px solid var(--line); }
table.list td a { font-weight: 500; }
table.list td:first-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.table-wrap table.list th { top: 0; }

/* ---------------------------------------------------------------- feedback */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert.ok { background: var(--ok-soft); border-color: #bbf0cf; color: #14532d; }
.alert.error { background: var(--err-soft); border-color: #fbcaca; color: #7f1d1d; }
.alert.warn { background: var(--warn-soft); border-color: #fde3a7; color: #78350f; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--panel-2); color: var(--text-2); vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 500; margin: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- navigation inside pages */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.layout-side { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.side.card { padding: 10px; position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
.side a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
.side a:hover { background: var(--panel-2); color: var(--text); }
.side a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 14px 10px 4px; }
.side .group:first-child { margin-top: 4px; }
@media (max-width: 960px) { .layout-side { grid-template-columns: 1fr; } .side.card { position: static; max-height: none; } }
details.filters summary { color: var(--accent); font-weight: 500; margin: 6px 0 10px; }
.pager { margin-top: 14px; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- numbers */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; align-items: stretch; }
.stats > .row { align-self: center; margin-left: auto; }
.stats > .spacer { flex: 1 1 0; }
.stat { flex: 1 1 140px; max-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat span a { color: var(--muted); }
.stat span a:hover { color: var(--accent); }
.total-box { border-collapse: collapse; width: 100%; }
.total-box td { padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.total-box tr:last-child td { border-bottom: 0; }
.total-box .grand td { font-weight: 700; font-size: 15px; border-top: 1px solid var(--line); border-bottom: 0; padding-top: 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- sign in / sign up */
body.guest { background: radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0%, transparent 60%),
  radial-gradient(900px 500px at 110% 10%, #ede9fe 0%, transparent 55%), var(--bg); min-height: 100vh; }
.login-box { max-width: 420px; margin: 8vh auto 40px; padding: 32px; border-radius: 18px; box-shadow: var(--shadow-lg); border-color: transparent; }
.login-box::before { content: ""; display: block; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  background: url("/static/icons/icon-192.png") center / cover; }
.login-box h1 { font-size: 22px; }
.login-box .actions button { flex: 1; }

/* ---------------------------------------------------------------- calendar (chessboard) */
.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar input, .cal-toolbar select { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.cal-toolbar .btn.small { min-width: 34px; }
.cal { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 250px);
  box-shadow: var(--shadow); }
.cal-grid { display: grid; min-width: max-content; }
.cal-head { position: sticky; top: 0; z-index: 4; background: #fbfcfe; }
.cal-roomcol { position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid var(--line); padding: 6px 12px;
  width: 190px; min-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; font-weight: 500; }
.cal-roomcol a { color: var(--text); }
.cal-roomcol .sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.cal-corner { position: sticky; left: 0; top: 0; z-index: 6; background: #fbfcfe; font-weight: 650; color: var(--text-2); }
.cal-day { text-align: center; font-size: 11px; color: var(--muted); border-right: 1px solid #eef1f6; border-bottom: 1px solid var(--line); padding: 4px 0;
  line-height: 1.35; }
.cal-day.we { background: #f7f8fc; color: #8a94a8; }
.cal-day.today { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cal-group { background: #f8fafc; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 6px 12px; position: sticky; left: 0; border-bottom: 1px solid var(--line); }
.cal-row { display: grid; position: relative; border-bottom: 1px solid #eef1f6; }
.cal-cell { border-right: 1px solid #f1f3f8; min-height: var(--row); cursor: cell; }
.cal-cell:hover { background: #f5f7ff; }
.cal-cell.we { background: #fafbfd; }
.cal-cell.today { background: #f6f7ff; }
.cal-cell.sel { background: #c7d2fe !important; }
.bar { margin: 5px 1px; border-radius: 8px; padding: 0 6px; font-size: 12px; font-weight: 600; line-height: 30px; height: 30px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 2; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), inset 0 0 0 1px rgba(255, 255, 255, .18);
  transition: transform .12s, box-shadow .12s; }
.bar:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .18); color: inherit; }
.bar.closure { background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 6px, #e2e8f0 6px, #e2e8f0 12px) !important; color: #334155 !important; }
.bar.conflict { outline: 2px solid var(--err); outline-offset: -2px; }
.bar .buffer { opacity: .5; }
.bar.unpaid::after { content: " ₸?"; font-weight: 800; }
.free-row .cal-cell { min-height: 26px; font-size: 11px; text-align: center; color: var(--muted); cursor: default; line-height: 26px; }
.free-row .cal-cell:hover { background: none; }
.cal-pop { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 14px 16px; z-index: 100; min-width: 250px; }
.cal-pop .actions { margin-top: 10px; }
.clean-dirty { color: var(--err); }
.clean-cleaning { color: var(--warn); }
.clean-clean { color: var(--ok); }

/* inline edit rows: each row is its own <form> */
.edit-head, .edit-row { display: grid; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.edit-head { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.edit-row:last-child { border-bottom: 0; }
.edit-row input[type=checkbox] { justify-self: start; }
@media (max-width: 960px) { .edit-head { display: none; } .edit-row { grid-template-columns: 1fr 1fr !important; } }

/* price calendar */
table.pricecal { border-collapse: separate; border-spacing: 0; background: #fff; font-size: 12px; }
table.pricecal th, table.pricecal td { border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; padding: 4px 4px; text-align: center; min-width: 58px; }
table.pricecal th { background: #fbfcfe; font-weight: 600; color: var(--muted); position: sticky; top: 0; z-index: 2; }
table.pricecal .sticky { position: sticky; left: 0; background: #fff; text-align: left; min-width: 160px; z-index: 3; padding: 6px 12px; }
table.pricecal th.sticky { z-index: 4; background: #fbfcfe; }
table.pricecal .we { background: #f7f8fc; }
table.pricecal th.today { background: var(--accent-soft); color: var(--accent); }
table.pricecal td.pc { cursor: pointer; line-height: 1.2; transition: background .1s; }
table.pricecal td.pc:hover { background: #f1f4ff; }
table.pricecal td.pc.sel { background: #c7d2fe; }
table.pricecal td.pc.closed { background: #fde8e8; }
table.pricecal .p { display: block; font-weight: 650; color: var(--text); }
table.pricecal .p.muted { color: #a3acbd; font-weight: 500; }
table.pricecal .r { display: block; font-size: 10px; color: var(--muted); min-height: 12px; }

/* phone screens */
.card.mob { padding: 16px; margin-bottom: 12px; }
.mob-actions { margin-top: 12px; gap: 8px; }
.mob-actions form { display: inline; }
.mob-actions .btn, .mob-actions button { padding: 10px 16px; font-size: 15px; min-height: 44px; }

/* a page heading in a row with buttons */
.row > h1:first-child { margin-bottom: 0; }
.row:has(> h1:first-child) { margin-bottom: 18px; }
