/* Aptly — modern glass UI, mobile-first. Light/dark, gradient accent, tasteful motion. */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 13px;
  --font-size-btn: 14px;
  --accent1: #6366f1; --accent2: #a855f7;
  --grad: linear-gradient(135deg, var(--accent1), var(--accent2));
  --bg: #f3f4fb; --text: #171a2b; --muted: #6b7190;
  --surface: rgba(255, 255, 255, 0.66); --surface-solid: #ffffff;
  --border: rgba(23, 26, 43, 0.08); --shadow: 0 8px 30px rgba(23, 26, 43, 0.08);
  --ok: #10b981; --warn: #f59e0b; --danger: #ef4444;
  --radius: 18px;
}
[data-theme="dark"] {
  --bg: #0d0f1c; --text: #eceefb; --muted: #8f95b5;
  --surface: rgba(26, 29, 51, 0.6); --surface-solid: #171a2e;
  --border: rgba(236, 238, 251, 0.09); --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1c; --text: #eceefb; --muted: #8f95b5;
    --surface: rgba(26, 29, 51, 0.6); --surface-solid: #171a2e;
    --border: rgba(236, 238, 251, 0.09); --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--font-size-base); background: var(--bg); color: var(--text);
  min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom));
  position: relative;
  isolation: isolate;
}

.nav-loader {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -10px);
  width: min(92vw, 640px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.24s ease;
}

.nav-loader.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.nav-loader-bar {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-loader-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2397bf, #45c3df);
  box-shadow: 0 0 12px rgba(69, 195, 223, 0.65);
  transition: width 0.16s linear;
}

.nav-loader-quote {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: var(--shadow);
}

.is-nav-loading .topbar,
.is-nav-loading .page {
  filter: saturate(0.96);
}

@media (max-width: 760px) {
  .nav-loader {
    top: 6px;
    width: calc(100vw - 16px);
  }

  .nav-loader-quote {
    font-size: 11.5px;
    padding: 7px 10px;
  }
}

/* ambient animated gradient blobs */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-fx::before, .bg-fx::after {
  content: ''; position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.16; animation: drift 26s ease-in-out infinite alternate;
}
.bg-fx::before { background: var(--accent1); top: -20vmax; right: -15vmax; }
.bg-fx::after { background: var(--accent2); bottom: -25vmax; left: -15vmax; animation-delay: -13s; }
@keyframes drift { to { transform: translate(6vmax, 5vmax) scale(1.15); } }

/* subtle thematic icons: housing, rental, travel, finance */
.bg-icons {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: rgba(99, 102, 241, 0.24);
  animation: floatIcon 16s ease-in-out infinite;
}

.bg-icon::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0.05) 45%, rgba(99, 102, 241, 0) 75%);
  filter: blur(7px);
  animation: glowPulse 8s ease-in-out infinite;
  z-index: -1;
}

.bg-icon .bg-mark {
  width: 100% !important;
  height: 100% !important;
  stroke-width: 1.7;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.18));
}

.bg-icon.i1 { left: 4%; top: 8%; animation-duration: 15s; }
.bg-icon.i2 { left: 18%; top: 28%; animation-duration: 18s; animation-delay: -3s; }
.bg-icon.i3 { left: 34%; top: 12%; animation-duration: 17s; animation-delay: -6s; }
.bg-icon.i4 { left: 48%; top: 34%; animation-duration: 19s; animation-delay: -4s; }
.bg-icon.i5 { left: 64%; top: 16%; animation-duration: 16s; animation-delay: -8s; }
.bg-icon.i6 { left: 79%; top: 31%; animation-duration: 20s; animation-delay: -2s; }
.bg-icon.i7 { left: 90%; top: 10%; animation-duration: 14s; animation-delay: -9s; }
.bg-icon.i8 { left: 10%; top: 62%; animation-duration: 18s; animation-delay: -7s; }
.bg-icon.i9 { left: 26%; top: 76%; animation-duration: 15s; animation-delay: -5s; }
.bg-icon.i10 { left: 43%; top: 64%; animation-duration: 17s; animation-delay: -1s; }
.bg-icon.i11 { left: 68%; top: 73%; animation-duration: 19s; animation-delay: -10s; }
.bg-icon.i12 { left: 86%; top: 61%; animation-duration: 16s; animation-delay: -12s; }

@keyframes floatIcon {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(-6px, -10px, 0) rotate(-3deg); }
  50% { transform: translate3d(8px, -4px, 0) rotate(2deg); }
  75% { transform: translate3d(-4px, 8px, 0) rotate(-1.5deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.32; transform: scale(0.95); }
  50% { opacity: 0.56; transform: scale(1.08); }
}

[data-theme='dark'] .bg-icon {
  color: rgba(165, 180, 252, 0.48);
}

[data-theme='dark'] .bg-icon::after {
  background: radial-gradient(circle, rgba(165, 180, 252, 0.24) 0%, rgba(165, 180, 252, 0.08) 45%, rgba(165, 180, 252, 0) 75%);
}

[data-theme='dark'] .bg-icon .bg-mark {
  opacity: 0.95;
  filter: drop-shadow(0 0 9px rgba(165, 180, 252, 0.34));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .bg-icon {
    color: rgba(165, 180, 252, 0.48);
  }
  :root:not([data-theme='light']) .bg-icon::after {
    background: radial-gradient(circle, rgba(165, 180, 252, 0.24) 0%, rgba(165, 180, 252, 0.08) 45%, rgba(165, 180, 252, 0) 75%);
  }
  :root:not([data-theme='light']) .bg-icon .bg-mark {
    opacity: 0.95;
    filter: drop-shadow(0 0 9px rgba(165, 180, 252, 0.34));
  }
}

.glass { background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--border); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; font-weight: 800; font-size: 19px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand-note {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.72;
  align-self: flex-end;
  margin-left: -4px;
  margin-bottom: 2px;
}
.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(150deg, #7a2f3a, #5b1f2a);
  color: #fff;
  box-shadow: 0 3px 10px rgba(66, 20, 30, 0.28);
  isolation: isolate;
}
.logo::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  z-index: -1;
}
.logo::after {
  content: none;
}
.logo-roof {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 14px;
  color: #f6f7f8;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
  z-index: 3;
}
.logo-roof svg { width: 100%; height: 100%; display: block; opacity: 0.98; }

[data-theme='dark'] .logo {
  background: linear-gradient(150deg, #6a2530, #45131d);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

.topbar,
.shell,
.auth-wrap,
.bottomnav {
  position: relative;
  z-index: 1;
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-left: auto; }

body.mode-short .page-title { text-shadow: 0 0 0 rgba(0,0,0,0); }
body.mode-short .kpi:not(.ok):not(.danger):not(.warn):not(.neutral)::before { background: linear-gradient(135deg, #2397bf, #45c3df); }
body.mode-long .kpi:not(.ok):not(.danger):not(.warn):not(.neutral)::before { background: linear-gradient(135deg, #2f8756, #64b085); }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.chip:hover { transform: translateY(-1px); }

/* shell: sidebar on desktop, hidden on mobile */
.shell { display: grid; grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto; }
.sidenav { display: none; }
@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .shell { grid-template-columns: 220px 1fr; gap: 24px; padding: 24px; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; border-radius: var(--radius); padding: 12px; height: fit-content; position: sticky; top: 76px; }
  .bottomnav { display: none !important; }
}
@media (max-width: 760px) {
}
.side-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: all 0.18s ease; }
.side-item:hover { color: var(--text); background: rgba(99, 102, 241, 0.08); }
.side-item.active { color: #fff; background: var(--grad); box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.side-sep { height: 1px; background: var(--border); margin: 10px 12px; }
.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.nav-mode-dot {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

/* bottom nav (mobile) */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: 4px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 4px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; transition: all 0.18s ease; }
.bn-item.active { color: var(--accent1); }
.bn-item.active .ico { filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.5)); }
.bn-item > span,
.bn-item .nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bn-item .nav-label {
  justify-content: center;
  gap: 4px;
}

/* FAB + quick action sheet */
.fab { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border: none; border-radius: 50%; background: var(--grad); color: #fff; cursor: pointer; box-shadow: 0 8px 22px rgba(99, 102, 241, 0.5); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fab:active { transform: scale(0.92); }
.fab.open { transform: rotate(45deg); }
.sheet { position: fixed; left: 50%; transform: translate(-50%, 12px) scale(0.95); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 25; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 18px; box-shadow: var(--shadow); min-width: 240px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 1.2, 0.4, 1); }
.sheet.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background 0.15s; }
.sheet a:hover { background: rgba(99, 102, 241, 0.08); }
.sheet a .ico { color: var(--accent1); }
@media (min-width: 900px) { .fab, .sheet { display: none; } }

/* page */
.page { padding: 18px 16px 30px; max-width: 860px; width: min(100%, 860px); margin: 0 auto; }
.page > * { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.page > *:nth-child(2) { animation-delay: 0.05s; } .page > *:nth-child(3) { animation-delay: 0.1s; }
.page > *:nth-child(4) { animation-delay: 0.15s; } .page > *:nth-child(5) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-title { font-size: clamp(22px, 6vw, 26px); font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 16px; }
.page > .page-title {
  text-align: center;
}
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 2px 10px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

div.section-head {
  margin-bottom: 14px;
}

div.section-head .page-title {
  margin: 0;
}
.backlink { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.backlink:hover { color: var(--accent1); }
.muted { color: var(--muted); } .small { font-size: 12.5px; }

.mode-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
  position: relative;
  overflow: visible;
}
.mode-section.long,
.mode-section.short {
  background: var(--surface);
  border-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mode-section > .card:last-child { margin-bottom: 0; }
.mode-section .section-title { margin-top: 8px; }

.mode-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  box-shadow: 0 8px 20px rgba(23, 26, 43, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  z-index: 2;
  color: var(--slot-text, currentColor);
  border: 1px solid var(--slot-ring, rgba(99, 102, 241, 0.45));
  background: var(--slot-bg, linear-gradient(135deg, rgba(210, 212, 255, 0.78), rgba(178, 183, 255, 0.62)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 20px var(--slot-shadow, rgba(23, 26, 43, 0.16));
}
.mode-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  vertical-align: middle;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: var(--slot-text, currentColor);
  border: 1px solid var(--slot-ring, rgba(99, 102, 241, 0.45));
  background: var(--slot-bg, linear-gradient(135deg, rgba(210, 212, 255, 0.78), rgba(178, 183, 255, 0.62)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 4px 12px var(--slot-shadow, rgba(23, 26, 43, 0.16));
}
.mode-dot.short,
.mode-pin.short {
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, rgba(210, 212, 255, 0.78), rgba(178, 183, 255, 0.62));
}
.mode-dot.long,
.mode-pin.long {
  color: #9a6a00;
  border: 1px solid rgba(220, 177, 68, 0.55);
  background: linear-gradient(135deg, rgba(255, 244, 191, 0.8), rgba(255, 230, 143, 0.64));
}
[data-theme="dark"] .mode-dot.short,
[data-theme="dark"] .mode-pin.short {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.56);
  background: linear-gradient(135deg, rgba(42, 38, 97, 0.82), rgba(61, 56, 132, 0.74));
}
[data-theme="dark"] .mode-dot.long,
[data-theme="dark"] .mode-pin.long {
  color: #ffe08a;
  border-color: rgba(231, 186, 76, 0.58);
  background: linear-gradient(135deg, rgba(86, 62, 12, 0.76), rgba(120, 87, 20, 0.7));
}

/* cards */
.card { border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(99, 102, 241, 0.18); }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.prop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prop-head h2 { font-size: 17px; margin: 0; }

/* icons */
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* charts */
.charts { margin-bottom: 14px; }
.charts .card { margin-bottom: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart-compact { max-width: 420px; margin: 0 auto; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: barIn 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes barIn { from { transform: scaleY(0); } }
.chart .base { stroke: var(--border); stroke-width: 1; }
.chart .bar2 { fill: rgba(107, 113, 144, 0.22); }
.chart .ax { fill: var(--muted); font-size: 9px; font-weight: 600; }
.chart .lbl { fill: var(--text); font-size: 8px; font-weight: 700; animation: lblIn 0.4s ease both; }
@keyframes lblIn { from { opacity: 0; } }
.donut { max-width: 158px; margin: 0 auto; }
.donut .track { fill: none; stroke: var(--border); stroke-width: 12; }
.donut .val { fill: none; stroke-width: 12; stroke-linecap: round; animation: donutIn 1s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes donutIn { from { stroke-dashoffset: var(--c); } }
.don-big { fill: var(--text); font-size: 21px; font-weight: 800; }
.don-sub { fill: var(--muted); font-size: 10.5px; font-weight: 600; }

/* auth pages */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-align: center; margin: 0 0 14px; }

/* seasonal price grid */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }

/* occupancy calendar */
.cal-wrap { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cal-h { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; text-transform: capitalize; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-d { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--muted); background: rgba(107, 113, 144, 0.08); }
.cal-d.off { background: transparent; }
.cal-d.bk { background: var(--grad); color: #fff; }
.cal-d.today { outline: 2px solid var(--accent1); outline-offset: -2px; }
.cal-d.demo { display: inline-grid; width: 16px; aspect-ratio: 1; vertical-align: middle; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
.kpi { border-radius: var(--radius); padding: 14px 12px; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: 0.7; }
.kpi.ok::before { background: var(--ok); } .kpi.danger::before { background: var(--danger); } .kpi.warn::before { background: var(--warn); }
.kpi.neutral::before { background: color-mix(in srgb, var(--muted) 72%, transparent); }
.kpi-link,
.kpi-link:visited,
.kpi-link:hover,
.kpi-link:focus,
.kpi-link:active {
  display: block;
  color: inherit;
  text-decoration: none;
}
.kpi-link * { text-decoration: none !important; }
.kpi-link { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.kpi-link:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(23, 26, 43, 0.14); }
.kpi-ico { color: var(--accent1); margin-bottom: 5px; }
.kpi.ok .kpi-ico { color: var(--ok); } .kpi.danger .kpi-ico { color: var(--danger); } .kpi.warn .kpi-ico { color: var(--warn); }
.kpi-value { font-size: clamp(16px, 4.5vw, 24px); font-weight: 800; letter-spacing: -0.02em; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.kpi-sub { font-size: 10.5px; color: var(--muted); }



/* quick actions */
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.section-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-cta .btn {
  min-height: 36px;
  padding: 7px 12px;
}

/* page headers */
.page-head,
.section-head {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative;
}

.page-head {
  width: 100%;
}

.page-head .page-title,
.section-head .page-title {
  margin: 0;
  text-align: center;
}

.page-actions {
  display: none;
}

/* dashboard hero */
.home-hero {
  margin-bottom: 14px;
  padding: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.home-hero-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.home-hero-tones {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.home-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.home-shortcuts .btn,
.section-cta .btn {
  min-height: 30px;
  padding: 6px 11px;
  font-size: 12.5px;
}

.home-attention-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.home-attention-quick .attention-chip {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-color: color-mix(in srgb, var(--border) 68%, transparent);
  box-shadow: 0 8px 20px rgba(23, 26, 43, 0.08);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

.home-attention-quick .attention-chip.tone-danger {
  background: color-mix(in srgb, rgba(239, 68, 68, 0.16) 22%, var(--surface) 78%);
  border-color: rgba(239, 68, 68, 0.28);
}

.home-attention-quick .attention-chip.tone-warn {
  background: color-mix(in srgb, rgba(245, 158, 11, 0.16) 22%, var(--surface) 78%);
  border-color: rgba(245, 158, 11, 0.28);
}

.home-attention-quick .attention-chip.tone-ok {
  background: color-mix(in srgb, rgba(16, 185, 129, 0.16) 22%, var(--surface) 78%);
  border-color: rgba(16, 185, 129, 0.28);
}

.home-attention-quick .attention-chip .attention-count {
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.home-attention-quick .attention-chip .attention-ico,
.home-attention-quick .attention-chip .ico {
  display: block;
}

[data-theme='dark'] .home-attention-quick .attention-chip .attention-count {
  background: rgba(255, 255, 255, 0.1);
}

/* attention overview */
.attention-panel {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 16px;
  font-size: 14.5px;
}

.attention-page-end {
  margin-top: 18px;
}

.attention-sections {
  display: grid;
  gap: 10px;
}

.attention-section {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.attention-section.tone-danger { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08); }
.attention-section.tone-warn { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08); }
.attention-section.tone-ok { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08); }

.attention-chip,
.attention-state-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.attention-chip {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
}

.attention-chip:hover { transform: translateY(-1px); }

.attention-panel .tone-queue .queue-item a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  font-size: inherit;
  line-height: 1.35;
}

.attention-chip .attention-ico,
.attention-state-ico,
.attention-inline-ico {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.attention-chip .attention-ico,
.attention-inline-ico {
  width: 16px;
  height: 16px;
}

.attention-inline-ico {
  margin-left: 1px;
}

.attention-chip.tone-danger .attention-ico,
.attention-inline-ico.tone-danger {
  color: var(--danger);
}

.attention-chip.tone-warn .attention-ico,
.attention-inline-ico.tone-warn {
  color: #d97706;
}

.attention-chip.tone-ok .attention-ico,
.attention-inline-ico.tone-ok {
  color: var(--ok);
}

.attention-label {
  text-transform: capitalize;
  font-size: 12.5px;
  font-weight: 700;
}

.attention-count,
.attention-state-count {
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.attention-state-count {
  margin-left: auto;
}

.attention-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.queue { list-style: none; margin: 0; padding: 0; }
.queue li + li { border-top: 1px solid var(--border); }
.queue a { display: flex; align-items: center; gap: 10px; padding: 13px 4px; color: inherit; text-decoration: none; transition: background 0.15s; border-radius: 10px; }
.queue a:hover { background: rgba(99, 102, 241, 0.06); }
.queue a span:first-of-type { flex: 1; }
.chev { color: var(--muted); font-size: 18px; }

.tone-queue .queue-item {
  border-left: 3px solid transparent;
  border-radius: 12px;
  margin-bottom: 6px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.tone-queue .queue-item:last-child { margin-bottom: 0; }
.tone-queue .queue-item + .queue-item { border-top: 1px solid var(--border); }
.tone-queue .queue-item.tone-danger { border-left-color: var(--danger); }
.tone-queue .queue-item.tone-warn { border-left-color: var(--warn); }
.tone-queue .queue-item.tone-ok { border-left-color: var(--ok); }
.tone-queue .queue-item.tone-neutral { border-left-color: color-mix(in srgb, var(--muted) 58%, transparent); }
.tone-queue .queue-item a { padding: 12px 10px; }
.tone-queue .queue-item a:hover { background: color-mix(in srgb, var(--accent1) 10%, transparent); }

@media (max-width: 760px) {
  .topbar {
    padding: 10px 12px;
    align-items: flex-start;
  }

  .brand {
    width: 100%;
    font-size: 17px;
  }

  .brand-note {
    font-size: 8px;
  }

  .logo {
    width: 32px;
    height: 32px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .chip {
    padding: 5px 10px;
    font-size: 12px;
  }

  .page {
    padding: 16px 12px 30px;
  }

  .home-hero { padding: 12px; }
  .home-attention-quick { margin-top: 8px; }
  .section-cta { padding: 8px; }

  .res-cal-wrap {
    margin: 0 -4px;
    padding: 0 4px;
  }

  .res-cal-grid {
    grid-template-columns: minmax(132px, 38vw) minmax(480px, 1fr);
    min-width: 620px;
    gap: 8px;
  }

  .res-cal-head.days,
  .res-cal-row {
    grid-template-columns: repeat(var(--days), minmax(20px, 1fr));
    gap: 3px;
  }

  .res-cal-cell {
    min-height: 20px;
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .bottomnav {
    gap: 2px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .bn-item {
    padding-left: 2px;
    padding-right: 2px;
    font-size: 10px;
  }

  .bn-item .nav-label,
  .bn-item > span {
    font-size: 10px;
  }

  .nav-mode-dot {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }

  .fab {
    width: 50px;
    height: 50px;
    margin-top: -20px;
  }
}

/* queue lists */
.queue { list-style: none; margin: 0; padding: 0; }
.queue li + li { border-top: 1px solid var(--border); }
.queue a { display: flex; align-items: center; gap: 10px; padding: 13px 4px; color: inherit; text-decoration: none; transition: background 0.15s; border-radius: 10px; }
.queue a:hover { background: rgba(99, 102, 241, 0.06); }
.queue a span:first-of-type { flex: 1; }
.chev { color: var(--muted); font-size: 18px; }

.tone-queue .queue-item {
  border-left: 3px solid transparent;
  border-radius: 12px;
  margin-bottom: 6px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.tone-queue .queue-item:last-child {
  margin-bottom: 0;
}

.tone-queue .queue-item + .queue-item {
  border-top: 1px solid var(--border);
}

.tone-queue .queue-item.tone-danger {
  border-left-color: var(--danger);
}

.tone-queue .queue-item.tone-warn {
  border-left-color: var(--warn);
}

.tone-queue .queue-item.tone-ok {
  border-left-color: var(--ok);
}

.tone-queue .queue-item.tone-neutral {
  border-left-color: color-mix(in srgb, var(--muted) 58%, transparent);
}

.tone-queue .queue-item a {
  padding: 12px 10px;
}

.tone-queue .queue-item a:hover {
  background: color-mix(in srgb, var(--accent1) 10%, transparent);
}

/* badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.ok { background: rgba(16, 185, 129, 0.14); color: var(--ok); }
.badge.warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }
[data-theme="dark"] .badge.warn { color: #fbbf24; }
.badge.danger { background: rgba(239, 68, 68, 0.13); color: var(--danger); }
.badge.neutral { background: rgba(107, 113, 144, 0.14); color: var(--muted); }
.badge.long {
  background: linear-gradient(135deg, rgba(212, 237, 220, 0.72), rgba(174, 217, 189, 0.58));
  border: 1px solid rgba(85, 145, 110, 0.44);
  color: #2b2b2b;
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 3px 10px rgba(40, 103, 68, 0.16);
}
.badge.short {
  background: linear-gradient(135deg, rgba(210, 239, 247, 0.72), rgba(164, 216, 232, 0.58));
  border: 1px solid rgba(52, 132, 160, 0.44);
  color: #2b2b2b;
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 3px 10px rgba(28, 100, 123, 0.16);
}
[data-theme="dark"] .badge.long {
  background: linear-gradient(135deg, rgba(25, 44, 35, 0.87), rgba(35, 71, 54, 0.83));
  border-color: rgba(91, 153, 118, 0.46);
  color: #e7f4ec;
}
[data-theme="dark"] .badge.short {
  background: linear-gradient(135deg, rgba(21, 41, 54, 0.87), rgba(24, 64, 83, 0.83));
  border-color: rgba(74, 158, 186, 0.46);
  color: #e3f5fb;
}
.badge.flag-badge {
  color: var(--flag-text, #f8fafc);
  border: 1px solid var(--flag-ring, rgba(148, 163, 184, 0.45));
  background: var(--flag-bg, linear-gradient(140deg, rgba(255, 255, 255, 0.88), rgba(148, 163, 184, 0.45)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 5px 14px var(--flag-shadow, rgba(148, 163, 184, 0.25));
  backdrop-filter: blur(9px) saturate(122%);
  -webkit-backdrop-filter: blur(9px) saturate(122%);
}

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--border); background: var(--surface); transition: all 0.18s ease; }
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.mode-chips { margin-top: -6px; }
.mode-chips .tab { padding: 5px 13px; font-size: 12px; }
.mode-chips.long .tab.active {
  background: linear-gradient(135deg, #2f8756, #64b085);
  box-shadow: 0 6px 16px rgba(32, 96, 62, 0.28);
}
.mode-chips.short .tab.active {
  background: linear-gradient(135deg, #2397bf, #45c3df);
  box-shadow: 0 6px 16px rgba(23, 99, 128, 0.28);
}

/* reservations timeline */
.res-cal-wrap { overflow-x: auto; }
.res-cal-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(620px, 1fr);
  gap: 8px 10px;
  min-width: 760px;
}
.res-cal-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.res-cal-head.days { display: grid; grid-template-columns: repeat(var(--days), minmax(24px, 1fr)); gap: 4px; }
.res-cal-day { text-align: center; padding: 2px 0; }
.res-cal-unit {
  align-self: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-cal-row { display: grid; grid-template-columns: repeat(var(--days), minmax(24px, 1fr)); gap: 4px; }
.res-cal-cell {
  min-height: 24px;
  border-radius: 6px;
  background: rgba(107, 113, 144, 0.09);
  border: 1px solid rgba(107, 113, 144, 0.14);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.res-cal-cell.ok { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.35); }
.res-cal-cell.warn { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.34); }
.res-cal-cell.danger { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.34); }
.res-cal-cell.neutral { background: rgba(107, 113, 144, 0.2); border-color: rgba(107, 113, 144, 0.32); }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 4px 0 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px 6px; }
td { padding: 9px 10px; border-top: 1px solid var(--border); }
td a { color: var(--accent1); text-decoration: none; font-weight: 600; }

/* forms */
.form { display: grid; gap: 12px; margin-top: 10px; }
.form-inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent1); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.fileinput { padding: 10px; width: 100%; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--font-size-btn);
  line-height: 1.2;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.82), rgba(168, 85, 247, 0.82));
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.26);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(99, 102, 241, 0.32); filter: saturate(1.08); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.88));
  border-color: rgba(167, 243, 208, 0.35);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
}
button.btn:not(.danger-btn):not(.neutral-btn) {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.88));
  border-color: rgba(167, 243, 208, 0.35);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
}
.btn.danger-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.86), rgba(220, 38, 38, 0.88));
  border-color: rgba(254, 202, 202, 0.32);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.3);
}
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 12.5px; border-radius: 10px; }
.tbl-wrap .btn.small,
.queue .btn.small {
  min-width: 74px;
  justify-content: center;
}
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }

/* misc */
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.flash.ok { background: rgba(16, 185, 129, 0.12); color: var(--ok); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.flash.danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
#csvPreview { overflow-x: auto; margin: 10px 0; }
#csvPreview table { font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
