:root {
  --bg: #f4f6f9; --panel: #fff; --text: #1d2433; --muted: #6b7384; --line: #e3e7ee;
  /* SYNTRO brand: cyber cyan #00F2FE, emerald #00FF87, navy #0A2540, charcoal #1B1F23 */
  --brand: #087f8c; --brand-dark: #0A2540; --side: #1B1F23; --side-text: #b8c3cc;
  --brand-cyan: #00F2FE; --brand-emerald: #00FF87; --brand-navy: #0A2540; --brand-grad: linear-gradient(135deg, #00F2FE, #00FF87);
  --ok: #1a9b5b; --warn: #d98a00; --bad: #d63b3b;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
[hidden] { display: none !important; } /* the hidden attribute always wins over a display rule */
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
.spacer { flex: 1; }

.login { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 22px; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(0, 242, 254, .10), transparent 60%), radial-gradient(900px 500px at 90% 100%, rgba(0, 255, 135, .08), transparent 60%), var(--side); }
.login-logo { width: min(360px, 84vw); display: block; position: relative; z-index: 1; }
.login-logo img, .login-logo svg { width: 100%; height: auto; display: block; overflow: visible; }
.login > .card { position: relative; z-index: 1; }
/* SYNTRO motion on the sign-in screen */
.login { position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(60px); opacity: .22; pointer-events: none; }
.login::before { background: radial-gradient(circle, #00F2FE 0, transparent 60%); top: -25vmax; left: -15vmax; animation: glowDrift 18s ease-in-out infinite alternate; }
.login::after { background: radial-gradient(circle, #00FF87 0, transparent 60%); bottom: -30vmax; right: -20vmax; opacity: .14; animation: glowDrift 22s ease-in-out infinite alternate-reverse; }
@keyframes glowDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(12vmax, 8vmax) scale(1.15); } }
.logo-anim .lg-mark { fill-opacity: 0; stroke: url(#sg); stroke-width: 3.2; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: lgDraw 1.5s cubic-bezier(.6, 0, .3, 1) forwards, lgFill .7s ease 1.15s forwards, lgGlow 4s ease-in-out 2.4s infinite alternate; }
.logo-anim .lg-word { clip-path: inset(0 100% 0 0); animation: lgReveal .9s cubic-bezier(.2, .8, .2, 1) 1.05s forwards; }
.logo-anim .lg-tag { opacity: 0; transform: translateY(8px); transform-box: fill-box; animation: lgUp .7s ease 1.6s forwards; }
@keyframes lgDraw { to { stroke-dashoffset: 0; } }
@keyframes lgFill { to { fill-opacity: 1; stroke-width: 0; } }
@keyframes lgReveal { to { clip-path: inset(0 0 0 0); } }
@keyframes lgUp { to { opacity: 1; transform: none; } }
@keyframes lgGlow { from { filter: drop-shadow(0 0 0 rgba(0, 242, 254, 0)); } to { filter: drop-shadow(0 0 10px rgba(0, 242, 254, .45)); } }
.brand-mark { transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .5s ease; }
.sidebar .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 6px rgba(0, 242, 254, .5)); }
.brand-mark { width: 24px; height: 24px; flex-shrink: 0; }
.sidebar .brand { display: flex; align-items: center; gap: 9px; }
.sidebar .brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syntro-tag { font-size: 10px; letter-spacing: .14em; color: #7d8a94; padding: 0 10px 8px; margin-top: -8px; text-transform: uppercase; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 22px; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--side); color: var(--side-text); padding: 14px 10px; overflow-y: auto; position: sticky; top: 0; height: 100vh; height: 100dvh; flex-shrink: 0; }
.sidebar .brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 12px; }
.sidebar .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 4px; color: #6f7a94; }
.sidebar a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--side-text); text-decoration: none; cursor: pointer; }
.sidebar a:hover { background: #262c33; color: #fff; }
.sidebar a.active { background: var(--brand-grad); color: var(--brand-navy); font-weight: 600; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 18px; }
.content { padding: 20px; }
.menu-btn { display: none; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 12px; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:hover { background: #f0f3f9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 3px 8px; font-size: 12px; }

input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search], .toolbar input.filter { max-width: 260px; }
.toolbar input[type=month], .toolbar input[type=date], .toolbar select { width: auto; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: #fafbfd; }
td.actions { text-align: right; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #e9edf5; color: #44506b; }
.badge.ok { background: #dcf3e7; color: #137a47; }
.badge.warn { background: #fdf0d2; color: #94610a; }
.badge.bad { background: #fbe0e0; color: #a82a2a; }
.badge.info { background: #dcf7f9; color: #065f69; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi.bad .value { color: var(--bad); }
.kpi.ok .value { color: var(--ok); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; }
.bars .bar { display: grid; grid-template-columns: 70px 1fr 56px; gap: 8px; align-items: center; margin: 6px 0; font-size: 12px; }
.bar .track { background: #e9edf5; border-radius: 99px; height: 10px; overflow: hidden; }
.bar .fill { background: var(--brand); height: 100%; }

.modal { position: fixed; inset: 0; background: rgba(15, 20, 35, .5); display: grid; place-items: center; padding: 16px; z-index: 20; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 20px; }
.modal-box h3 { margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 30; max-width: 360px; }
.toast.bad { background: var(--bad); }

.invoice-doc h1 { margin: 0 0 4px; }
.invoice-doc .meta { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0; flex-wrap: wrap; }

.nav-close, .nav-shade { display: none; }
.search-btn { display: inline-flex; align-items: center; gap: 6px; }
.search-btn.hidden { display: none !important; }
#pageTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* phone: the top bar keeps to the screen width (title shortens with "…", search shows only its icon) */
@media (max-width: 800px) {
  .topbar { gap: 6px; padding: 8px 10px; }
  .topbar #pageTitle { flex: 1 1 auto; font-size: 16px; }
  .topbar .spacer { display: none; }
  .search-btn .sb-txt { display: none; }
  .topbar .search-btn { min-width: 0; }
  .search-btn, .topbar .bell, .topbar .menu-btn { flex-shrink: 0; padding: 7px 9px; }
  .main { min-width: 0; max-width: 100vw; }
}
@media (max-width: 600px) { #exportBtn { display: none !important; } }
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 15; left: -260px; width: min(260px, 82vw); transition: left .25s cubic-bezier(.2, .8, .2, 1); }
  .sidebar.open { left: 0; box-shadow: 8px 0 30px rgba(0, 0, 0, .35); }
  .nav-close { display: grid; place-items: center; margin-left: auto; width: 34px; height: 34px; border-radius: 8px; border: 1px solid #343b43; background: #262c33; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; flex-shrink: 0; }
  .nav-shade { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(10, 14, 18, .5); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .nav-shade.on { opacity: 1; pointer-events: auto; }
  body.nav-locked { overflow: hidden; }
  .menu-btn { display: inline-block; }
  .content { padding: 12px; }
  #userInfo { display: none; }
}
@media print {
  body * { visibility: hidden; }
  #modalBox, #modalBox * { visibility: visible; }
  .modal { position: static; background: none; padding: 0; }
  #modalBox { position: absolute; left: 0; top: 0; width: 100%; max-width: none; max-height: none; box-shadow: none; }
  .no-print { display: none !important; }
  /* a printed document: only the dialog takes space, on white, so it fits one page */
  html, body { background: #fff !important; height: auto !important; }
  body:has(#modal:not(.hidden)) > *:not(#modal) { display: none !important; }
  body:has(#modal:not(.hidden)) #modal { display: block !important; position: static !important; }
  body:has(#modal:not(.hidden)) #modalBox { position: static !important; overflow: visible !important; animation: none !important; transform: none !important; }
  .receipt { break-inside: avoid; }
}
.receipt-actions { flex-wrap: wrap; }
.share-box { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7fafb; display: grid; gap: 8px; }
.share-box p { font-size: 13px; line-height: 1.5; margin: 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- links, wide modal ---- */
a.lnk { color: var(--brand); text-decoration: none; cursor: pointer; }
a.lnk:hover { text-decoration: underline; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f5f8ff; }
.modal-box.wide { max-width: 860px; }
.brand-logo { max-width: 100%; max-height: 54px; display: block; margin: 0 0 8px 10px; background: #fff; border-radius: 6px; padding: 4px; }
.logo-preview { max-width: 240px; max-height: 100px; display: block; margin: 6px 0; border: 1px dashed var(--line); padding: 6px; border-radius: 6px; background: #fff; }
.photo-preview { max-width: 100%; max-height: 260px; border-radius: 8px; margin-top: 6px; display: block; }
.big-input { font-size: 20px; padding: 12px; }
.reader-card { max-width: 520px; margin: 0 auto 18px; }
.sheet input.amt { width: 150px; text-align: right; }

/* ---- invoice ---- */
.inv { color: #1d2433; font-size: 13px; border-top: 6px solid var(--brand); padding-top: 18px; }
.inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv-brand { display: flex; gap: 14px; align-items: flex-start; }
.inv-brand img { max-width: 130px; max-height: 80px; object-fit: contain; }
.inv-name { font-size: 20px; font-weight: 700; }
.inv-sub { color: #5a6378; margin-top: 2px; line-height: 1.5; }
.inv-title { text-align: right; line-height: 1.6; }
.inv-word { font-size: 28px; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.stamp { display: inline-block; margin-top: 4px; padding: 2px 12px; border: 2px solid; border-radius: 6px; font-weight: 800; letter-spacing: .1em; transform: rotate(-4deg); }
.stamp.ok { color: #137a47; border-color: #137a47; }
.stamp.warn { color: #b3730a; border-color: #b3730a; }
.stamp.bad { color: #a82a2a; border-color: #a82a2a; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.inv-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; line-height: 1.6; }
.inv-box h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b7384; }
table.inv-lines { width: 100%; border-collapse: collapse; }
table.inv-lines th { background: #f2f5fb; text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #4a5470; position: static; }
table.inv-lines td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: normal; }
table.inv-lines .r { text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals { margin-left: auto; width: 320px; max-width: 100%; margin-top: 10px; }
.inv-totals div { display: flex; justify-content: space-between; padding: 5px 10px; }
.inv-totals .grand { background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; border-radius: 6px; margin-top: 4px; }
.inv-totals .due { font-weight: 700; border-top: 1px solid var(--line); }
.inv-foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); color: #5a6378; font-size: 12px; }
.inv-sign { display: flex; justify-content: space-between; margin-top: 46px; color: #5a6378; font-size: 12px; }
.inv-sign span { border-top: 1px solid #9aa3b8; padding-top: 4px; min-width: 150px; text-align: center; }

@media (max-width: 800px) { .inv-parties { grid-template-columns: 1fr; } .inv-title { text-align: left; } }
@page { size: A4; margin: 12mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #modalBox.wide { max-width: none; padding: 0; }
  .inv { font-size: 12.5px; }
}

/* ---- charts ---- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 18px; }
.panel.chart h3 { margin-bottom: 2px; }
.chart .hint { margin-bottom: 8px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg [data-href] { cursor: pointer; }
.chart-svg [data-href]:hover { opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend.vertical { flex-direction: column; gap: 8px; font-size: 13px; color: var(--text); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-wrap .donut { max-width: 170px; }

/* ---- floor plan ---- */
.plan-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.plan-canvas { padding: 8px; overflow: auto; }
.plan-svg { width: 100%; height: auto; min-width: 560px; touch-action: none; }
.plan-svg .unit { cursor: pointer; }
.plan-svg .unit:hover rect:first-child { filter: brightness(.96); }
.plan-side { position: sticky; top: 70px; }
.plan-legend { margin: 0 0 10px; }
table.mini { width: 100%; font-size: 13px; }
table.mini td { padding: 4px 0; border: 0; white-space: normal; }
table.mini td:first-child { color: var(--muted); width: 80px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
@media (max-width: 900px) { .plan-wrap { grid-template-columns: 1fr; } .plan-side { position: static; } }

/* ---- search palette ---- */
.palette { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; z-index: 40; }
.palette-box { background: #fff; width: 100%; max-width: 620px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.palette-box input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 17px; outline: none; }
.pal-list { max-height: 50vh; overflow-y: auto; }
.pal-item { display: flex; gap: 12px; padding: 9px 18px; cursor: pointer; align-items: baseline; }
.pal-item.active, .pal-item:hover { background: #eef3ff; }
.pal-type { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); width: 64px; flex-shrink: 0; }
.pal-foot { padding: 8px 18px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---- mall switcher, offline bar ---- */
.mall-sel { width: auto; max-width: 200px; font-weight: 600; }
.mall-pick { position: fixed; inset: 0; background: var(--bg); z-index: 45; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.mall-pick .card { max-width: 460px; width: 100%; }
.mall-choice { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-top: 10px; font-size: 16px; }
.mall-choice small { display: block; color: var(--muted); font-weight: 400; }
#netBar { position: sticky; top: 0; z-index: 50; background: #dcf7f9; color: #065f69; padding: 6px 16px; font-size: 13px; text-align: center; }
#netBar.warn { background: #fdf0d2; color: #6b4300; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; font-weight: 400; }
.check-list label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.search-btn { min-width: 150px; text-align: left; color: var(--muted); }

/* ---- dashboard grid, menus, alerts, misc ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.dash-grid > .full { grid-column: 1 / -1; }
.dash-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dropdown { position: relative; display: inline-block; }
.menu { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; z-index: 12; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); min-width: 180px; max-height: 320px; overflow-y: auto; }
.menu label.check { padding: 3px 0; font-weight: 400; white-space: nowrap; }
.saved-sel { width: auto; max-width: 170px; }
.bell { position: relative; padding: 6px 10px; }
.bell-count { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
a.bell-item { display: block; padding: 10px 12px; margin-bottom: 6px; border-radius: 8px; border-left: 4px solid var(--brand); background: #f3f6fd; color: var(--text); text-decoration: none; }
a.bell-item.warn { border-left-color: var(--warn); background: #fff8e6; }
a.bell-item.bad { border-left-color: var(--bad); background: #fdeeee; }
a.bell-item:hover { filter: brightness(.97); }
pre.pre { background: #f4f6f9; border-radius: 8px; padding: 10px; font-size: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
@media print {
  .topbar, .sidebar, .toolbar.no-print, #netBar { display: none !important; }
  .main { margin: 0; }
  .panel.inv { border: 0; }
}

/* ---- books: keyboard-first voucher entry, pickers, gateway, trees ---- */
kbd { font: 11px/1 ui-monospace, Consolas, monospace; background: #eef1f7; border: 1px solid #cfd6e4; border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: #44506b; white-space: nowrap; }
kbd.capturing { background: #fff3c4; border-color: #e0a526; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
body.vs-open { overflow: hidden; }
.vs { position: fixed; inset: 0; z-index: 60; background: rgba(17, 22, 36, .55); display: grid; place-items: center; padding: 14px; }
.vs-box { background: #fff; width: 100%; max-width: 980px; max-height: 96vh; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.vs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; background: #1d2a4a; color: #fff; }
.vs-title { font-size: 16px; } .vs-no { margin-left: 8px; opacity: .85; font-weight: 600; }
.vs-types { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.vs-type { background: #2c3b63; color: #cdd7f2; border: 0; border-radius: 5px; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12px; }
.vs-type.on { background: #fff; color: #1d2a4a; font-weight: 700; } .vs-type kbd { background: transparent; border-color: #5b6a93; color: inherit; }
.vs-date { display: flex; align-items: center; gap: 6px; } .vs-date input { width: auto; padding: 3px 6px; }
.vs-head .btn.ghost { color: #fff; }
.vs-main { padding: 14px 16px; overflow-y: auto; flex: 1; }
.vs-top { display: grid; grid-template-columns: 220px 1fr 160px; gap: 10px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.vs-top label { font-weight: 700; } .vs-topamt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.vs-table { width: 100%; border-collapse: collapse; } .vs-table th, .vs-table td { padding: 4px 6px; border: 0; }
.vs-table input { padding: 7px 8px; } .vs-table input.amt { text-align: right; font-variant-numeric: tabular-nums; } .vs-table input.dc { width: 56px; text-align: center; font-weight: 700; cursor: pointer; background: #f4f6fb; }
.vs-meta { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 14px; }
.vs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fafbfd; }
.vs-foot .vs-btns { margin-left: auto; display: flex; gap: 8px; } .vs-foot .ok { color: var(--ok); font-weight: 700; }
.vs-hint { padding: 6px 16px; font-size: 12px; color: var(--muted); background: #f1f4fa; }
.lp-list { position: fixed; z-index: 80; background: #fff; border: 1px solid #b8c3dc; border-radius: 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, .25); max-height: 280px; overflow-y: auto; font-size: 13px; }
.lp-item { display: flex; justify-content: space-between; gap: 14px; padding: 6px 12px; cursor: pointer; } .lp-item small { color: var(--muted); }
.lp-item.active, .lp-item:hover { background: #e4ecff; } .lp-empty, .lp-create { padding: 6px 12px; color: var(--muted); } .lp-create { border-top: 1px solid var(--line); background: #fafbfd; }
.dlg { position: fixed; inset: 0; z-index: 90; background: rgba(17, 22, 36, .45); display: grid; place-items: center; padding: 14px; }
.dlg-box { background: #fff; border-radius: 10px; padding: 18px; width: 100%; max-width: 440px; max-height: 94vh; overflow-y: auto; } .dlg-box form { display: flex; flex-direction: column; gap: 10px; } .dlg-box h3 { margin: 0 0 10px; }
.gateway { max-width: 880px; margin: 0 auto; } .gw-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.gw-sec h4 { margin: 0 0 6px; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.gw-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 6px; cursor: pointer; } .gw-item.on, .gw-item:hover { background: var(--brand); color: #fff; } .gw-item.on kbd, .gw-item:hover kbd { background: transparent; color: #fff; border-color: #9fb4f5; }
table.tree td { padding: 6px 10px; } tr.grp td { background: #f7f9fd; } tr.grp .tg { display: inline-block; width: 16px; cursor: pointer; color: var(--muted); user-select: none; } tr.led td { font-size: 13px; }
tr.hl td { background: #fff7d6 !important; }
.bs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } .bs-cols h4 { margin: 0 0 6px; }
.pl-sec { margin-bottom: 12px; } .pl-h { display: flex; justify-content: space-between; padding: 8px 10px; background: #e9eef9; border-radius: 6px 6px 0 0; }
.pl-sum { display: flex; justify-content: space-between; padding: 9px 12px; margin: 8px 0; background: #fff7e6; border: 1px solid #f0d9a0; border-radius: 6px; } .pl-sum.net { background: #e8f6ee; border-color: #b6dfc6; font-size: 16px; }
@media (max-width: 800px) { .vs-top { grid-template-columns: 1fr; } .vs-meta, .bs-cols { grid-template-columns: 1fr; } }
@media print { .vs, .lp-list, .dlg { display: none !important; } }

/* floor plan: units not placed yet, 2D / 3D switch, stacked 3D view */
.unplaced { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.unplaced-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.seg { display: inline-flex; } .seg .btn { border-radius: 0; } .seg .btn:first-child { border-radius: 8px 0 0 8px; } .seg .btn:last-child { border-radius: 0 8px 8px 0; }
.plan3d-wrap { overflow: hidden; }
.plan3d { position: relative; perspective: 2400px; overflow: hidden; }
.stack3d { position: absolute; left: 50%; transform-style: preserve-3d; transform-origin: 50% 50%; }
.lvl3d { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.lvl3d svg { display: block; filter: drop-shadow(0 18px 18px rgba(20, 30, 60, .18)); }
.lvl3d .unit { cursor: pointer; }
.lvl3d-name { position: absolute; left: 0; top: -44px; font: 700 26px/1.2 inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; white-space: nowrap; }
.lvl3d-name span { font-weight: 400; color: var(--muted); font-size: 20px; }
.sp-detail td { background: var(--bg); }

/* ---------- Bento: tiles rise in one after another, lift on hover; dashboard laid out as a bento grid ---------- */
@keyframes bentoIn { from { opacity: 0; transform: translateY(16px) scale(.975); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
.bento-in { animation: bentoIn .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
.table-wrap.bento-in tbody tr { animation: rowIn .4s ease both; animation-delay: .36s; }
.table-wrap.bento-in tbody tr:nth-child(1) { animation-delay: .12s; } .table-wrap.bento-in tbody tr:nth-child(2) { animation-delay: .15s; }
.table-wrap.bento-in tbody tr:nth-child(3) { animation-delay: .18s; } .table-wrap.bento-in tbody tr:nth-child(4) { animation-delay: .21s; }
.table-wrap.bento-in tbody tr:nth-child(5) { animation-delay: .24s; } .table-wrap.bento-in tbody tr:nth-child(6) { animation-delay: .27s; }
.table-wrap.bento-in tbody tr:nth-child(7) { animation-delay: .30s; } .table-wrap.bento-in tbody tr:nth-child(8) { animation-delay: .33s; }
.kpi, .card, .dash-grid > .panel, .mall-choice, .charts > .panel { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, border-color .25s ease; }
.kpi:hover, .dash-grid > .panel:hover, .charts > .panel:hover, .mall-choice:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -14px rgba(30, 45, 90, .35); border-color: #cfd6e4; }
.kpi { position: relative; overflow: hidden; border-radius: 14px; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-grad); opacity: .85; }
.kpi.ok::before { background: linear-gradient(90deg, var(--ok), #7fd8a9); }
.kpi.bad::before { background: linear-gradient(90deg, var(--bad), #f29b9b); }
.kpi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%); transform: translateX(-120%); transition: transform .8s ease; pointer-events: none; }
.kpi:hover::after { transform: translateX(120%); }
.panel, .table-wrap, .card { border-radius: 14px; }

/* dashboard bento grid: big tiles for the headline numbers and the main chart */
.kpis.bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
.kpis.bento .kpi:nth-child(2), .kpis.bento .kpi:nth-child(4) { grid-column: span 2; }
.kpis.bento .kpi:nth-child(2) .value, .kpis.bento .kpi:nth-child(4) .value { font-size: 30px; }
.kpis.bento .kpi:nth-child(1) { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.kpis.bento .kpi:nth-child(1) .value { font-size: 40px; }
.dash-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; }
.dash-grid > * { grid-column: span 3; }
.dash-grid > .full, .dash-grid > [data-w="kpis"] { grid-column: 1 / -1; }
.dash-grid > [data-w="income"] { grid-column: span 4; }
.dash-grid > [data-w="collections"], .dash-grid > [data-w="occupancy"], .dash-grid > [data-w="aging"], .dash-grid > [data-w="footfall"] { grid-column: span 2; }
@media (max-width: 1100px) {
  .dash-grid > * { grid-column: span 3 !important; }
  .dash-grid > .full, .dash-grid > [data-w="kpis"] { grid-column: 1 / -1 !important; }
}
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > * { grid-column: 1 / -1 !important; }
  .kpis.bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.bento .kpi:nth-child(1) { grid-row: auto; grid-column: span 2; }
}

/* pop-ins: dialogs, toasts, sign-in and mall picker */
.modal:not(.hidden) { animation: fadeIn .2s ease both; }
.modal-box.pop { animation: popIn .32s cubic-bezier(.2, .8, .2, 1) both; }
.toast:not(.hidden) { animation: toastIn .3s cubic-bezier(.2, .8, .2, 1) both; }
#login .card, .mall-pick .card { animation: popIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.mall-pick .mall-choice { animation: bentoIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.mall-pick .mall-choice:nth-of-type(2) { animation-delay: .08s; }
.mall-pick .mall-choice:nth-of-type(3) { animation-delay: .16s; }
.mall-pick .mall-choice:nth-of-type(4) { animation-delay: .24s; }
.sidebar a { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.sidebar a:hover { padding-left: 14px; }
.btn { transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.btn:active { transform: scale(.97); }
.plan-svg .unit rect:first-child { transition: filter .2s ease; }
.plan-svg .unit:hover rect:first-child { filter: brightness(.96) drop-shadow(0 4px 6px rgba(20, 30, 60, .18)); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- organised sidebar: collapsible groups with icons, page finder, breadcrumb ---------- */
.sidebar { width: 248px; display: flex; flex-direction: column; padding: 14px 10px 18px; }
.sidebar .brand { padding: 4px 10px 10px; }
.nav-find { padding: 0 4px 10px; }
.nav-find input { background: #1d2438; border-color: #2a3350; color: #fff; padding: 7px 10px; font-size: 13px; }
.nav-find input::placeholder { color: #7d88a3; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.sidebar a.nav-top { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 6px; }
.nav-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9d1e3; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .2s ease, color .2s ease; }
.nav-head:hover { background: #262c33; color: #fff; }
.nav-head:focus-visible { outline: 2px solid var(--brand); }
.nav-head span { flex: 1; }
.nav-count { font-style: normal; font-size: 11px; color: #7d8a94; background: #262c33; border-radius: 10px; padding: 1px 7px; }
.chev { width: 7px; height: 7px; border-right: 2px solid #6f7a94; border-bottom: 2px solid #6f7a94; transform: rotate(-45deg); transition: transform .25s ease; margin-right: 2px; }
.nav-group.open > .nav-head .chev { transform: rotate(45deg); }
.nav-group.open > .nav-head { color: #fff; }
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1); }
.nav-items > div { overflow: hidden; }
.nav-group.open > .nav-items { grid-template-rows: 1fr; }
.nav-items a { margin-left: 18px; padding: 6px 10px 6px 16px; border-left: 1px solid #2a3350; border-radius: 0 6px 6px 0; font-size: 13.5px; }
.nav-items a.active { border-left-color: var(--brand); }
.nav-group:has(a.active) > .nav-head { color: #fff; }
.nav-group:has(a.active) > .nav-head .nav-ico { color: var(--brand-cyan); opacity: 1; }
/* while searching: only matching groups and pages, all open */
.sidebar.finding .nav-group.nav-none, .sidebar.finding a.nav-miss, .sidebar.finding a.nav-top { display: none; }
.sidebar.finding .nav-group.nav-hit > .nav-items { grid-template-rows: 1fr; }
/* breadcrumb in the header */
.topbar h2 { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb { font-size: 13px; font-weight: 500; color: var(--muted); }
.topbar .crumb-sep { color: #b5bccb; font-weight: 400; }
@media (max-width: 760px) { .topbar .crumb, .topbar .crumb-sep { display: none; } }
.nav-items a:hover { padding-left: 20px; }
.topbar h2 { flex-shrink: 0; overflow: visible; }
.topbar .mall-sel { width: auto; min-width: 0; max-width: 200px; flex-shrink: 1; }
.topbar #userInfo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
.sidebar.finding .nav-group.nav-hit > .nav-head .chev { transform: rotate(45deg); }

/* sidebar: menu scrolls, the signed-in user and Sign out always stay at the bottom */
.sidebar { overflow: hidden; }
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.nav-foot { border-top: 1px solid #30373e; margin-top: 8px; padding-top: 8px; display: grid; gap: 2px; }
.nav-who { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; line-height: 1.3; }
.nav-who:hover, .nav-who.open { background: #262c33; }
.nav-who:focus-visible { outline: 2px solid var(--brand-cyan); }
.nav-who .who-txt { flex: 1; min-width: 0; display: grid; }
.nav-who .chev { transform: rotate(-135deg); margin-top: 4px; }
.nav-who.open .chev { transform: rotate(45deg); margin-top: -4px; }
.nav-acct { display: grid; gap: 2px; padding-bottom: 4px; animation: acctIn .2s ease; }
@keyframes acctIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.nav-who b:not(.chev) { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-who span { color: #7d88a3; font-size: 12px; }
.sidebar .nav-foot a { padding: 6px 10px; font-size: 13px; }
.sidebar .nav-foot a.nav-out:hover { background: #3a1f28; color: #ffb3b3; }
td.wrap { white-space: normal; min-width: 180px; }
.receipt p { line-height: 1.7; font-size: 15px; }

td.actions { white-space: normal; min-width: 150px; }
td.actions .btn { margin: 2px 0; }

/* ---------- agreement generator ---------- */
.agreement { font: 15px/1.65 Georgia, "Times New Roman", serif; color: #111; background: #fff; padding: 28px 36px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.agreement h1 { text-align: center; font-size: 22px; letter-spacing: .08em; margin: 0 0 18px; }
.agreement h3 { font-size: 15px; margin: 18px 0 4px; }
.agreement p { margin: 0 0 10px; text-align: justify; }
.agreement:focus { border-color: var(--brand); }
.agr-sign { width: 100%; margin-top: 40px; border-collapse: collapse; }
.agr-sign td { width: 50%; padding: 18px 10px; vertical-align: top; border: 0; white-space: normal; line-height: 2; }
.agr-missing { background: #fde2e2; color: var(--bad); padding: 0 3px; border-radius: 3px; }
.agr-bar { display: grid; gap: 2px; margin-bottom: 12px; }
.agr-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.agr-edit textarea { font: 13px/1.5 ui-monospace, Consolas, monospace; }
.agr-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.agr-preview { max-height: 70vh; overflow-y: auto; padding: 20px; }
@media (max-width: 1000px) { .agr-edit { grid-template-columns: 1fr; } }
@media print { .agreement { border: 0; padding: 0; } }

/* clickable KPI tiles */
a.kpi-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.kpi-link .kpi-go { position: absolute; right: 12px; bottom: 10px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease; font-size: 16px; }
a.kpi-link:hover .kpi-go, a.kpi-link:focus-visible .kpi-go { opacity: 1; transform: none; color: var(--brand); }
a.kpi-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.agr-logo { text-align: center; margin: 0 0 14px; }
.agr-logo img { max-height: 90px; max-width: 260px; }
/* floor plan: shop details and shape tools */
.mini-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; }
.sales-bars { width: 100%; height: auto; display: block; }
.shape-tools { margin: 10px 0; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; display: grid; gap: 8px; }
.shape-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-svg .vertex:hover { fill: var(--brand); }

/* shop names open the shop; the code sits beside them */
a.shop-link { font-weight: 600; }
.shop-code { font-size: 12px; font-weight: 400; }
.shop-page { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .shop-page { grid-template-columns: 1fr; } }

/* SYNTRO: the sign-in button carries the brand gradient */
.login-card .btn.primary { background: var(--brand-grad); border: 0; color: var(--brand-navy); font-weight: 700; }
.login-card .btn.primary:hover { filter: brightness(1.05); }
