/* Vepra AI — sistemi i dizajnit (Hapi 3). Tokens → primitives → components. Pa varësi, pa inline styles (CSP). */

:root {
  color-scheme: light;
  --ground: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e4e9f1;
  --line: #dbe1ea;
  --line-strong: #b7c2d2;
  --ink: #0f1a2e;
  --text: #223047;
  --muted: #5f6f86;
  --faint: #8d9ab0;
  --accent: #1a5fd0;
  --accent-hover: #164fae;
  --accent-ink: #ffffff;
  --accent-soft: #e6eefc;
  --accent-line: #b9cdf5;
  --ok: #157a52;
  --ok-soft: #dcf3e8;
  --warn: #a95f0a;
  --warn-soft: #fbeedb;
  --bad: #bf3a33;
  --bad-soft: #fbe3e1;
  --info: #2f6fdb;
  --info-soft: #e5eefb;
  --plan: #6f7d93;
  --plan-soft: #e9edf3;
  --navy: #0d1b34;
  --navy-2: #13254a;
  --navy-ink: #e9eef8;
  --navy-muted: #9cb0cf;
  --shadow-1: 0 1px 2px rgba(15, 26, 46, 0.06), 0 1px 1px rgba(15, 26, 46, 0.04);
  --shadow-2: 0 4px 16px -8px rgba(15, 26, 46, 0.25), 0 1px 2px rgba(15, 26, 46, 0.06);
  --shadow-3: 0 24px 48px -24px rgba(15, 26, 46, 0.4), 0 8px 24px -16px rgba(15, 26, 46, 0.25);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --font-display: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --content-max: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ground: #0d1424;
    --surface: #141d30;
    --surface-2: #1b263b;
    --surface-3: #233049;
    --line: #2a3750;
    --line-strong: #3c4c69;
    --ink: #eef3fb;
    --text: #d3dcec;
    --muted: #94a3bd;
    --faint: #6b7a94;
    --accent: #5b96ff;
    --accent-hover: #7dabff;
    --accent-ink: #0b1220;
    --accent-soft: #1b2e50;
    --accent-line: #2f4c80;
    --ok: #4cc48d;
    --ok-soft: #123527;
    --warn: #e8a24a;
    --warn-soft: #3a2a12;
    --bad: #f07a74;
    --bad-soft: #3d1d1c;
    --info: #7fb0ff;
    --info-soft: #1a2c4d;
    --plan: #8d9ab0;
    --plan-soft: #223049;
    --navy: #0a1426;
    --navy-2: #101d38;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 4px 16px -8px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-3: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --ground: #0d1424;
  --surface: #141d30;
  --surface-2: #1b263b;
  --surface-3: #233049;
  --line: #2a3750;
  --line-strong: #3c4c69;
  --ink: #eef3fb;
  --text: #d3dcec;
  --muted: #94a3bd;
  --faint: #6b7a94;
  --accent: #5b96ff;
  --accent-hover: #7dabff;
  --accent-ink: #0b1220;
  --accent-soft: #1b2e50;
  --accent-line: #2f4c80;
  --ok: #4cc48d;
  --ok-soft: #123527;
  --warn: #e8a24a;
  --warn-soft: #3a2a12;
  --bad: #f07a74;
  --bad-soft: #3d1d1c;
  --info: #7fb0ff;
  --info-soft: #1a2c4d;
  --plan: #8d9ab0;
  --plan-soft: #223049;
  --navy: #0a1426;
  --navy-2: #101d38;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 16px -8px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 {
  font-size: 1.55rem;
  font-weight: 700;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 0.86rem;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  flex: none;
  vertical-align: -3px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- brand mark ---------- */
.mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, #1f4fa8 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--shadow-1);
  flex: none;
}
.mark.lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 1.45rem;
}
.mark .brand-mark {
  width: 68%;
  height: 68%;
  display: block;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
  gap: 1px;
}
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
/* Lockup: the motto as a quiet uppercase line in the accent, the slogan in italic beneath it. */
.brand .brand-motto {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3px;
}
.brand .brand-slogan {
  font-style: italic;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}
/* Social sign-in: a quiet divider and provider buttons that inherit the card's glass style. */
.auth-social {
  display: grid;
  gap: 12px;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-social-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.btn.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
}
.btn.social[data-provider='google'] svg {
  color: #4285f4;
}
.btn.social[data-provider='facebook'] svg {
  color: #1877f2;
}
.auth-card .brand .brand-motto {
  font-size: 0.66rem;
}
.auth-card .brand .brand-slogan {
  font-size: 0.78rem;
}

/* ---------- auth layout ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding-block: 32px 48px;
  padding-inline: 20px;
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--ok) 8%, transparent), transparent 60%),
    var(--ground);
}
.auth-card {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 32px 30px 28px;
  display: grid;
  gap: 20px;
}
.auth-card .brand {
  justify-content: center;
}
.auth-title {
  text-align: center;
  display: grid;
  gap: 6px;
}
/* Elegant way back to the public site: a quiet link pinned to the card's top-left, chevron pointing back. */
.auth-card {
  position: relative;
}
.auth-back {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.auth-back svg {
  transform: rotate(180deg);
  transition: transform 0.15s;
}
.auth-back:hover,
.auth-back:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.auth-back:hover svg {
  transform: rotate(180deg) translateX(2px);
}
.auth-title p {
  color: var(--muted);
}
.auth-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- app shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--navy-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 14px;
  gap: 14px;
  overflow-y: auto; /* fifteen destinations + superadmin exceed short viewports */
  scrollbar-width: thin;
}
.sidebar .brand {
  color: var(--navy-ink);
  padding: 4px 6px;
}
.sidebar .brand small {
  color: var(--navy-muted);
}
.sidebar .brand .brand-motto {
  color: #9cc2ff;
}
.switcher {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--navy-ink);
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.switcher:hover {
  background: rgba(255, 255, 255, 0.1);
}
.switcher .eyebrow {
  color: var(--navy-muted);
}
.switcher b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.nav {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--navy-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--navy-ink);
  text-decoration: none;
}
.nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav a .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
.nav-group {
  padding: 12px 12px 4px;
  color: var(--navy-muted);
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 6px;
}
.sidebar-foot .btn.ghost {
  color: var(--navy-muted);
  justify-content: flex-start;
}
.sidebar-foot .btn.ghost:hover {
  color: var(--navy-ink);
  background: rgba(255, 255, 255, 0.08);
}
.userbox {
  display: flex;
  align-items: center;
  min-width: 0; /* grid item: allow the long email to shrink and ellipsise */
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--navy-ink);
}
.userbox .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}
.userbox .who {
  min-width: 0;
  flex: 1;
}
.userbox .who b {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}
.userbox .who span {
  color: var(--navy-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 28px;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 1.15rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .crumbs {
  color: var(--muted);
  font-size: 0.85rem;
}
/* Language and colour scheme, always at the end of the top bar (and top-right of auth cards). */
.topbar-tools,
.auth-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.auth-tools {
  position: absolute;
  top: 12px;
  right: 12px;
}
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 26px 6px 12px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  max-width: 150px;
}
.lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  color: var(--text);
}
.theme-btn[data-theme='light'] {
  color: #d97706;
}
.theme-btn[data-theme='dark'] {
  color: var(--accent);
}
.theme-btn:hover {
  border-color: var(--accent-line, var(--line-strong));
}
.content {
  width: min(100%, var(--content-max));
  margin-inline: auto;
  padding-block: 24px 64px;
  padding-inline: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}
.menu-btn {
  display: none;
}
.bottom-nav {
  display: none;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.05s;
  text-decoration: none;
}
.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  --btn-line: var(--accent);
}
.btn.primary:hover {
  --btn-bg: var(--accent-hover);
  --btn-line: var(--accent-hover);
}
.btn.ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  --btn-fg: var(--text);
}
.btn.ghost:hover {
  --btn-bg: var(--surface-2);
}
.btn.danger {
  --btn-bg: transparent;
  --btn-fg: var(--bad);
  --btn-line: color-mix(in srgb, var(--bad) 40%, var(--line));
}
.btn.danger:hover {
  --btn-bg: var(--bad-soft);
}
.btn.sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.85rem;
}
.btn.lg {
  min-height: 46px;
  padding: 0 20px;
  font-size: 1rem;
}
.btn.block {
  width: 100%;
}
.btn:disabled,
.btn[aria-busy='true'] {
  opacity: 0.6;
  cursor: progress;
}
.btn[aria-busy='true']::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-row.end {
  justify-content: flex-end;
}

/* ---------- forms ---------- */
.field {
  display: grid;
  gap: 6px;
}
.field > label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.field .hint {
  color: var(--muted);
  font-size: 0.84rem;
}
.field .error {
  color: var(--bad);
  font-size: 0.84rem;
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea {
  min-height: 90px;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[aria-invalid='true'] {
  border-color: var(--bad);
}
.input.mono {
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}
.form {
  display: grid;
  gap: 16px;
}
.form .row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
}
.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.switch input {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s var(--ease);
  cursor: pointer;
  margin: 0;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s var(--ease);
  box-shadow: var(--shadow-1);
}
.switch input:checked {
  background: var(--accent);
}
.switch input:checked::after {
  transform: translateX(18px);
}
.switch input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card > .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}
.card > .card-head p {
  color: var(--muted);
  font-size: 0.9rem;
}
.card > .card-body {
  padding: 16px 20px 20px;
  display: grid;
  gap: 14px;
}
.card.flush > .card-body {
  padding: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.grid-2.align-start,
.grid-3.align-start {
  align-items: start;
}
/* Individ platform: the category registry as tiles, plan cards, offer rows. */
.kpis-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cat-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: var(--r-lg, 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line, var(--line-strong));
  box-shadow: var(--shadow-1);
}
.cat-tile.planned {
  opacity: 0.72;
}
.cat-tile .cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.cat-tile .cat-body p {
  margin: 4px 0 0;
}
.cat-tile .cat-go {
  color: var(--muted);
  margin-top: 10px;
}
.plan-grid {
  display: grid;
  gap: 10px;
}
.plan {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 12px);
  display: grid;
  gap: 6px;
}
.plan.current {
  border-color: var(--accent-line, var(--accent));
  background: var(--accent-soft);
}
.plan ul {
  margin: 0;
  padding-left: 18px;
}
.offer-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md, 12px);
}
.offer-row.accepted {
  border-color: var(--ok);
}
.match ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
p.pre,
.pre {
  white-space: pre-wrap;
  margin: 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.kpi {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.kpi .eyebrow {
  font-size: 0.66rem;
}
.kpi b {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi span {
  color: var(--muted);
  font-size: 0.85rem;
}
.kpi.accent {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
}

.biz-card {
  padding: 18px 20px;
  display: grid;
  align-content: start;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.biz-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.block {
  display: block;
}
.nowrap {
  white-space: nowrap;
}

/* ---------- badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
  background: var(--plan-soft);
  color: var(--plan);
  white-space: nowrap;
  line-height: 1.6;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge.info,
.badge.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.plain::before {
  display: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}
.chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- banners / alerts ---------- */
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.banner .icon {
  margin-top: 2px;
}
.banner b {
  display: block;
  font-family: var(--font-display);
  color: var(--ink);
}
.banner p {
  color: var(--muted);
  font-size: 0.92rem;
}
.banner .banner-actions {
  margin-left: auto;
  flex: none;
}
.banner.info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 30%, var(--line));
  color: var(--info);
}
.banner.ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
  color: var(--ok);
}
.banner.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, var(--line));
  color: var(--warn);
}
.banner.bad {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 30%, var(--line));
  color: var(--bad);
}

/* ---------- tables & lists ---------- */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
/* Hapi 16: wide tables (availability grids, channel rows) scroll inside their container, never the page */
.content > .card,
.content > .table-wrap,
.card > .card-body {
  min-width: 0;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table tr.clickable {
  cursor: pointer;
}
.table tr.clickable:hover td {
  background: var(--surface-2);
}
.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.rows {
  display: grid;
}
.row-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child {
  border-bottom: 0;
}
.row-item .title {
  font-weight: 600;
  color: var(--ink);
}
.row-item .sub {
  color: var(--muted);
  font-size: 0.88rem;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  max-width: 340px;
}
.row-actions .btn-row {
  gap: 6px;
  justify-content: flex-end;
}
.sev {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--plan);
}
.sev.critical,
.sev.high {
  background: var(--bad);
}
.sev.medium {
  background: var(--warn);
}
.sev.low {
  background: var(--info);
}
.sev.info {
  background: var(--plan);
}

/* ---------- misc ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button[aria-selected='true'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty b {
  color: var(--ink);
  font-family: var(--font-display);
}
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.bigcode {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.steps {
  display: grid;
  gap: 0;
  counter-reset: step;
}
.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
}
.step.done::before {
  content: '✓';
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.step.current::before {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.step b {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.step span {
  color: var(--muted);
  font-size: 0.88rem;
}
.qr {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  width: fit-content;
}
.qr canvas {
  display: block;
  width: 196px;
  height: 196px;
  image-rendering: pixelated;
}
.recovery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 12px;
}
.stack.tight {
  gap: 6px;
}
.split.nowrap {
  flex-wrap: nowrap;
}
.split.nowrap > :first-child {
  min-width: 0;
}
.center {
  display: flex;
  justify-content: center;
}
.search {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 560px;
}
.search .field {
  flex: 1;
  margin: 0;
}

/* ---------- segmented control ---------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented button[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.segmented .badge {
  font-size: 0.66rem;
}

/* ---------- CRM: pipeline board, profile ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
@media (max-width: 1100px) {
  .kanban {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
  }
}
.kanban-col {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-height: 160px;
}
.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 2px 4px 6px;
}
.kanban-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.kanban-card b {
  color: var(--ink);
}
.profile-head {
  display: flex;
  gap: 16px;
  align-items: center;
}
.profile-head h2 {
  margin: 0;
  font-size: 1.35rem;
}
.profile-head .sub {
  color: var(--muted);
  font-size: 0.88rem;
}
.avatar.lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  flex: none;
}
.prewrap {
  white-space: pre-wrap;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.search .field:nth-child(2) {
  flex: 0 0 200px;
}
input[type='file'].input {
  padding: 8px;
}
@media (max-width: 860px) {
  .kanban {
    grid-template-columns: repeat(5, minmax(220px, 1fr));
  }
  .search {
    flex-wrap: wrap;
  }
  .search .field:nth-child(2) {
    flex: 1 1 100%;
  }
}

/* ---------- plan cards ---------- */
.plans {
  align-items: stretch;
}
.plan {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan.featured {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line), var(--shadow-1);
}
.plan h3 {
  margin: 0;
  font-size: 1.05rem;
}
.plan .price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.plan .price b {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.plan .features {
  list-style: none;
  margin: 6px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}
.plan .features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.plan .features svg {
  flex: none;
  margin-top: 3px;
  color: var(--ok);
}
.plan .btn {
  margin-top: auto;
}
.kv {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  gap: 6px 16px;
  font-size: 0.93rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  color: var(--ink);
}
.evidence {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
}
.evidence q {
  color: var(--text);
  font-style: italic;
}
.evidence a {
  word-break: break-all;
}
.flag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text);
}
.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- dialog / toast ---------- */
dialog.modal {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  width: min(92vw, 520px);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
}
dialog.modal.wide {
  width: min(94vw, 760px);
}
dialog.modal::backdrop {
  background: rgba(8, 14, 28, 0.55);
  backdrop-filter: blur(2px);
}
dialog.modal .modal-head {
  padding: 20px 22px 0;
  display: grid;
  gap: 4px;
}
dialog.modal .modal-head p {
  color: var(--muted);
  font-size: 0.92rem;
}
dialog.modal .modal-body {
  padding: 18px 22px 22px;
  display: grid;
  gap: 14px;
}
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 50;
  width: min(92vw, 380px);
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-3);
  font-size: 0.92rem;
  animation: rise 0.2s var(--ease);
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
.toast.ok {
  background: var(--ok);
  color: #fff;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.2s var(--ease);
    box-shadow: var(--shadow-3);
  }
  .sidebar.open {
    transform: none;
  }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 28, 0.5);
    z-index: 19;
  }
  .menu-btn {
    display: inline-flex;
  }
  .topbar {
    padding-inline: 12px;
    gap: 8px;
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding-block: 8px;
  }
  .topbar h1 {
    flex: 1 1 0;
    font-size: 1.05rem;
  }
  .topbar .crumbs {
    display: none;
  }
  .topbar > .btn-row {
    flex: 0 0 auto;
    gap: 6px;
  }
  .topbar > .btn-row .btn {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
  .content {
    padding-inline: 16px;
    padding-bottom: 88px;
  }
  /* Rows: the action cluster drops under the text instead of squeezing it. */
  .row-item {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 14px;
    row-gap: 10px;
  }
  .row-item > :nth-child(3) {
    grid-column: 2;
    justify-content: flex-start;
    max-width: none;
  }
  .row-item .sev {
    grid-row: 1 / span 2;
  }
  .row-actions {
    justify-content: flex-start;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }
  .kv dt {
    margin-top: 8px;
  }
  .bottom-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    min-width: 0;
  }
  .bottom-nav a span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bottom-nav a[aria-current='page'] {
    color: var(--accent);
  }
  .table th:nth-child(n + 4),
  .table td:nth-child(n + 4) {
    display: none;
  }
  .table.keep-all th,
  .table.keep-all td {
    display: table-cell;
  }
  .auth-card {
    padding: 26px 20px 22px;
  }
}

@media (max-width: 560px) {
  /* Very narrow phones: page actions get their own line under the title. */
  .topbar > .btn-row {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
}

/* ---------- Hapi 5: grouped navigation ---------- */
.nav li.grouped {
  display: grid;
  gap: 2px;
}
.nav li.grouped .nav-group {
  padding: 14px 12px 4px;
  font-size: 0.66rem;
}

/* ---------- Hapi 5: inbox ---------- */
.inbox {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}
.inbox .conv-list {
  display: grid;
  gap: 2px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.conv-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}
.conv-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.conv-item[aria-current='page'] {
  background: var(--accent-soft);
}
.conv-item .who {
  min-width: 0;
}
.conv-item .who b {
  display: block;
  font-size: 0.92rem;
}
.conv-item .who span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item .meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}
.unread {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 18px;
}
.thread {
  display: grid;
  gap: 10px;
  padding: 4px 0;
  max-height: 52vh;
  overflow-y: auto;
}
.bubble {
  max-width: min(78%, 620px);
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 0.93rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.out {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}
.bubble.in {
  border-bottom-left-radius: 4px;
}
.bubble.ai {
  background: var(--ok-soft);
  color: var(--ink);
  border: 1px solid transparent;
}
.bubble.failed {
  background: var(--bad-soft);
  color: var(--ink);
}
.bubble.draft {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.bubble .stamp {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  opacity: 0.75;
}
.composer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.composer textarea {
  min-height: 84px;
}
.proposal {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.proposal pre {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 0;
  font-size: 0.92rem;
}
.citation {
  font-size: 0.8rem;
  color: var(--muted);
  border-left: 3px solid var(--accent-line);
  padding-left: 8px;
}

/* ---------- Hapi 5: workflow builder ---------- */
.wf-steps {
  display: grid;
  gap: 8px;
}
.wf-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: var(--surface);
}
.wf-step .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}
.wf-step .fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.wf-step .fields .field {
  margin: 0;
}
.log-line {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.hash {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}
.progress {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}
.progress span {
  display: block;
  height: 100%;
}
.progress .ok {
  background: var(--ok);
}
.progress .warn {
  background: var(--warn);
}
.progress .bad {
  background: var(--bad);
}
.progress .info {
  background: var(--accent);
}
@media (max-width: 860px) {
  .inbox {
    grid-template-columns: 1fr;
  }
  .inbox .conv-list {
    max-height: none;
  }
  .thread {
    max-height: none;
  }
}

/* ---------- Hapi 6: calendar ---------- */
.cal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.cal-controls .cal-title {
  margin: 0;
  font-size: 1.05rem;
  text-transform: capitalize;
}
.cal-date {
  width: auto;
  padding-block: 5px;
}
.btn.flip svg {
  transform: rotate(180deg);
}
.cal-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.cal {
  display: grid;
  grid-template-columns: 56px repeat(var(--cols), minmax(170px, 1fr));
  min-width: 100%;
}
.cal-res-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.85rem;
}
.cal-gutter .cal-res-head {
  border-left: 0;
}
.cal-res-head b {
  font-family: var(--font-display);
  font-weight: 700;
}
.cal-res-head small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}
.dot.big {
  width: 14px;
  height: 14px;
  margin-top: 4px;
}
.cal-col {
  position: relative;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(60px * 1.1 - 1px), var(--line) calc(60px * 1.1 - 1px), var(--line) calc(60px * 1.1));
}
.cal-gutter .cal-col {
  border-left: 0;
  background-image: none;
}
.cal-hour {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.cal-hour.first {
  transform: none;
  top: 2px !important;
}
.cal-closed {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 7px);
  opacity: 0.8;
}
.cal-click {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}
.cal-now {
  position: absolute;
  left: 0;
  right: -9999px;
  border-top: 2px solid var(--bad);
  z-index: 1;
  pointer-events: none;
}
.cal-ev {
  --ev: var(--accent);
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--ev) 55%, var(--line));
  border-left: 4px solid var(--ev);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ev) 12%, var(--surface));
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
}
.cal-ev b {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev span {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev.state-held {
  border-style: dashed;
  border-left-style: solid;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 60%, var(--line));
  border-left-color: var(--warn);
}
.cal-ev.state-arrived {
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  border-left-color: var(--ok);
}
.cal-ev:hover,
.cal-ev:focus-visible {
  box-shadow: var(--shadow-2);
  z-index: 2;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.cal-day {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  min-height: 140px;
}
.cal-day.today {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.cal-day-head {
  display: grid;
  color: inherit;
  text-decoration: none;
  line-height: 1.2;
}
.cal-day-head b {
  font-family: var(--font-display);
  text-transform: capitalize;
}
.cal-day-head span,
.cal-day-head small {
  color: var(--muted);
  font-size: 0.75rem;
}
.cal-mini {
  display: grid;
  gap: 1px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.cal-mini.state-held {
  border-left-color: var(--warn);
  border-style: dashed;
  border-left-style: solid;
}
.cal-mini.state-arrived {
  border-left-color: var(--ok);
}
.cal-mini small {
  color: var(--muted);
}
.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.slot {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}
.slot:hover {
  border-color: var(--accent);
}
.slot[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.sched {
  display: grid;
  gap: 8px;
}
.sched-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 10px;
  align-items: center;
}
.sched-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.input.time {
  width: 96px;
  padding-block: 5px;
}
.row-item.compact {
  padding-block: 8px;
}
code.wrap {
  white-space: normal;
  word-break: break-all;
}

/* ---------- Hapi 6: public booking page ---------- */
.public {
  min-height: 100vh;
  background: var(--ground);
  padding-block: 24px 48px;
  padding-inline: 16px;
}
.public-card {
  width: min(100%, 720px);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 24px 24px 20px;
  display: grid;
  gap: 18px;
}
.public-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.public-head h1 {
  margin: 0;
  font-size: 1.35rem;
}
.public-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.public-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--muted);
}
.public-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}
.public-steps li .n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.public-steps li[aria-current='step'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.public-steps li[aria-current='step'] .n {
  background: var(--accent);
  color: var(--accent-ink);
}
.public-steps li.done .n {
  background: var(--ok);
  color: #fff;
}
.public-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.public-service {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.public-service:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}
.public-service b {
  font-family: var(--font-display);
}
.public-service span {
  color: var(--muted);
  font-size: 0.85rem;
}
.public-service small {
  color: var(--faint);
}
.day-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.day {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  width: 58px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}
.day small {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: capitalize;
}
.day b {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.day[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.public-summary {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.public-summary b {
  font-family: var(--font-display);
}
.public-summary span {
  color: var(--muted);
  font-size: 0.9rem;
}
.public-policy {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 0.85rem;
}
.public-policy p {
  margin: 0;
  color: var(--muted);
}
.public-foot {
  text-align: center;
  color: var(--faint);
  font-size: 0.75rem;
}
@media (max-width: 860px) {
  .cal-week {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .public-steps li {
    font-size: 0.7rem;
  }
  .public-steps li .n {
    width: 18px;
    height: 18px;
  }
  .sched-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .cal-week {
    grid-template-columns: 1fr;
  }
  .cal {
    grid-template-columns: 44px repeat(var(--cols), minmax(150px, 1fr));
  }
}
/* Hapi 6: field rows outside forms (settings cards, dialogs built from plain stacks); Hapi 16: dialog bodies too */
.card .row,
.stack > .row,
dialog.modal .modal-body > .row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.card .field,
.stack > .row .field,
dialog.modal .modal-body > .row .field {
  margin: 0;
}

/* ---------- Hapi 7: quotes, work orders, packages, recurring plans, client portal ---------- */
a.row-item {
  color: inherit;
  text-decoration: none;
}
a.row-item:hover .title {
  text-decoration: underline;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.toolbar .field {
  margin: 0;
  flex: 0 1 280px;
}
.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.quote-line {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) 72px 88px 100px 92px 110px auto;
  gap: 6px;
  align-items: center;
}
.quote-line .input,
.quote-line .select {
  margin: 0;
  min-width: 0;
}
.quote-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 0.9rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--text);
  text-decoration: none;
}
.chip.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
@media (max-width: 1100px) {
  .board {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }
}
.board-col {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  min-height: 160px;
}
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
.board-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-1);
}
.board-card:hover {
  border-color: var(--accent);
}
.board-card .title {
  font-weight: 600;
  font-size: 0.92rem;
}
.board-card .sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
}
.check-item input {
  margin-top: 3px;
}
.check-item .done {
  text-decoration: line-through;
  color: var(--muted);
}
.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 6px;
  max-width: 260px;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.public-card.wide {
  width: min(100%, 880px);
}
.portal-section {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.portal-section h2 {
  font-size: 1.05rem;
  margin: 0;
}
.portal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.portal-quote {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.portal-quote h3 {
  margin: 0;
  font-size: 1rem;
}
.portal-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.9rem;
}
.portal-inline {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.table.compact th,
.table.compact td {
  padding: 6px 8px;
  font-size: 0.85rem;
}
.split {
  gap: 8px;
}
@media (max-width: 720px) {
  .quote-line {
    grid-template-columns: 1fr 1fr;
  }
  .quote-line .input:first-child {
    grid-column: 1 / -1;
  }
  .portal-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Hapi 8: reports, growth signals, memberships ---------- */
.meter.wide { max-width: none; height: 8px; }
.chart-wrap { display: grid; gap: 8px; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font-mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .bar.ok { fill: var(--ok); }
.chart .bar.plain { fill: var(--plan); opacity: 0.55; }
.chart .bar.bad { fill: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--plan); opacity: 0.6; }
.legend i.sw.ok { background: var(--ok); opacity: 1; }
.legend i.sw.bad { background: var(--bad); opacity: 1; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; overflow: auto; max-height: 360px; font-family: var(--font-mono); font-size: 0.78rem; white-space: pre-wrap; word-break: break-word; }
details > summary { cursor: pointer; }
.modal h4 { margin: 14px 0 6px; font-family: var(--font-display); font-size: 0.95rem; }
@media (max-width: 560px) { .chart .tick { font-size: 14px; } }

/* ---------- Hapi 8B: one-time codes + CAPTCHA on public pages ---------- */
.verify-box { border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--r-md, 10px); padding: 12px 14px; background: var(--surface-2); }
.verify-box .split { align-items: center; gap: 10px; }
.verify-box .btn-row { flex-wrap: wrap; }
.verify-box .field { margin: 0; }
.captcha:empty { display: none; }
.captcha { min-height: 0; display: flex; justify-content: center; }

/* ---------- Hapi 9: Ekonomisti juaj (seksioni falas) ---------- */
.usage-row { display: grid; gap: 4px; }
.usage-row .split { align-items: baseline; gap: 10px; }
.usage-row b.mono { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.usage-row b.mono .muted { font-weight: 400; }
.meter span.ok { background: var(--ok); }
.meter span.warn { background: var(--warn); }
.meter span.bad { background: var(--bad); }
.meter span.info { background: var(--info); }
.budget-row, .liq-row { display: grid; gap: 10px; align-items: end; }
.budget-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.liq-row { grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 1fr) auto; }
.budget-row .field, .liq-row .field { margin: 0; }
.budget-row .btn, .liq-row .btn { margin-bottom: 4px; }
.card.span-2 { grid-column: 1 / -1; }
.steps-plain { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text); }
.kpi b .bad, .kpi b.bad, b.mono.bad, span.bad { color: var(--bad); }
b.mono.ok, span.ok { color: var(--ok); }
ul.evidence { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.88rem; }
ul.evidence .mono { word-break: break-word; }
.chips .switch { margin: 0; }
@media (max-width: 720px) {
  .liq-row { grid-template-columns: 1fr 1fr; }
  .liq-row .btn { grid-column: 2; justify-self: end; }
  .budget-row { grid-template-columns: 1fr auto; }
  .budget-row .field:nth-child(2) { grid-column: 1; }
}

/* ---------- Hapi 10: katalogu dhe inventari ---------- */
.liq-row.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.row-item.open { background: var(--accent-soft); }
.table td .field { margin: 0; }
.table td .field .input { padding: 6px 8px; min-width: 96px; }
@media (max-width: 720px) { .liq-row.two { grid-template-columns: 1fr auto; } .liq-row.two .field:nth-child(2) { grid-column: 1; } }

/* ---------- Hapi 11: blerjet ---------- */
.po-line { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 0.6fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 0.9fr) auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.po-line:last-child { border-bottom: 0; }
.po-line .field, .po-line .switch { margin: 0; }
.po-line .btn { margin-bottom: 4px; }
.po-line.supplier { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 0.9fr) auto auto; }
.po-line.bill { grid-template-columns: minmax(0, 2fr) minmax(0, 0.7fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1fr) auto; }
.liq-row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 720px) { .liq-row.three { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .po-line { grid-template-columns: 1fr 1fr; } .po-line .btn { grid-column: 2; justify-self: end; } }

/* ---------- Hapi 12: kasa (POS), salla, kuzhina, pajisjet ---------- */
[hidden] { display: none !important; }
main.content.wide { max-width: none; }
.shift-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); }
.shift-bar .muted { color: var(--muted); font-size: 0.86rem; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr); gap: 16px; align-items: start; }
.pos-left { display: grid; gap: 12px; min-width: 0; }
.pos-left .field { margin: 0; }
.pos-grid { display: grid; gap: 10px; }
.pos-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-item { display: grid; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); color: var(--text); cursor: pointer; min-height: 96px; transition: border-color 0.12s, transform 0.06s; }
.pos-item:hover { border-color: var(--accent-line); }
.pos-item:active { transform: scale(0.98); }
.pos-item:disabled { opacity: 0.5; cursor: not-allowed; }
.pos-item b { font-size: 0.92rem; line-height: 1.25; }
.pos-item .sub { color: var(--muted); font-size: 0.74rem; font-family: var(--font-mono); }
.pos-item .price { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.pos-item .stock { font-size: 0.74rem; color: var(--muted); }
.pos-item .stock.bad { color: var(--bad); }
.pos-cart { position: sticky; top: 12px; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); }
.pos-cart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-lines { display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.pos-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'name name name' 'qty amt act'; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pos-line:last-child { border-bottom: 0; }
.pos-line > div:first-child { grid-area: name; min-width: 0; }
.pos-line b { display: block; font-size: 0.9rem; }
.pos-line .sub { display: block; color: var(--muted); font-size: 0.76rem; }
.pos-line .qty { grid-area: qty; display: inline-flex; align-items: center; gap: 4px; }
.pos-line .qty .mono { min-width: 28px; text-align: center; }
.pos-line .amt { grid-area: amt; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.pos-line .line-actions { grid-area: act; display: inline-flex; gap: 2px; justify-content: flex-end; }
.pos-line.sent .amt, .pos-line.voided .amt { grid-column: 2 / -1; }
.pos-line.sent { opacity: 0.85; }
.pos-line.sent .amt::before { content: '✓ '; color: var(--ok); }
.pos-line.voided { opacity: 0.55; text-decoration: line-through; }
.pos-totals { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.pos-totals > div { display: flex; justify-content: space-between; font-size: 0.9rem; }
.pos-totals > div b { font-variant-numeric: tabular-nums; }
.pos-totals .grand { font-size: 1.15rem; font-family: var(--font-display); }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-actions .btn:last-child { grid-column: 1 / -1; min-height: 52px; font-size: 1.05rem; }
.change { font-weight: 600; }
.change.ok { color: var(--ok); }
.change.bad { color: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.denoms .field { margin: 0; }
.denoms .field .input { padding: 6px 8px; }
pre.receipt { font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.35; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 12px 14px; white-space: pre; overflow: auto; max-height: 50vh; }
.code-box { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border: 1px dashed var(--accent-line); border-radius: var(--r-md, 10px); background: var(--accent-soft); }
.code-box b.big { font-size: 1.6rem; letter-spacing: 0.12em; }
/* floor */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.table-card { display: grid; gap: 4px; text-align: left; padding: 12px; min-height: 104px; border: 2px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); color: var(--text); cursor: pointer; }
.table-card.ok { border-color: var(--ok); }
.table-card.warn { border-color: var(--warn); background: var(--warn-soft); }
.table-card.info { border-color: var(--accent); background: var(--accent-soft); }
.table-card.accent { border-color: var(--ok); background: var(--ok-soft); }
.table-card.inactive { opacity: 0.5; border-style: dashed; }
.table-card b { font-family: var(--font-display); font-size: 1.05rem; }
.table-card .cap, .table-card .free { color: var(--muted); font-size: 0.78rem; }
.table-card .order { display: grid; font-size: 0.82rem; }
.table-card .age { color: var(--muted); font-size: 0.74rem; }
/* kitchen display */
.kds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kds-col { display: grid; gap: 10px; }
.kds-col h3 { margin: 0; font-family: var(--font-display); font-size: 1rem; }
.ticket { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-md, 10px); background: var(--surface); }
.ticket header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ticket header b { font-family: var(--font-display); font-size: 1.05rem; }
.ticket header .age { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticket.late { border-color: var(--bad); }
.ticket.late header .age { color: var(--bad); font-weight: 600; }
.ticket.ready { border-color: var(--ok); }
.ticket.cancel { border-color: var(--bad); background: var(--bad-soft); }
.ticket.served, .ticket.cancelled { opacity: 0.6; }
.ticket-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 1rem; }
.ticket-lines .mods, .ticket-lines .seat { color: var(--muted); font-size: 0.85rem; }
.ticket-lines .note, .ticket .note { font-size: 0.85rem; color: var(--warn); }
.ticket footer { font-size: 0.76rem; }
.ticket .btn-row .btn { flex: 1; min-height: 44px; }
/* browser print: only the receipt text */
.print-area { display: none; }
@media print {
  body.printing > *:not(.print-area) { display: none !important; }
  body.printing .print-area { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; white-space: pre; margin: 0; }
}
@media (max-width: 1100px) { .pos-layout { grid-template-columns: 1fr; } .pos-cart { position: static; } .kds { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .pos-items { grid-template-columns: repeat(2, 1fr); } .pos-actions { grid-template-columns: 1fr; } }

/* ---------- Hapi 16: hoteli ---------- */
.chip.hk-clean, .chip.hk-inspected { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.chip.hk-dirty { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: var(--warn-soft); }
.chip.hk-out_of_order { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); background: var(--bad-soft); }
button.chip { cursor: pointer; font: inherit; color: inherit; }
button.chip:hover { border-color: var(--ink); }
.results { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.results:empty { display: none; }
.quote { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--r-md, 10px); margin-bottom: 10px; font-size: 0.92rem; }
.quote:empty { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin-bottom: 12px; }
.filters .field { margin: 0; min-width: 150px; }
.table td .ok { color: var(--ok); font-weight: 600; } .table td .warn { color: var(--warn); font-weight: 600; } .table td .bad { color: var(--bad); font-weight: 600; }

/* ---------- Hapi 17: online shop (staff) + public storefront ---------- */
.public.shop .public-card.wide { width: min(100%, 980px); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.shop-item { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg, 14px); overflow: hidden; background: var(--surface); min-width: 0; }
.shop-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg-2, #f4f4f4); }
.shop-noimg { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--muted); background: var(--bg-2, #f4f4f4); }
.shop-item-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.shop-item-body h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.shop-item-body .btn-row { margin-top: auto; align-items: center; }
.shop-item-body .btn-row input { width: 4.5rem; }
.shop-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.shop-line > :last-child { text-align: right; white-space: nowrap; }
.shop-totals { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md, 10px); background: var(--bg-2, #fafafa); }
.shop-totals .split.total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 1.05rem; }
.shop-totals .split { gap: 12px; }
.chips .chip[aria-pressed='true'] { border-color: var(--accent); }
pre.small { font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; background: var(--bg-2, #fafafa); padding: 10px 12px; border-radius: var(--r-md, 10px); border: 1px solid var(--line); }
code.small { font-size: 0.8rem; word-break: break-all; }
@media (max-width: 560px) {
  .shop-line { grid-template-columns: 1fr auto; }
  .shop-line > :last-child { grid-column: 1 / -1; text-align: left; }
}
.inbox-commerce { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--r-md, 10px); font-size: 0.92rem; }

/* Hapi 17 (smoke): a switch with a long hint used to shrink the pill over its label — the pill keeps its width
   and the hint wraps under the label, aligned with it. */
.switch { flex-wrap: wrap; }
.switch input { flex: 0 0 40px; }
.switch > span.muted.small { flex-basis: 100%; padding-left: 50px; line-height: 1.35; }
.chips .switch > span.muted.small, .po-line .switch > span.muted.small { padding-left: 0; }


/* ---------- 2026: Liquid Glass (SHTUAR) — translucent surfaces with an inner highlight over an ambient mesh;
   every colour still comes from the tokens above, so light and dark stay complete. Reduced-transparency users
   get the flat surfaces back. ---------- */
:root {
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --ground: #edf1f8;
  /* Brand (handoff 15.09.2026): primary blue #155eef, light logo blue #65a3ff, ink #101e3b; DM Sans body + Manrope headings. */
  --accent: #155eef;
  --accent-hover: #0f4fd0;
  --accent-soft: #e8f0ff;
  --accent-line: #b9d0fb;
  --ink: #101e3b;
  --font-body: 'DM Sans', 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --glass-line: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(15, 26, 46, 0.09);
  --glass-hi: rgba(255, 255, 255, 0.6);
  --glass-blur: saturate(180%) blur(22px);
  --mesh-a: rgba(10, 108, 255, 0.18);
  --mesh-b: rgba(126, 87, 255, 0.14);
  --mesh-c: rgba(0, 190, 170, 0.12);
  --shadow-1: 0 1px 1px rgba(15, 26, 46, 0.04), 0 4px 14px -6px rgba(15, 26, 46, 0.12);
  --shadow-2: 0 12px 32px -14px rgba(15, 26, 46, 0.3), 0 2px 6px -2px rgba(15, 26, 46, 0.08);
  --shadow-3: 0 32px 64px -28px rgba(15, 26, 46, 0.5), 0 12px 28px -18px rgba(15, 26, 46, 0.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0a1020;
    --accent: #65a3ff;
    --accent-hover: #8cbaff;
    --accent-soft: #172a52;
    --accent-line: #2d4f8f;
    --ink: #eef3fb;
    --glass: rgba(22, 30, 52, 0.58);
    --glass-strong: rgba(24, 33, 58, 0.78);
    --glass-line: rgba(255, 255, 255, 0.1);
    --glass-edge: rgba(0, 0, 0, 0.35);
    --glass-hi: rgba(255, 255, 255, 0.07);
    --mesh-a: rgba(79, 141, 255, 0.22);
    --mesh-b: rgba(140, 100, 255, 0.16);
    --mesh-c: rgba(0, 190, 170, 0.1);
  }
}
:root[data-theme='dark'] {
  --ground: #0a1020;
  --accent: #65a3ff;
  --accent-hover: #8cbaff;
  --accent-soft: #172a52;
  --accent-line: #2d4f8f;
  --ink: #eef3fb;
  --glass: rgba(22, 30, 52, 0.58);
  --glass-strong: rgba(24, 33, 58, 0.78);
  --glass-line: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(0, 0, 0, 0.35);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --mesh-a: rgba(79, 141, 255, 0.22);
  --mesh-b: rgba(140, 100, 255, 0.16);
  --mesh-c: rgba(0, 190, 170, 0.1);
}
body {
  background:
    radial-gradient(1000px 640px at 6% -8%, var(--mesh-a), transparent 62%),
    radial-gradient(900px 560px at 104% 2%, var(--mesh-b), transparent 60%),
    radial-gradient(800px 560px at 50% 112%, var(--mesh-c), transparent 60%),
    var(--ground);
  background-attachment: fixed;
}
h1 {
  letter-spacing: -0.022em;
}
.sidebar {
  background: linear-gradient(180deg, rgba(12, 24, 48, 0.9), rgba(12, 24, 48, 0.82));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.switcher {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.nav a {
  border-radius: 12px;
}
.nav a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px -2px rgba(0, 0, 0, 0.35);
}
.userbox .avatar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.topbar {
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-edge);
}
.card,
.kpi,
.banner,
.auth-card,
.public-card,
.kanban-card,
.board-card,
.plan,
.ticket,
.shop-item,
.pos-cart {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-edge), var(--shadow-1);
}
.biz-card:hover {
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-edge), var(--shadow-2);
}
.kpi {
  border-radius: 18px;
}
.kpi b {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}
.kpi.accent {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), var(--glass));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--glass-line));
}
.btn {
  border-radius: 999px;
  background: var(--glass-strong);
  border-color: var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 2px rgba(15, 26, 46, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn:hover {
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 10%);
}
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff 18%), var(--accent));
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn.primary:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-hover) 85%, #fff 15%), var(--accent-hover));
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.btn.ghost:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.btn.danger {
  background: transparent;
  box-shadow: none;
}
.btn.danger:hover {
  background: var(--bad-soft);
}
.input,
.select,
.textarea {
  border-radius: 14px;
  background: var(--glass-strong);
  border-color: var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent), inset 0 1px 0 var(--glass-hi);
}
.tabs {
  gap: 4px;
  border-bottom: 0;
  padding: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  width: max-content;
  max-width: 100%;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--glass-edge);
}
.tabs button {
  border-radius: 999px;
  border-bottom: 0;
  margin-bottom: 0;
  padding: 8px 14px;
}
.tabs button[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.segmented {
  background: var(--glass);
  border-color: var(--glass-line);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.chip {
  background: var(--glass-strong);
  border-color: var(--glass-edge);
  border-radius: 999px;
}
.table th {
  border-bottom-color: var(--glass-edge);
}
.table td,
.row-item {
  border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent);
}
.table tr.clickable:hover td {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.skeleton {
  border-radius: 10px;
}
dialog.modal {
  background: var(--glass-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-3);
}
dialog.modal::backdrop {
  background: rgba(8, 14, 28, 0.32);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.toast {
  background: rgba(15, 26, 46, 0.84);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}
.toast.ok {
  background: color-mix(in srgb, var(--ok) 88%, transparent);
}
.toast.bad {
  background: color-mix(in srgb, var(--bad) 88%, transparent);
}
.bottom-nav {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top-color: var(--glass-edge);
}
.auth {
  background:
    radial-gradient(1000px 640px at 6% -8%, var(--mesh-a), transparent 62%),
    radial-gradient(900px 560px at 104% 2%, var(--mesh-b), transparent 60%),
    radial-gradient(800px 560px at 50% 112%, var(--mesh-c), transparent 60%),
    var(--ground);
}
@media (max-width: 860px) {
  body {
    background-attachment: scroll;
  }
  .sidebar {
    background: linear-gradient(180deg, rgba(12, 24, 48, 0.96), rgba(12, 24, 48, 0.92));
  }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar,
  .topbar,
  .card,
  .kpi,
  .banner,
  .auth-card,
  .public-card,
  .kanban-card,
  .board-card,
  .plan,
  .ticket,
  .shop-item,
  .pos-cart,
  .btn,
  .tabs,
  .segmented,
  dialog.modal,
  .toast,
  .bottom-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .card,
  .kpi,
  .banner,
  .auth-card,
  .public-card,
  .kanban-card,
  .board-card,
  .plan,
  .ticket,
  .shop-item,
  .pos-cart,
  dialog.modal,
  .tabs {
    background: var(--surface);
  }
  .sidebar {
    background: var(--navy);
  }
}

/* ---------- Vepra Analytics: embedded dashboard frame ---------- */
.analytics-frame { width: 100%; min-height: 920px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
@media (max-width: 860px) { .analytics-frame { min-height: 1400px; } }
