/* ═══════════════════════════════════════════════════════════════════
   Components — buttons, inputs, tables, cards, pills, toast, drawer.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Inputs ─────────────────────────────────────────────── */
input, select, textarea {
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--fs-base);
  background: var(--surface-raised);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  min-height: 36px;
}
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) {
  border-color: var(--border-strong);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: var(--shadow-focus);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-sunken);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary); display: inline-block; margin-bottom: 6px; }

/* ── Buttons ─────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--brand-500);
  color: var(--text-on-brand);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  min-height: 34px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { background: var(--brand-600); }
button:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.97); }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Legacy compatibility: buttons that use inline background:#fff expect dark text.
   Without this override they'd inherit our forced white color → white-on-white. */
button[style*="background:#fff"],
button[style*="background: #fff"],
button[style*="background:white"],
button[style*="background: white"],
button[style*="background:#fafafa"],
button[style*="background:#f5f5f5"],
button[style*="background:#f1f5f9"],
button[style*="background:#fafbfc"],
button[style*="background:none"],
button[style*="background:transparent"] {
  color: var(--text-primary) !important;
}

/* Secondary — ghosted on surface */
button.btn-secondary, .btn.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-primary);
  border-color: var(--border-default);
}
button.btn-secondary:hover:not(:disabled), .btn.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

/* Tertiary — no border, low chrome */
button.btn-tertiary, .btn.btn-tertiary {
  background: transparent;
  color: var(--text-primary);
}
button.btn-tertiary:hover:not(:disabled), .btn.btn-tertiary:hover:not(:disabled) {
  background: var(--surface-hover);
}

/* Danger */
button.btn-danger, .btn.btn-danger { background: var(--err-500); }
button.btn-danger:hover:not(:disabled), .btn.btn-danger:hover:not(:disabled) { background: var(--err-600); }

/* Success */
button.btn-success, .btn.btn-success { background: var(--ok-500); color: #fff; }
button.btn-success:hover:not(:disabled), .btn.btn-success:hover:not(:disabled) { background: var(--ok-600); }

/* Sizes */
.btn-sm, button.btn-sm { min-height: 28px; padding: 4px 10px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-lg, button.btn-lg { min-height: 42px; padding: 10px 18px; font-size: var(--fs-md); }

/* Icon-only square */
.btn-icon, button.btn-icon {
  padding: 0;
  width: 34px;
  height: 34px;
  min-height: 34px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-icon:hover:not(:disabled), button.btn-icon:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.btn-icon.btn-ghost, button.btn-icon.btn-ghost { border: none; }
.btn-icon.btn-ghost:hover:not(:disabled), button.btn-icon.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); }

/* Button with loading state */
.btn.is-loading, button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after, button.is-loading::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--text-on-brand);
  animation: bm-spin .6s linear infinite;
}
@keyframes bm-spin { to { transform: rotate(360deg); } }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card.is-interactive { cursor: pointer; }
.card.is-interactive:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-4); flex-wrap: wrap; gap: var(--s-2); }
.card-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-primary); margin: 0; letter-spacing: var(--tracking-snug); }
.card-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; }

/* ── Pills / badges ─────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.pill.pill-brand  { background: var(--brand-100);  color: var(--brand-600);  border-color: transparent; }
.pill.pill-ok     { background: var(--ok-100);     color: var(--ok-600);     border-color: transparent; }
.pill.pill-warn   { background: var(--warn-100);   color: var(--warn-600);   border-color: transparent; }
.pill.pill-err    { background: var(--err-100);    color: var(--err-600);    border-color: transparent; }
.pill.pill-info   { background: var(--info-100);   color: var(--info-500);   border-color: transparent; }
.pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Badge — numeric */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--err-500);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  line-height: 1;
}

/* ── Tables ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-sm);
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table th {
  background: transparent;
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding-top: 14px;
  padding-bottom: 10px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr.is-selected { background: var(--brand-100); }

/* ── Navigation items (sidebar) ─────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 1px 10px;
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  text-decoration: none;
  user-select: none;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--brand-100);
  color: var(--brand-600);
  font-weight: var(--fw-semibold);
}
html[data-theme="dark"] .nav-item.active { background: var(--brand-100); color: var(--brand-400); }
.nav-item svg { flex-shrink: 0; }
.nav-item .nav-item-badge { margin-left: auto; }

.nav-group { margin-top: var(--s-4); }
.nav-group-title {
  padding: 4px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  margin-bottom: 2px;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast-root {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-overlay);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  animation: bm-slide-up var(--dur-base) var(--ease-out);
  min-width: 240px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.toast-success { border-left: 3px solid var(--ok-500); }
.toast.toast-error   { border-left: 3px solid var(--err-500); }
.toast.toast-warning { border-left: 3px solid var(--warn-500); }
.toast.toast-info    { border-left: 3px solid var(--info-500); }

/* ── Drawer (slide-in panel, replaces modals for edits) ─────────── */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1200;
  animation: bm-fade-in var(--dur-base) var(--ease-out);
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-xl);
  z-index: 1201;
  display: flex;
  flex-direction: column;
  animation: bm-drawer-in var(--dur-slow) var(--ease-out);
}
.drawer-head {
  padding: var(--s-4) var(--s-5);
  display: flex; align-items: center; gap: var(--s-3);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.drawer-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-5); }
.drawer-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: flex-end; gap: var(--s-2);
  flex-shrink: 0;
}

/* ── Modal (center sheet) — for confirmations only ─────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  animation: bm-fade-in var(--dur-base) var(--ease-out);
}
.modal {
  background: var(--surface-overlay);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
  animation: bm-scale-in var(--dur-base) var(--ease-out);
}
.modal-body { padding: var(--s-5); }
.modal-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: 0 0 8px; }
.modal-text { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--s-4); line-height: var(--lh-normal); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s-2); padding: 0 var(--s-5) var(--s-5); }

/* ── Skeleton loaders ─────────────────────────────────────────── */
.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--surface-hover) 50%, var(--surface-sunken) 100%);
  background-size: 200% 100%;
  animation: bm-shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  min-height: 12px;
}
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-block { height: 120px; border-radius: var(--radius-lg); }

/* ── Empty state ─────────────────────────────────────────── */
.empty {
  padding: var(--s-12) var(--s-4);
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon { margin: 0 auto var(--s-3); color: var(--text-tertiary); opacity: 0.7; }
.empty-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-primary); margin-bottom: 4px; }
.empty-text { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 360px; margin: 0 auto; }
.empty-action { margin-top: var(--s-4); }

/* ── Command palette ─────────────────────────────────────────── */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  animation: bm-fade-in var(--dur-base) var(--ease-out);
}
.cmdk {
  width: min(560px, 92vw);
  background: var(--surface-overlay);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: bm-scale-in var(--dur-base) var(--ease-out);
  border: 1px solid var(--border-subtle);
}
.cmdk-input {
  width: 100%;
  border: none;
  padding: 16px 20px;
  font-size: var(--fs-md);
  background: transparent;
  color: var(--text-primary);
  outline: none;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 52px;
  border-radius: 0;
}
.cmdk-input:focus { box-shadow: none; border-bottom-color: var(--border-default); }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 6px 0; }
.cmdk-group { padding: 6px 0; }
.cmdk-group-title { padding: 8px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-tertiary); font-weight: var(--fw-semibold); }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: 0;
  min-height: auto;
}
.cmdk-item:hover, .cmdk-item.is-selected {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.cmdk-item.is-selected { background: var(--brand-100); color: var(--brand-600); }
.cmdk-item-meta { margin-left: auto; font-size: var(--fs-xs); color: var(--text-tertiary); }
.cmdk-empty { padding: 32px 16px; text-align: center; color: var(--text-secondary); font-size: var(--fs-sm); }
.cmdk-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Segmented control (replaces .d-tab) ─────────────────────── */
.segmented {
  display: inline-flex;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border-subtle);
}
.segmented button, .segmented .segmented-item {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  min-height: 28px;
}
.segmented button:hover:not(.on):not(:disabled) { background: var(--surface-hover); color: var(--text-primary); }
.segmented button.on, .segmented .segmented-item.on {
  background: var(--surface-raised);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-xs);
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.stat.teal, .stat.is-accent {
  background: var(--brand-100);
  border-color: transparent;
  cursor: pointer;
  position: relative;
}
.stat.is-accent:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-top {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.stat.teal .stat-top, .stat.is-accent .stat-top { color: var(--brand-600); }
.stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.stat.teal .stat-num, .stat.is-accent .stat-num { color: var(--brand-600); }
.stat-num .pre { font-size: var(--fs-md); color: var(--text-secondary); font-weight: var(--fw-semibold); margin-right: -6px; }
.stat.teal .stat-num .pre { color: var(--brand-600); }
.stat-sub { font-size: var(--fs-xs); color: var(--text-secondary); }
.stat-split { display: flex; gap: var(--s-3); font-size: var(--fs-sm); font-weight: var(--fw-semibold); align-items: center; }
.stat-split span { display: inline-flex; align-items: center; gap: 4px; }
.stat .chev { position: absolute; top: var(--s-4); right: var(--s-4); color: var(--brand-500); opacity: .5; }

/* ── User menu items ─────────────────────────────────────── */
.bm-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  width: 100%;
  min-height: auto;
  transition: background var(--dur-fast) var(--ease-out);
}
.bm-menu-item:hover { background: var(--surface-hover); }

/* ── Today page (new dashboard) ─────────────────────────── */
.today-hero { margin-bottom: var(--s-5); }
.today-greeting { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight); color: var(--text-primary); margin: 0; }
.today-date { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 4px; }
.today-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.today-list-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-fast) var(--ease-out);
}
.today-list-item:last-child { border-bottom: none; }
.today-list-item:hover { background: var(--surface-hover); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; }
.today-list-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand-100); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.today-list-main { flex: 1; min-width: 0; }
.today-list-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary); }
.today-list-sub { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 1px; }

/* ── Auth / login (keep, refine) ───────────────────────────────── */
.auth-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-3);
  border: 1px solid var(--border-subtle);
}
.auth-logo { font-weight: var(--fw-bold); font-size: var(--fs-lg); color: var(--brand-500); }
.auth-sub { font-size: var(--fs-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.auth-error { color: var(--err-500); font-size: var(--fs-sm); }

.login-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: var(--surface-sunken);
}
.lg-brand {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: var(--fw-bold);
  color: var(--brand-500);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 4px;
}
.lg-tagline { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--s-8); }
.login-card {
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--s-6) var(--s-5);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-subtle);
}
.lg-h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-primary); margin: 0 0 var(--s-4); text-align: center; }
.lg-back { background: none; border: none; color: var(--brand-500); font-weight: var(--fw-semibold); font-size: var(--fs-sm); cursor: pointer; margin-bottom: var(--s-3); padding: 0; min-height: auto; }
.lg-back:hover { background: transparent; color: var(--brand-600); }

.user-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.user-cards .uc {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--s-4) var(--s-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--surface-raised);
  transition: all var(--dur-fast) var(--ease-out);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  min-height: auto;
}
.user-cards .uc:hover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.uc-av {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: #fff;
}
.uc-role { font-size: var(--fs-xs); color: var(--text-tertiary); font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.pin-user-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: var(--s-4); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--s-5); }
.pin-user-av { width: 52px; height: 52px; border-radius: var(--radius-lg); background: var(--brand-500); display: flex; align-items: center; justify-content: center; font-size: var(--fs-lg); font-weight: var(--fw-bold); color: #fff; }
.pin-user-name { font-size: var(--fs-md); font-weight: var(--fw-semibold); text-align: center; color: var(--text-primary); }
.pin-user-role { font-size: var(--fs-xs); color: var(--text-secondary); text-align: center; text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: var(--s-5); }
.pin-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-default); background: transparent; transition: all var(--dur-fast) var(--ease-out); }
.pin-dot.on { background: var(--brand-500); border-color: var(--brand-500); transform: scale(1.1); }
.pin-dot.err { border-color: var(--err-500); background: var(--err-500); animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

.pin-error { color: var(--err-500); font-size: var(--fs-sm); text-align: center; margin-bottom: var(--s-3); }
.pin-desktop { display: none; flex-direction: column; gap: 10px; margin-bottom: var(--s-3); }
.pin-desktop input { width: 100%; height: 48px; border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 var(--s-3); font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: .4em; text-align: center; outline: none; font-family: inherit; }
.pin-desktop input:focus { border-color: var(--brand-500); box-shadow: var(--shadow-focus); }
.pin-desktop button { width: 100%; height: 44px; font-size: var(--fs-base); }

.pin-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: var(--s-3); }
.pin-key {
  height: 52px;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--dur-fast) var(--ease-out);
  min-height: auto;
}
.pin-key:hover { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-600); }
.pin-key:active { transform: scale(.94); }
.pin-key.pin-clear, .pin-key.pin-del { font-size: var(--fs-sm); color: var(--text-secondary); font-weight: var(--fw-medium); }

.pin-remember { display: flex; gap: 8px; align-items: center; font-size: var(--fs-sm); color: var(--text-secondary); justify-content: center; }

@media(min-width:768px) {
  .pin-desktop { display: flex; }
  .pin-numpad { display: none; }
}

/* ── Topbar actions layout ───────────────────────────────── */
.topbar-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.topbar-divider { width: 1px; height: 20px; background: var(--border-default); margin: 0 4px; }
.topbar-user { padding: 4px 8px; gap: 8px; min-height: 34px; }
.topbar-avatar {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--brand-500); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.topbar-user-name {
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}

@media (max-width: 768px) {
  .topbar-actions { gap: 2px; }
  .topbar-btn { min-width: 32px !important; min-height: 32px !important; width: 32px; height: 32px; padding: 0; }
  .topbar-btn svg { width: 16px !important; height: 16px !important; }
  .topbar-divider { display: none; }
  .topbar-user { padding: 3px 6px; gap: 0; min-height: 32px; }
  .topbar-avatar { width: 24px; height: 24px; font-size: 11px; }
  .topbar-user-name { display: none; }
}

@media (max-width: 380px) {
  .topbar-actions { gap: 1px; }
  .topbar-btn { min-width: 30px !important; min-height: 30px !important; width: 30px; height: 30px; }
  .topbar-btn svg { width: 15px !important; height: 15px !important; }
  .topbar-avatar { width: 22px; height: 22px; font-size: 10px; }
}

/* ── Privacy blur (admin toggle hides monetary values) ───── */
html.is-private [data-private],
html.is-private .money,
html.is-private .amount,
html.is-private .price,
html.is-private .kpi-value,
html.is-private .kpi-v,
html.is-private .stat-value,
html.is-private .total-value,
html.is-private .booking-price,
html.is-private .eur {
  filter: blur(7px);
  transition: filter var(--dur-fast, .15s) var(--ease-out, ease);
  user-select: none;
  pointer-events: none;
}
html.is-private [data-private]:hover,
html.is-private .money:hover,
html.is-private .amount:hover,
html.is-private .price:hover,
html.is-private .kpi-value:hover,
html.is-private .kpi-v:hover,
html.is-private .stat-value:hover,
html.is-private .total-value:hover,
html.is-private .booking-price:hover,
html.is-private .eur:hover {
  filter: blur(0);
  pointer-events: auto;
}
