:root {
  /* Neutrals */
  --neutral-50: #f7f8fb;
  --neutral-100: #eef1f6;
  --neutral-200: #e1e3ea;
  --neutral-300: #cfd3de;
  --neutral-400: #9aa0b4;
  --neutral-500: #7a7f96;
  --neutral-600: #5b6078;
  --neutral-700: #3f4254;
  --neutral-800: #1b1b28;
  --neutral-900: #12121a;

  /* Semantic / brand */
  --primary: #0d6efd;
  --primary-soft: #e8f1ff;
  --primary-hover: #0b5ed7;
  --success: #17c653;
  --success-soft: #e8fff3;
  --warning: #f6c000;
  --warning-soft: #fff8dd;
  --danger: #f8285a;
  --danger-soft: #fff5f8;
  --info: #0484d6;
  --info-soft: #eef8ff;

  /* Surfaces */
  --bg: var(--neutral-100);
  --bg-accent: #e4e9f2;
  --sidebar: #151521;
  --sidebar-2: #1b1b29;
  --sidebar-text: #9a9ab0;
  --sidebar-active: #ffffff;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #f8f9fc;
  --input-bg: #ffffff;
  --hover-bg: #f6f7fa;
  --row-hover: #f7f9ff;
  --ink: #111111;
  --on-ink: #ffffff;
  --open-fg: #9a6b00;
  --open-bg: var(--warning-soft);
  --close-fg: #3d5a80;
  --close-bg: #eef3fb;
  --border: var(--neutral-200);
  --border-soft: #eceef4;
  --text: var(--neutral-800);
  --muted: var(--neutral-500);

  /* Typography scale */
  --font: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 0.75rem;   /* 12 */
  --text-sm: 0.8125rem; /* 13 */
  --text-md: 0.875rem;  /* 14 */
  --text-base: 1rem;    /* 16 */
  --text-lg: 1.25rem;   /* 20 */
  --text-xl: 1.5rem;    /* 24 */
  --text-2xl: 1.875rem; /* 30 */

  /* Spacing (4-based) */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.25rem;
  --space-6: 1.5rem;    /* 24 */
  --space-8: 2rem;      /* 32 */
  --space-10: 2.5rem;
  --space-12: 3rem;     /* 48 */

  /* Radius / elevation */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius: 12px;
  --elev-1: 0 1px 2px rgba(24, 28, 50, 0.06);
  --elev-2: 0 1px 2px rgba(24, 28, 50, 0.04), 0 8px 24px rgba(24, 28, 50, 0.06);
  --elev-3: 0 12px 40px rgba(24, 28, 50, 0.14);
  --shadow: var(--elev-2);

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 250ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  --sidebar-w: 280px;
  --sidebar-w-collapsed: 72px;
  --content-max: none;
  --focus-ring: 0 0 0 3px rgba(13, 110, 253, 0.28);

  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --neutral-50: #1a1e28;
  --neutral-100: #161922;
  --neutral-200: #2a2f3c;
  --bg: #0f1117;
  --bg-accent: #161922;
  --card: #171a22;
  --surface: #171a22;
  --surface-2: #1c2030;
  --surface-3: #1a1e28;
  --input-bg: #12151d;
  --hover-bg: #1e2433;
  --row-hover: #1a1f2c;
  --ink: #e8eaf2;
  --on-ink: #0f1117;
  --open-fg: #e0b84a;
  --open-bg: rgba(246, 192, 0, 0.14);
  --close-fg: #9eb6d4;
  --close-bg: rgba(158, 182, 212, 0.12);
  --border: #2a2f3c;
  --border-soft: #232836;
  --text: #e8eaf2;
  --muted: #9aa0b4;
  --primary-soft: rgba(13, 110, 253, 0.18);
  --success-soft: rgba(23, 198, 83, 0.14);
  --warning-soft: rgba(246, 192, 0, 0.14);
  --danger-soft: rgba(248, 40, 90, 0.14);
  --info-soft: rgba(4, 132, 214, 0.14);
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --elev-2: 0 8px 24px rgba(0, 0, 0, 0.35);
  --elev-3: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow: var(--elev-2);
  --focus-ring: 0 0 0 3px rgba(105, 170, 255, 0.35);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --neutral-50: #1a1e28;
    --neutral-100: #161922;
    --neutral-200: #2a2f3c;
    --bg: #0f1117;
    --bg-accent: #161922;
    --card: #171a22;
    --surface: #171a22;
    --surface-2: #1c2030;
    --surface-3: #1a1e28;
    --input-bg: #12151d;
    --hover-bg: #1e2433;
    --row-hover: #1a1f2c;
    --ink: #e8eaf2;
    --on-ink: #0f1117;
    --open-fg: #e0b84a;
    --open-bg: rgba(246, 192, 0, 0.14);
    --close-fg: #9eb6d4;
    --close-bg: rgba(158, 182, 212, 0.12);
    --border: #2a2f3c;
    --border-soft: #232836;
    --text: #e8eaf2;
    --muted: #9aa0b4;
    --primary-soft: rgba(13, 110, 253, 0.18);
    --success-soft: rgba(23, 198, 83, 0.14);
    --warning-soft: rgba(246, 192, 0, 0.14);
    --danger-soft: rgba(248, 40, 90, 0.14);
    --info-soft: rgba(4, 132, 214, 0.14);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(13, 110, 253, 0.08), transparent 55%),
    radial-gradient(900px 400px at -10% 100%, rgba(23, 198, 83, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; }
.mb { margin-bottom: 1rem; }
.text-success { color: #0f8a3b; }
.text-warning { color: #9a7600; }
.text-danger { color: #c01245; }

.app-shell { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.85rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.brand {
  display: flex; gap: 0.85rem; align-items: center;
  padding: 0.55rem 0.85rem 1.25rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 2.65rem;
  width: auto;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}
.brand-mark img,
.brand-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: center;
}
.brand-mark.lg {
  height: 6.75rem;
  margin: 0 auto 0.85rem;
}
.brand-title { color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.72rem; color: #7f8098; margin-top: 0.1rem; }

.side-nav {
  display: flex; flex-direction: column; gap: 0.15rem;
  flex: 1; overflow-y: auto; padding: 0 0.2rem 0.5rem;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nav-group { margin-bottom: 0.35rem; }
.nav-group-title {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #6b6c84; padding: 0.65rem 0.9rem 0.35rem; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.nav-group-title::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid #6b6c84;
  border-bottom: 1.5px solid #6b6c84;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.7;
}
.nav-group.collapsed .nav-group-title::after { transform: rotate(-45deg); }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group-items { display: flex; flex-direction: column; gap: 0.1rem; }

.nav-item {
  color: var(--sidebar-text);
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 0.5rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(13,110,253,0.28), rgba(13,110,253,0.08));
  color: var(--sidebar-active);
  box-shadow: inset 3px 0 0 #0d6efd;
}
.nav-badge {
  margin-left: auto; font-size: 0.62rem; font-weight: 700;
  background: rgba(255,255,255,0.1); color: #c5c5d6;
  border-radius: 4px; padding: 0.12rem 0.35rem; letter-spacing: 0.04em;
}

/* --- Main --- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.85rem 1.75rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left {
  display: flex; align-items: center; gap: 0.85rem;
  min-width: 0; flex: 1 1 auto; order: 1;
}
.topbar-context {
  order: 2;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(18rem, 40vw);
  padding-right: 0.85rem;
  border-right: 1px solid var(--border);
}
.topbar:not(:has(.topbar-context)) .topbar-right { margin-left: auto; }
.page-title {
  margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Hidden by default; only shown in the mobile drawer breakpoint below. */
.menu-toggle,
.menu-toggle.btn-icon {
  display: none !important;
  border: 1px solid var(--border); background: var(--card);
  border-radius: 10px; padding: 0.45rem 0.7rem; cursor: pointer; font-size: 1rem;
}
/* Compact logo in topbar — mobile only (sidebar closed / drawer). */
.topbar-brand {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 2rem;
  width: auto;
  text-decoration: none;
  line-height: 0;
}
.topbar-brand .brand-logo {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}
.content { padding: 1.35rem 1.75rem 2.5rem; }
.breadcrumbs { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.breadcrumbs a { color: var(--muted); }

.topbar-right {
  display: flex; align-items: center; gap: 0.65rem;
  flex-wrap: nowrap; justify-content: flex-end;
  flex: 0 0 auto; order: 3; min-width: 0;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  padding: 0.85rem 0.45rem 0.25rem;
  background: linear-gradient(180deg, transparent 0%, var(--sidebar-2) 35%);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.lang-switch {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--surface);
}
.lang-switch-sidebar {
  display: flex;
  width: 100%;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: visible;
  box-shadow: none;
}
.lang-switch-sidebar .lang-form { flex: 1; margin: 0; min-width: 0; }
.lang-switch-sidebar .lang-btn {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #8a8ba3;
  padding: 0.48rem 0.25rem;
  cursor: pointer;
  border-radius: 8px;
  border-right: 0;
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.lang-switch-sidebar .lang-form:last-child .lang-btn { border-right: 0; }
.lang-switch-sidebar .lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.lang-switch-sidebar .lang-btn.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.14), rgba(13, 110, 253, 0.28));
  box-shadow: inset 0 -2px 0 #0d6efd;
}

.lang-form { margin: 0; }
.lang-btn {
  appearance: none; border: 0; background: transparent;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); padding: 0.38rem 0.55rem; cursor: pointer;
  border-right: 1px solid var(--border);
  transition: color 0.12s ease, background 0.12s ease;
}
.lang-form:last-child .lang-btn { border-right: 0; }
.lang-btn:hover { color: var(--text); background: var(--hover-bg); }
.lang-btn.active {
  color: var(--text); background: var(--surface-2);
}
.auth-lang {
  display: inline-flex;
  justify-content: center;
  margin: 1.1rem auto 0;
  width: fit-content;
  max-width: 100%;
}
.topbar-restaurant {
  display: block;
  font-size: 0.8rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.topbar-restaurant:hover { text-decoration: none; color: var(--primary); }
.restaurant-switch.topbar-context {
  display: flex; align-items: center; gap: 0.45rem; width: auto;
}
.restaurant-switch.topbar-context select {
  max-width: 100%; min-width: 0; width: 100%;
}
.topbar-account {
  display: flex; align-items: center; gap: 0.75rem;
  min-width: 0;
}
.topbar-account-text { min-width: 0; text-align: right; line-height: 1.25; }
.topbar-account-email {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem;
}
.topbar-account-role {
  font-size: 0.7rem; color: var(--muted); font-weight: 500;
  margin-top: 0.1rem;
}
.topbar-logout { margin: 0; }
.btn-logout {
  appearance: none; border: 1px solid #f0c2c2; background: #fdf2f2;
  color: #c0392b; font-size: 0.75rem; font-weight: 600;
  padding: 0.35rem 0.7rem; border-radius: 8px; cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn-logout:hover {
  color: #fff; border-color: #c0392b; background: #c0392b;
}
.btn-logout.btn-icon {
  color: #c0392b; border-color: #f0c2c2; background: #fdf2f2;
}
.btn-logout.btn-icon:hover {
  color: #fff; border-color: #c0392b; background: #c0392b;
}
.context-pill {
  background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; padding: 0.4rem 0.85rem;
  font-weight: 700; font-size: 0.8rem; white-space: nowrap;
}
.restaurant-switch { display: flex; align-items: center; gap: 0.45rem; }
.restaurant-switch label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.input-readonly {
  background: var(--surface-2) !important;
  color: var(--text);
  cursor: default;
  border-color: var(--border) !important;
}
.restaurant-switch select,
.filters input[type="search"],
.filters select {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.55rem 0.75rem; background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9rem; min-width: 0;
}
.restaurant-switch select {
  max-width: 16rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.15rem;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.95rem 0.95rem;
  line-height: 1.25;
}
.filters input[type="search"] { width: 14rem; max-width: 100%; }
.filters select { max-width: 12rem; }
.restaurant-switch select:focus,
.filters input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none; border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* --- Cards / stats --- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.15rem;
}
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 0.25rem;
}
.card-header.between {
  flex-direction: row; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
}
.card-header h2,
.card-title-text h2,
.card-title-row > h2,
.block-header-text h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-header .muted,
.card-title-text > .muted,
.block-header-text > .muted,
.block-hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 500;
}
.card-body { padding: 1.15rem 1.25rem 1.3rem; }

/* Standard: back control sits left of the main title (card / detail / toolbar) */
.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}
/* Optically center the 2rem back control with the h2 first line (1.05rem × 1.3). */
.card-title-row > .card-back {
  flex: 0 0 auto;
  margin-top: calc((1.05rem * 1.3 - 2rem) / 2);
}
.card-title-row > h2 {
  margin: 0;
  align-self: center;
  line-height: 1.3;
}
.card-title-text,
.block-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
/* Single-line titles (direct h2): true vertical center with back arrow. */
.card-title-row:not(:has(.card-title-text, .block-header-text)) {
  align-items: center;
}
.card-title-row:not(:has(.card-title-text, .block-header-text)) > .card-back {
  margin-top: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.85rem; margin-bottom: 1.15rem;
}
.stat-card {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  gap: 0.85rem;
  padding: 1.1rem 1.1rem 1.1rem 1.15rem;
  position: relative; overflow: visible;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-3) 100%);
  box-shadow: var(--elev-1);
  transition: border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.stat-card:hover {
  text-decoration: none; color: inherit;
  border-color: var(--neutral-300);
  box-shadow: var(--elev-2);
}
.stat-card:active { transform: translateY(1px); }
.stat-card.is-success {
  background: linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--success-soft) 55%, var(--surface)) 100%);
}
.stat-card.is-warning {
  background: linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--warning-soft) 55%, var(--surface)) 100%);
}
.stat-card.is-info {
  background: linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--info-soft) 55%, var(--surface)) 100%);
}
.stat-card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 12px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  border: 0;
}
.stat-card.is-success .stat-card-icon {
  background: var(--success-soft); color: #0f8a3b;
}
.stat-card.is-warning .stat-card-icon {
  background: var(--warning-soft); color: #9a7600;
}
.stat-card.is-info .stat-card-icon {
  background: var(--info-soft); color: var(--info);
}
.stat-card.is-success .stat-value { color: #0f8a3b; }
.stat-card.is-warning .stat-value { color: #9a7600; }
.stat-card.is-info .stat-value { color: var(--info); }
.stat-card-body {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.stat-label {
  color: var(--muted); font-size: 0.76rem; font-weight: 600;
  line-height: 1.25; letter-spacing: 0.01em;
}
.stat-value {
  font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
  color: var(--text);
}
.stat-card.tooltip::after {
  white-space: normal; max-width: 15.5rem; width: max-content;
  text-align: left; line-height: 1.35; font-weight: 550;
  z-index: 8; box-shadow: 0 6px 18px rgba(16, 18, 28, 0.18);
}
html[data-theme="dark"] .stat-card {
  background: linear-gradient(160deg, #1a1e28 0%, #151922 100%);
  border-color: var(--border);
}
html[data-theme="dark"] .stat-card.is-success {
  background: linear-gradient(160deg, #1a1e28 0%, #15201a 100%);
}
html[data-theme="dark"] .stat-card.is-warning {
  background: linear-gradient(160deg, #1a1e28 0%, #201c14 100%);
}
html[data-theme="dark"] .stat-card.is-info {
  background: linear-gradient(160deg, #1a1e28 0%, #141c24 100%);
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border: 0; border-radius: 10px; padding: 0.62rem 1.05rem;
  font-weight: 700; cursor: pointer; text-decoration: none;
  font-size: 0.9rem; font-family: inherit; line-height: 1.2;
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary {
  background: var(--neutral-100); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--neutral-200); }
.main .btn-secondary, .content .btn-secondary {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.14);
}
.main .btn-ghost, .content .btn-ghost {
  color: var(--text); border-color: var(--border); background: var(--surface);
}
.main .btn-ghost:hover, .content .btn-ghost:hover { background: var(--hover-bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); color: #fff; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.actions-row { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.28rem 0.55rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge-success { background: var(--success-soft); color: #0a7a45; }
.badge-warning { background: var(--warning-soft); color: #8a6a00; }
.badge-danger { background: var(--danger-soft); color: #c01245; }
.badge-info { background: var(--info-soft); color: #0369a1; }
.badge-dark { background: var(--surface-2); color: #3f4254; }
.badge-muted { background: var(--surface-2); color: #7e8299; }
.badge-ro { background: rgba(255,255,255,0.1); color: #c5c5d6; }

/* --- Tables --- */
.table-wrap {
  overflow-x: auto; margin: 0 -0.25rem;
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  min-width: 640px;
}
.data-table th, .data-table td {
  text-align: left; padding: 0.85rem 0.85rem;
  border-bottom: 1px solid var(--border-soft); font-size: 0.9rem;
  vertical-align: middle;
}
.data-table th {
  color: var(--muted); font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-3); position: sticky; top: 0;
}
.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child { border-radius: 0 10px 0 0; }
.data-table tbody tr { transition: background 0.1s ease; }
.data-table tbody tr:hover td { background: var(--row-hover); }
.sticky-cols tbody tr:hover .sticky-start,
.sticky-cols tbody tr:hover .sticky-end { background: var(--row-hover); }
.data-table td.cell-id, .data-table td.cell-uuid {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: var(--muted); white-space: nowrap;
}
.data-table td.cell-actions { text-align: right; white-space: nowrap; width: 1%; }
.link-action {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-weight: 700; font-size: 0.84rem; color: var(--primary);
  padding: 0.3rem 0.55rem; border-radius: 8px;
}
.link-action:hover { background: var(--primary-soft); text-decoration: none; }
.data-table td.cell-linkedin {
  text-align: center;
  width: 1%;
  white-space: nowrap;
}
.linkedin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a66c2;
  padding: 0.3rem;
  border-radius: 8px;
  line-height: 0;
}
.linkedin-link:hover {
  background: var(--primary-soft);
  color: #004182;
  text-decoration: none;
}
.linkedin-link .icon-linkedin { display: block; }
.cell-empty { color: var(--muted); }

.pager {
  display: flex; justify-content: flex-end; align-items: center;
  margin-top: 1rem; gap: 1rem; flex-wrap: wrap;
  padding-top: 0.85rem; border-top: 1px solid var(--border-soft);
}
.pager-nav {
  display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap;
}
.pager-btn, .pager-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.15rem; height: 2.15rem; padding: 0 0.5rem;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font-size: 0.84rem; font-weight: 650; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
}
.pager-btn {
  min-width: 2.55rem; height: 2.55rem;
  font-size: 1rem; font-weight: 700;
  border-width: 1.5px; border-color: #c8cede;
  background: var(--surface-2); color: var(--primary);
  gap: 0;
}
.pager-btn .icon { width: 1.05rem; height: 1.05rem; }
.pager-btn:hover, .pager-num:hover {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
  text-decoration: none; transform: translateY(-1px);
}
.pager-num.is-current {
  background: var(--primary); border-color: var(--primary); color: #fff;
  cursor: default; pointer-events: none;
}
.pager-btn.is-disabled, .pager-gap {
  opacity: 0.35; cursor: default; pointer-events: none;
  background: var(--surface-2); transform: none;
}
.pager-gap {
  border: none; background: transparent; min-width: 1.25rem;
  font-weight: 700; color: var(--muted); opacity: 1;
}
.cell-num {
  width: 3rem; color: var(--muted); font-variant-numeric: tabular-nums;
  font-weight: 650; font-size: 0.82rem;
}
.view-tabs {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
}
.view-tab {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem; border-radius: 8px;
  font-size: 0.82rem; font-weight: 650; color: var(--muted);
  text-decoration: none; border: none; background: transparent; cursor: pointer;
}
.view-tab:hover { color: var(--text); text-decoration: none; }
.view-tab.is-active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.08);
}
.cal-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; flex-wrap: wrap;
  margin: 0 0 0.85rem;
}
.cal-modes { display: inline-flex; gap: 0.3rem; }
.cal-nav { display: inline-flex; align-items: center; gap: 0.4rem; }
.cal-title { font-weight: 750; font-size: 1rem; min-width: 10rem; text-align: center; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.cal-head {
  background: var(--surface-2); padding: 0.55rem 0.4rem; text-align: center;
  font-size: 0.72rem; font-weight: 750; color: var(--muted); text-transform: uppercase;
}
.cal-cell {
  background: var(--surface); min-height: 6.5rem; padding: 0.4rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.cal-cell.is-muted { background: var(--surface-3); opacity: 0.72; }
.cal-cell.is-today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-daynum-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.35rem; min-height: 1.25rem;
}
.cal-daynum { font-size: 0.78rem; font-weight: 750; color: var(--muted); line-height: 1; }
.cal-daynum-meta {
  display: inline-flex; align-items: center; justify-content: flex-end;
  gap: 0.3rem; min-width: 0; flex: 0 1 auto;
}
.cal-today-label {
  font-size: 0.65rem; font-weight: 750; line-height: 1;
  color: var(--primary); letter-spacing: 0.01em;
  white-space: nowrap;
}
.cal-cell.is-today .cal-daynum { color: var(--primary); font-weight: 800; }
.cal-day-count {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 0.68rem; font-weight: 750; line-height: 1;
  box-shadow: 0 1px 2px rgba(13, 110, 253, 0.25);
}
.cal-event-row {
  display: flex; align-items: stretch; gap: 0.2rem; min-width: 0;
}
.cal-event {
  flex: 1 1 auto; min-width: 0;
  display: block; padding: 0.2rem 0.35rem; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 0.7rem; font-weight: 650; line-height: 1.25;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event:hover { filter: brightness(0.97); text-decoration: none; }
.cal-event.is-pending { background: var(--warning-soft); color: #9a5b00; }
.cal-event.is-cancelled { background: var(--danger-soft); color: #a32020; }
.cal-event.is-blocked { background: var(--danger-soft); color: #a32020; }
.cal-event-remove { display: flex; flex: 0 0 auto; margin: 0; }
.cal-event-minus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; min-width: 1.35rem; padding: 0; border: 0;
  border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: #a32020;
}
.cal-event-minus:hover {
  background: color-mix(in srgb, var(--danger) 28%, var(--surface));
  color: #8a1212;
}
.cal-event-minus .icon-sm { width: 0.85rem; height: 0.85rem; }
.cal-cell.has-blocks { background: color-mix(in srgb, var(--danger-soft) 35%, var(--surface)); }
.cal-cell.is-all-day-blocked {
  background: color-mix(in srgb, var(--danger-soft) 72%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 28%, transparent);
}
.cal-cell.is-all-day-blocked .cal-daynum { color: #a32020; font-weight: 800; }
.cal-cell.is-all-day-blocked .cal-day-count {
  background: #c01245;
  box-shadow: 0 1px 2px rgba(192, 18, 69, 0.28);
}
.cal-more { font-size: 0.68rem; color: var(--muted); font-weight: 650; }
.block-cal {
  margin-top: 0;
}
.block-cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
/* Calendar toolbars sit flush under card-body padding (no extra top margin). */
.card-body > .cal-toolbar:first-child,
.card-body > .block-cal,
.card-body.list-live > .cal-toolbar:first-child {
  margin-top: 0;
}
.card-body.list-live:has(> .cal-toolbar:first-child) {
  padding-top: 0.9rem;
}
.card-body:has(> .block-cal) {
  padding-top: 0.9rem;
}
.block-hint {
  max-width: 36rem;
}
.block-header-actions {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.55rem;
}
.block-saved-summary {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  min-height: 1.5rem;
}
#blockBuilder {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
#blockAddForm.block-add-panel {
  margin: 0 0 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--neutral-50) 100%);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}
#blockAddForm.block-add-panel.is-collapsed,
#blockAddForm.block-add-panel[hidden] {
  display: none !important;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.block-open-ico[hidden] { display: none !important; }
.block-range-fields {
  display: flex; align-items: flex-end; gap: 0.65rem; flex-wrap: wrap;
}
.block-time-field {
  display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted);
}
.block-time-field input[type="time"] {
  min-height: 2.4rem; padding: 0.35rem 0.55rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text);
}
.block-range-sep { padding-bottom: 0.55rem; color: var(--muted); font-weight: 700; }
.block-reason-field { display: flex; flex-direction: column; gap: 0.35rem; width: 100%; }
.block-reason-field input[type="text"] {
  min-height: 2.5rem; padding: 0.45rem 0.7rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; max-width: 28rem;
}
.block-year-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.65rem;
}
.block-year-cell {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.85rem 0.9rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); text-decoration: none; color: inherit;
}
.block-year-cell:hover { border-color: var(--primary); }
.block-year-cell.has-blocks { background: color-mix(in srgb, var(--danger-soft) 40%, var(--surface)); }
.block-year-label { font-weight: 700; font-size: 0.9rem; }
.block-year-count { font-size: 0.78rem; font-weight: 650; }
.inline-form { display: inline; }
.cal-week, .cal-day {
  display: flex; flex-direction: column; gap: 0.65rem;
}
.cal-slot {
  border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.9rem; background: var(--surface);
}
.cal-slot-time { font-size: 0.78rem; font-weight: 750; color: var(--muted); margin-bottom: 0.45rem; }
.cal-slot-list { display: flex; flex-direction: column; gap: 0.35rem; }

/* --- Detail / forms --- */
.detail-toolbar { margin-bottom: 0.75rem; }
.detail-panel {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: none;
  overflow: hidden;
  max-width: 52rem;
  width: 100%;
}
.detail-panel.msg-detail,
.detail-panel.detail-panel-full { max-width: none; }
.detail-panel-head {
  padding: 0.85rem 1.1rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
}
.detail-panel-head.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.detail-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  min-width: 0;
}
.detail-panel-actions {
  margin-left: auto;
  flex-shrink: 0;
}
.detail-list {
  margin: 0;
  padding: 0.15rem 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.detail-row {
  display: grid;
  gap: 0.15rem 0.75rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.detail-row.is-wide { grid-column: 1 / -1; }
.detail-row:nth-last-child(-n+2):not(.is-wide) { border-bottom: none; }
.detail-row.is-wide:last-child { border-bottom: none; }
.detail-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.detail-row dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}
.detail-row dd.mono { font-weight: 500; color: #3f4254; }
.detail-row .fk-label { display: block; }
.detail-row .fk-id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.detail-related {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.detail-related li { line-height: 1.4; }

/* Legacy detail grid (module pages) */
.detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1.5rem;
}
.detail-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
  border-radius: 0;
  min-width: 0;
}
.detail-label {
  font-size: 0.72rem; color: var(--muted);
  letter-spacing: 0.01em; margin-bottom: 0.2rem; font-weight: 650;
  text-transform: none;
}
.detail-value {
  font-weight: 550; word-break: break-word; line-height: 1.4;
}
.detail-value.mono { font-weight: 500; color: #3f4254; }
.span-2 { grid-column: span 2; }

.admin-form .field-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; margin-left: 0.25rem;
  border-radius: 999px; border: 1px solid var(--border);
  font-size: 0.65rem; font-weight: 800; color: var(--muted);
  cursor: help; vertical-align: middle;
  background: var(--hover-bg);
}
.field-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.admin-form .field-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.admin-form input::placeholder,
.admin-form textarea::placeholder {
  color: #a0a4b8;
  opacity: 1;
}

.admin-form .form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1.25rem;
  max-width: 52rem;
}
.admin-form .form-row {
  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem;
}
.admin-form .form-row.span-2 { grid-column: span 2; }
.admin-form label { font-weight: 700; font-size: 0.84rem; }
.admin-form .req { color: var(--danger); }
.admin-form input, .admin-form select, .admin-form textarea {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.65rem 0.8rem; font: inherit; background: var(--input-bg); width: 100%;
}
.admin-form textarea { resize: vertical; min-height: 96px; }

/* Compact field sizes - short controls, long text stays full via .span-2 */
.admin-form .field-sm > :is(input, select),
.admin-form .field-sm > .input-readonly {
  max-width: 8.5rem;
}
.admin-form .field-md > :is(input, select),
.admin-form .field-md > .input-readonly {
  max-width: 18rem;
}
.admin-form .field-lg > :is(input, select),
.admin-form .field-lg > .input-readonly {
  max-width: 28rem;
}
.admin-form .field-sm .time-field,
.admin-form .field-md .time-field,
.admin-form .field-lg .time-field {
  max-width: none;
}

.admin-form .input-date,
.admin-form .input-time,
.admin-form .input-datetime {
  max-width: 16rem;
  font-variant-numeric: tabular-nums;
}
.time-field { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; }
.time-field[data-datetime-field] {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  width: 100%;
  max-width: none;
}
.time-field[data-datetime-field] > input[type="hidden"] { display: none; }
.time-field[data-datetime-field] .input-date {
  flex: 0 0 10.5rem;
  width: 10.5rem !important;
  max-width: 10.5rem !important;
  padding: 0.5rem 0.65rem;
}
.time-field[data-datetime-field] select.input-time {
  flex: 0 0 6.75rem;
  width: 6.75rem !important;
  max-width: 6.75rem !important;
  padding: 0.5rem 1.75rem 0.5rem 0.55rem;
}
.time-field[data-datetime-field] .time-presets {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  align-self: center;
}
.time-field select.input-time {
  appearance: none; -webkit-appearance: none;
  max-width: 9rem;
  padding-right: 2rem;
  font-variant-numeric: tabular-nums;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.time-presets { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.time-chip {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 0.7rem; font-weight: 700;
  padding: 0.22rem 0.42rem; border-radius: 6px; cursor: pointer;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.time-chip:hover { color: var(--text); border-color: #c8cad3; background: var(--hover-bg); }
.time-chip.active {
  color: var(--primary); border-color: #b7c9f0;
  background: var(--primary-soft);
}
.time-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }

/* Boolean switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  width: fit-content;
  margin: 0.15rem 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d5d8e2;
  border: 1px solid #c8cad3;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(24, 28, 50, 0.18);
  transition: transform 0.18s ease;
}
.switch input:checked + .switch-track {
  background: var(--primary);
  border-color: var(--primary);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.22);
}
.switch:hover .switch-track {
  border-color: #b0b4c2;
}
.switch-text { font-size: 0.86rem; min-width: 2.5rem; }
.switch-on { display: none; color: var(--primary); font-weight: 700; }
.switch-off { display: inline; color: var(--muted); font-weight: 600; }
.switch input:checked ~ .switch-text .switch-on { display: inline; }
.switch input:checked ~ .switch-text .switch-off { display: none; }

.alert {
  padding: 0.85rem 1rem; border-radius: 10px; margin-bottom: 1rem;
  font-size: 0.9rem; font-weight: 500;
}
.alert-danger { background: var(--danger-soft); color: #c01245; border: 1px solid #ffdbe6; }
.alert-info { background: var(--info-soft); color: #0369a1; border: 1px solid #d7f0ff; }
.alert-warning { background: #fff7e6; color: #9a6700; border: 1px solid #ffe2a8; }
.alert-success { background: var(--success-soft); color: #0a7a45; border: 1px solid #c8f5dc; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state h3 { color: var(--text); margin: 0 0 0.45rem; font-weight: 800; }
.empty-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 800;
}

.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* --- Auth --- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(13,110,253,0.16), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(23,198,83,0.12), transparent 32%),
    linear-gradient(160deg, #eef1f6, #e6ebf4 60%, #dde5f2);
}
.auth-wrap {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-card {
  width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 2rem 1.75rem; box-shadow: 0 16px 48px rgba(24, 28, 50, 0.1);
}
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand h1 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; }
.auth-brand p { margin: 0.35rem 0 0; color: var(--muted); font-weight: 500; }
.auth-form { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-form label { font-size: 0.84rem; font-weight: 700; margin-top: 0.55rem; }
.auth-form input {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.7rem 0.85rem; background: var(--surface); color: var(--text); font: inherit;
}
.password-field {
  position: relative; display: block;
}
.password-field input {
  width: 100%;
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.15rem; height: 2.15rem;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.password-toggle .icon-eye,
.password-toggle .icon-eye-off {
  display: none;
  pointer-events: none;
  line-height: 0;
}
.password-toggle .icon-eye { display: inline-flex; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: inline-flex; }
.password-toggle:hover { color: var(--text); background: var(--hover-bg); }
.password-toggle:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.45); outline-offset: 1px;
}
.auth-form .btn { margin-top: 1.1rem; }

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 16, 28, 0.45); z-index: 25;
}
.nowrap { white-space: nowrap; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.hub-card {
  display: block;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.hub-card:hover {
  border-color: #b6d4fe;
  background: var(--primary-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.hub-title { font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-105%); transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle,
  .menu-toggle.btn-icon { display: inline-flex !important; }
  /* Hide while the mobile drawer is already open. */
  .sidebar.open ~ .main .menu-toggle,
  .sidebar.open ~ .main .menu-toggle.btn-icon { display: none !important; }
  .content { padding: 1rem; }
  .topbar { padding: 0.9rem 1rem; }
  .detail-grid, .detail-list, .admin-form .form-grid { grid-template-columns: 1fr; }
  .span-2, .admin-form .form-row.span-2, .detail-row.is-wide { grid-column: span 1; }
  .detail-row:nth-last-child(-n+2):not(.is-wide) { border-bottom: 1px solid var(--border-soft); }
  .detail-row:last-child { border-bottom: none; }
  .sidebar-backdrop.show { display: block; }
  .filters input[type="search"] { min-width: 140px; width: 100%; }
}

/* --- Server-side list controls --- */
.list-controls {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.85rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.list-controls-left, .list-controls-right {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
}
.list-per {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.list-per select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.35rem 0.5rem; font: inherit; background: var(--surface); color: var(--text);
  width: 4.75rem;
}
.list-controls input[type="search"] {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.45rem 0.7rem; font: inherit; background: var(--surface);
  width: 14rem; max-width: 100%; min-width: 10rem;
}
.list-info { font-size: 0.82rem; }
.list-live { position: relative; min-height: 2rem; }

/* --- Opening hours editor --- */
.hours-editor {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
  width: 100%;
}
.hours-modes {
  display: inline-flex; gap: 0.5rem; flex-wrap: wrap;
  width: fit-content;
  padding: 0.3rem;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}
.hours-mode {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.55rem 0.9rem 0.55rem 0.7rem;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.hours-mode-icon {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(24, 28, 50, 0.04);
}
.hours-mode-icon .icon { width: 0.95rem; height: 0.95rem; }
.hours-mode-text { line-height: 1.2; text-align: left; }
.hours-mode:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.hours-mode-all:hover .hours-mode-icon,
.hours-mode-all.is-active .hours-mode-icon {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #c9dbf8;
}
.hours-mode-week:hover .hours-mode-icon,
.hours-mode-week.is-active .hours-mode-icon {
  color: var(--info);
  background: var(--info-soft);
  border-color: #c5e4f5;
}
.hours-mode-day:hover .hours-mode-icon,
.hours-mode-day.is-active .hours-mode-icon {
  color: #b8860b;
  background: var(--warning-soft);
  border-color: #f0df9a;
}
.hours-mode.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: transparent;
  transform: translateY(-1px);
}
.hours-mode-all.is-active {
  border-color: #b7c9f0;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.12), 0 6px 16px rgba(13, 110, 253, 0.14);
}
.hours-mode-week.is-active {
  border-color: #a9d4ea;
  box-shadow: 0 0 0 1px rgba(4, 132, 214, 0.12), 0 6px 16px rgba(4, 132, 214, 0.14);
}
.hours-mode-day.is-active {
  border-color: #e8d48a;
  box-shadow: 0 0 0 1px rgba(246, 192, 0, 0.18), 0 6px 16px rgba(246, 192, 0, 0.16);
}
.hours-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* Fill available width; cap preferred size so columns don't balloon */
.hours-editor[data-mode="all"] .hours-grid {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 16.5rem);
}
.hours-editor[data-mode="week"] .hours-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 40.5rem);
}
.hours-editor[data-mode="day"] .hours-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: min(100%, 77rem);
}
.hours-day {
  background: var(--surface);
  min-height: 10rem;
  min-width: 0;
  width: 100%;
  padding: 0.7rem 0.55rem 0.55rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}
.hours-day:last-child,
.hours-day.is-last-visible { border-right: 0; }
.hours-day.is-hidden { display: none !important; }
.hours-day-head {
  text-align: center; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em; color: var(--text);
  margin-bottom: 0.2rem;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
  min-width: 0;
}
.hours-slots { display: flex; flex-direction: column; gap: 0.45rem; flex: 1; min-width: 0; }
.hours-slot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: stretch; gap: 0.12rem;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.18rem; background: var(--surface);
  min-width: 0;
  container-type: inline-size;
  container-name: hours-slot;
}
.hours-time {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.08rem, 2.5cqi, 0.22rem);
  min-width: 0;
  min-height: clamp(1.7rem, 28cqi, 2.05rem);
  padding: 0.18rem clamp(0.12rem, 2cqi, 0.25rem);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
}
.hours-time-open {
  color: var(--open-fg);
  background: var(--open-bg);
}
.hours-time-close {
  color: var(--close-fg);
  background: var(--close-bg);
}
.hours-time-ico {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  opacity: 0.9;
}
.hours-time-ico .icon {
  width: clamp(0.55rem, 11cqi, 0.78rem);
  height: clamp(0.55rem, 11cqi, 0.78rem);
}
.hours-hm {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.04rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  min-width: 0;
}
.hours-hm b {
  font-size: clamp(0.72rem, 16cqi, 1.05rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: inherit;
}
.hours-hm sup {
  font-size: clamp(0.45rem, 9cqi, 0.58rem);
  font-weight: 700;
  margin-top: 0.06rem;
  letter-spacing: 0.02em;
  opacity: 0.72;
}
@container hours-slot (max-width: 8.5rem) {
  .hours-time-ico { display: none; }
}
.hours-time input[type="time"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 1rem;
  background: transparent;
}
.hours-time input[type="time"]:focus { outline: none; }
.hours-time:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(13, 110, 253, 0.35);
}
.hours-time-open:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(176, 130, 0, 0.45);
}
.hours-time-close:focus-within {
  box-shadow: inset 0 0 0 1.5px rgba(61, 90, 128, 0.4);
}
.hours-slot-sep {
  width: 1px; align-self: stretch; background: var(--border);
  margin: 0.15rem 0;
}
.hours-remove {
  appearance: none;
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  z-index: 3;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(24, 28, 50, 0.06);
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.hours-remove .icon { width: 0.6rem; height: 0.6rem; }
.hours-remove:hover,
.hours-remove:focus-visible {
  color: var(--danger);
  border-color: #f3b3c3;
  background: var(--danger-soft);
  outline: none;
  transform: scale(1.08);
}
.hours-remove::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.3rem);
  padding: 0.26rem 0.48rem;
  border-radius: 6px;
  background: #1b1b28;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  box-shadow: 0 6px 16px rgba(24, 28, 50, 0.18);
  z-index: 5;
}
.hours-remove:hover::after,
.hours-remove:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.hours-slot:has(.hours-remove) .hours-time-close {
  padding-right: 1rem;
}
.hours-add {
  appearance: none;
  align-self: center;
  margin-top: 0.15rem;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  position: relative;
  box-shadow: 0 1px 2px rgba(24, 28, 50, 0.05);
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}
.hours-add .icon { width: 0.78rem; height: 0.78rem; }
.hours-add:hover,
.hours-add:focus-visible {
  color: var(--primary);
  border-color: #b7c9f0;
  background: var(--primary-soft);
  outline: none;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.14);
}
.hours-add::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%) translateY(2px);
  padding: 0.26rem 0.48rem;
  border-radius: 6px;
  background: #1b1b28;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  box-shadow: 0 6px 16px rgba(24, 28, 50, 0.18);
  z-index: 5;
}
.hours-add:hover::after,
.hours-add:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hours-actions {
  display: flex; justify-content: flex-end;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}
.hours-editor[data-mode="all"] .hours-actions { width: min(100%, 16.5rem); }
.hours-editor[data-mode="week"] .hours-actions { width: min(100%, 40.5rem); }
.hours-editor[data-mode="day"] .hours-actions { width: min(100%, 77rem); }
@media (max-width: 1100px) {
  .hours-editor[data-mode="day"] .hours-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 44rem);
  }
  .hours-editor[data-mode="day"] .hours-day { border-bottom: 1px solid var(--border); }
  .hours-editor[data-mode="day"] .hours-actions { width: min(100%, 44rem); }
}
@media (max-width: 900px) {
  .hours-editor[data-mode="week"] .hours-grid {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 16.5rem);
  }
  .hours-editor[data-mode="week"] .hours-day {
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .hours-editor[data-mode="week"] .hours-actions { width: min(100%, 16.5rem); }
  .hours-editor[data-mode="day"] .hours-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 26rem);
  }
  .hours-editor[data-mode="day"] .hours-actions { width: min(100%, 26rem); }
}
@media (max-width: 520px) {
  .hours-editor[data-mode="all"] .hours-grid,
  .hours-editor[data-mode="all"] .hours-actions,
  .hours-editor[data-mode="day"] .hours-grid,
  .hours-editor[data-mode="day"] .hours-actions {
    width: 100%;
    max-width: 16.5rem;
  }
  .hours-editor[data-mode="day"] .hours-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.list-live.is-loading { opacity: 0.55; pointer-events: none; }
.list-live.is-loading::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: list-shimmer 0.9s linear infinite;
  pointer-events: none;
}
@keyframes list-shimmer {
  from { transform: translateX(-40%); }
  to { transform: translateX(40%); }
}

/* --- Recruitment tabs + interview slot builder --- */
.recruit-tabs {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
  margin: 0 0 1rem; padding: 0 0.15rem;
  border-bottom: 1px solid var(--border);
}
.recruit-tab {
  position: relative; padding: 0.55rem 0.1rem 0.7rem;
  font-size: 0.78rem; font-weight: 750; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none; color: var(--muted);
}
.recruit-tab:hover { color: var(--text); }
.recruit-tab.is-active { color: var(--text); }
.recruit-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--ink);
}
.slot-builder {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--neutral-50) 100%);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}
.slot-builder-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.slot-role { display: inline-flex; align-items: center; gap: 0.45rem; }
.slot-role-label {
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.slot-role select {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 0.4rem 1.8rem 0.4rem 0.7rem;
  font: inherit; font-size: 0.86rem; font-weight: 650; color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.slot-builder-toggle {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: inherit; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text);
}
.slot-builder-toggle-label { line-height: 1; }
.slot-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  flex: 0 0 auto;
}
.slot-toggle-icon .icon { width: 0.85rem; height: 0.85rem; }
.slot-toggle-icon[hidden] { display: none !important; }
.slot-builder-toggle:hover .slot-toggle-icon {
  color: var(--primary);
  border-color: #b7c9f0;
  background: var(--primary-soft);
}
.slot-builder-panel.is-collapsed { display: none; }
.slot-section { margin-top: 1rem; }
.slot-section-label {
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem;
}
.slot-dates {
  display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.slot-date {
  appearance: none; flex: 0 0 auto; width: 3.35rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  padding: 0.45rem 0.2rem; cursor: pointer; text-align: center;
  color: var(--text);
}
.slot-date.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.slot-date-dow, .slot-date-mon {
  display: block; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85;
}
.slot-date-day {
  display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.2;
  margin: 0.1rem 0;
}
.slot-times {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
}
.slot-durations { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.slot-chip {
  appearance: none; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit; font-size: 0.84rem; font-weight: 650;
  padding: 0.55rem 0.35rem; text-align: center;
}
.slot-durations .slot-chip { min-width: 3rem; padding: 0.55rem 0.75rem; }
.slot-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.slot-times-empty {
  margin: 0.55rem 0 0;
  padding: 0.75rem 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--neutral-50);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}
.slot-times-empty[hidden] { display: none !important; }
.slot-times-empty-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 550;
}
.slot-times-empty.is-warning {
  border-color: #e8d39a;
  background: var(--warning-soft);
}
.slot-times-empty.is-warning .slot-times-empty-text { color: #7a5c10; }
.slot-times-empty-link { font-size: 0.82rem; font-weight: 700; }
html[data-theme="dark"] .slot-times-empty {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}
html[data-theme="dark"] .slot-times-empty.is-warning {
  background: rgba(246, 192, 0, 0.08);
  border-color: rgba(246, 192, 0, 0.28);
}
.slot-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-top: 1.15rem; padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.slot-summary { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.slot-pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  padding: 0.22rem 0.55rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase;
}
.slot-range {
  font-size: 0.86rem; font-weight: 700; color: var(--text); margin-left: 0.15rem;
}
.slot-actions { display: flex; align-items: center; gap: 0.75rem; }
.slot-clear {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.slot-submit {
  appearance: none; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--ink); color: var(--on-ink); font: inherit; font-size: 0.78rem;
  font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.75rem 1.1rem;
}
.slot-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.slot-submit-wrap {
  display: inline-flex;
  position: relative;
}
.slot-submit-wrap.is-blocked { cursor: help; }
.slot-submit-wrap.is-blocked .slot-submit { pointer-events: none; }
.copy-field {
  display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%;
}
.copy-field-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(100%, 28rem);
}
.table-qr {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  margin: 0;
  flex-wrap: nowrap;
}
.table-qr-img {
  display: block;
  width: 180px;
  height: 180px;
  border: 1px solid var(--border-soft);
  border-radius: 0;
  background: #fff;
  flex: 0 0 180px;
}
.detail-row.table-qr-row {
  display: block;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.detail-row.table-qr-row > dd {
  margin: 0;
}
.table-qr-meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.1rem;
  padding-top: 0;
}
.table-qr-label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.table-qr-meta > .copy-field {
  margin-bottom: 0.35rem;
  max-width: 100%;
}
.table-qr-link {
  word-break: break-all;
  font-size: 0.85rem;
  line-height: 1.35;
}
.table-qr-meta .field-hint {
  margin: 0 0 0.35rem;
}
.table-qr-meta .field-hint:last-child {
  margin-bottom: 0;
}
.table-qr-platform {
  margin-top: 0.15rem;
}
@media (max-width: 640px) {
  .table-qr {
    flex-wrap: wrap;
  }
  .table-qr-img {
    flex-basis: 160px;
    width: 160px;
    height: 160px;
  }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.slot-list-title {
  margin: 0 0 0.65rem; font-size: 0.95rem; font-weight: 750;
}
@media (max-width: 720px) {
  .slot-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Messages (contact inbox) --- */
.mb-0 { margin-bottom: 0; }
.data-table tr.row-link { cursor: pointer; }
.data-table tr.row-link:hover td { background: var(--bg-soft, #f7f7f9); }
.data-table tr.is-unread td { font-weight: 550; }
.msg-name-unread { font-weight: 750; color: var(--text); }
.msg-detail-title { min-width: 0; }
.msg-subject {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}
.msg-detail .detail-list { grid-template-columns: 1fr; }
.msg-body {
  white-space: pre-wrap;
  line-height: 1.55;
  font-weight: 500;
}

/* --- Icons (Lucide inline) --- */
.icon { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 36px; height: 36px; opacity: 0.55; }
.icon-nav { width: 16px; height: 16px; opacity: 0.85; }
.icon-chevron { width: 14px; height: 14px; margin-left: auto; opacity: 0.55; transition: transform 0.15s ease; }
.icon-input { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; opacity: 0.45; pointer-events: none; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: inherit; cursor: pointer;
  text-decoration: none;
}
.btn-icon:hover { background: rgba(0,0,0,0.06); color: var(--text); text-decoration: none; }
.btn-with-icon { display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-logout.btn-icon { width: 2.1rem; height: 2.1rem; }

/* Nav accordion (recruitment) */
.nav-accordion { display: flex; flex-direction: column; gap: 0.05rem; }
.nav-accordion-toggle {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  color: var(--sidebar-text); background: transparent; border: 0;
  padding: 0.55rem 0.9rem; border-radius: 9px; cursor: pointer;
  font: inherit; font-weight: 500; font-size: 0.875rem; text-align: left;
}
.nav-accordion-toggle:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-accordion-toggle.is-active-group { color: #fff; }
.nav-accordion:not(.is-open) .nav-accordion-items { display: none; }
.nav-accordion:not(.is-open) .icon-chevron { transform: rotate(-90deg); }
.nav-accordion.is-open .icon-chevron { transform: rotate(0deg); }
.nav-item-child { padding-left: 2.1rem; font-size: 0.84rem; }
.nav-label { flex: 1; }

/* Segmented control - base; polished rules later in file */

/* Reservations toolbar */
.res-header { align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.res-header-left { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; flex: 1; }
.res-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.65rem; }
.res-filter { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; }
.res-filter select, .res-date-range input[type="date"] {
  font: inherit; font-size: 0.85rem; padding: 0.4rem 0.65rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.res-filter select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2rem;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.res-date-range { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Column show/hide strip: single line between per-page and search */
.list-controls#resListControls,
.list-controls:has(#resColToggles) {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.list-controls:has(#resColToggles) .list-controls-left {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.list-controls:has(#resColToggles) .list-controls-right {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.list-controls:has(#resColToggles) .list-info {
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}
.col-toggles-wrap {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.col-toggles {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
  -ms-overflow-style: auto;
}
.col-toggles::-webkit-scrollbar { height: 3px; }
.col-toggles::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 99px; }
.col-toggles::-webkit-scrollbar-track { background: transparent; }
.col-toggles-nav {
  flex: 0 0 auto;
  opacity: 1;
  transition: opacity 0.15s ease;
}
.col-toggles-nav:disabled,
.col-toggles-nav.is-disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}
.col-toggles-nav[hidden] { display: none !important; }
.col-toggle {
  flex: 0 0 auto;
  font-size: 0.68rem; font-weight: 650; letter-spacing: 0.02em;
  padding: 0.28rem 0.5rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: #8a8b9c; cursor: pointer;
  white-space: nowrap;
}
.col-toggle.is-on {
  background: #0d6efd; border-color: #0d6efd; color: #fff;
  box-shadow: 0 1px 2px rgba(13, 110, 253, 0.28);
}
.col-toggle.is-off { opacity: 0.5; background: var(--surface-2); color: #8a8b9c; }

.search-field { position: relative; display: inline-flex; align-items: center; gap: 0.25rem; }
.search-field input[type="search"] { padding-left: 2rem; min-width: 12rem; }

.table-scroll { overflow-x: auto; }
.sticky-cols .sticky-start { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.sticky-cols .sticky-end { position: sticky; right: 0; z-index: 2; background: var(--surface); }
/* Match header band - first/last sticky th must not look “blank” vs middle columns */
.sticky-cols thead .sticky-start,
.sticky-cols thead .sticky-end,
.sticky-cols thead th.sticky-start,
.sticky-cols thead th.sticky-end {
  z-index: 4;
  background: var(--surface-3);
}
.data-table thead th {
  background: var(--surface-3);
}
.data-table thead th:first-child,
.data-table thead th:last-child {
  background: var(--surface-3);
}
.cell-note { text-align: center; }

.note-modal {
  border: 0; border-radius: 14px; padding: 0; max-width: min(28rem, 92vw);
  box-shadow: 0 18px 50px rgba(20, 24, 40, 0.22);
}
.note-modal::backdrop { background: rgba(20, 24, 40, 0.45); }
.note-modal-inner { margin: 0; }
.note-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
}
.note-modal-head h3 { margin: 0; font-size: 0.95rem; }
.note-modal-body {
  padding: 1rem 1.1rem 1.2rem; white-space: pre-wrap; line-height: 1.5;
  font-size: 0.92rem; max-height: 60vh; overflow: auto;
}

/* Compact multi-column forms / detail */
.form-grid-modern, .detail-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1.1rem;
  max-width: none;
}
.admin-form { max-width: none; }
.form-section {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title {
  font-size: 0.78rem; font-weight: 750; text-transform: uppercase;
  letter-spacing: 0.06em; color: #7a7b8f; margin-bottom: 0.65rem;
}

.select-searchable{width:100%;min-height:7.5rem;font:inherit;border:1px solid var(--border);border-radius:8px;padding:0.35rem}
.input-filter{width:100%;margin-bottom:0.35rem;font:inherit;padding:0.4rem 0.55rem;border:1px solid var(--border);border-radius:8px}
.customer-new-panel{padding:0.75rem;border:1px dashed var(--border);border-radius:10px;background:#fafbfc}

/* Reservation create/edit - two-column professional layout */
.res-form-title { flex: 1; min-width: 0; }
.res-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: 1.1rem;
  align-items: start;
  width: 100%;
}
.res-form-main { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.res-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.res-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.85rem 1.05rem; border-bottom: 1px solid var(--border-soft); background: var(--surface-3);
}
.res-card-head h3 { margin: 0; font-size: 0.92rem; font-weight: 700; }
.res-card-body { padding: 1rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; }
.seg-compact { padding: 0.12rem; }
.seg-compact .seg-btn { padding: 0.32rem 0.55rem; font-size: 0.75rem; }
.res-inline-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 0.9rem;
}
.res-inline-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.res-inline-grid .span-all { grid-column: 1 / -1; }
.res-form .form-row { margin: 0; }
.res-form .form-row label { display: block; font-size: 0.72rem; font-weight: 650; color: #6b6c84; margin-bottom: 0.28rem; }
.res-form .form-row input,
.res-form .form-row select,
.res-form .form-row textarea {
  width: 100%; font: inherit; font-size: 0.9rem;
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.res-form .form-row.has-error input,
.res-form .form-row.has-error select,
.res-form .form-row.has-error textarea { border-color: var(--danger); }
.field-error { margin: 0.28rem 0 0; font-size: 0.75rem; color: var(--danger); }
.field-warn { margin: 0.28rem 0 0; font-size: 0.75rem; color: #9a7600; }
.customer-search { position: relative; margin-bottom: 0.35rem; }
.customer-search .icon-input { position: absolute; left: 0.55rem; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: 0.55; }
.customer-search .input-filter { padding-left: 2rem; margin-bottom: 0; }
.customer-picked-card {
  display: flex; align-items: center; gap: 0.65rem;
  margin-top: 0.55rem; padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 10px; background: var(--primary-soft);
}
.customer-picked-icon {
  width: 2rem; height: 2rem; border-radius: 8px; background: var(--primary-soft);
  display: grid; place-items: center; color: var(--primary); flex-shrink: 0;
}
.customer-picked-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.customer-picked-meta strong { font-size: 0.9rem; }
.party-stepper {
  display: inline-flex; align-items: center; gap: 0.25rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0.15rem;
  width: 100%; max-width: 11rem;
}
.party-stepper input {
  border: 0 !important; text-align: center; font-weight: 700; width: 100%;
  padding: 0.35rem 0.2rem !important; -moz-appearance: textfield;
}
.party-stepper input::-webkit-outer-spin-button,
.party-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.party-btn {
  appearance: none; border: 0; background: var(--hover-bg); border-radius: 8px;
  width: 2rem; height: 2rem; display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.party-btn:hover { background: #e8f0fe; color: var(--primary); }
.status-seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.status-chip {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 0.2rem 0.35rem; cursor: pointer; opacity: 0.55;
}
.status-chip.is-active { opacity: 1; border-color: #0d6efd; box-shadow: 0 0 0 2px rgba(13,110,253,0.15); }
.status-chip .badge { margin: 0; }
.cancel-only { padding-top: 0.25rem; border-top: 1px dashed var(--border); }
.res-form-side { min-width: 0; }
.sticky-summary {
  position: sticky; top: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 1rem 1.05rem 1.15rem;
}
.sticky-summary h3 { margin: 0 0 0.75rem; font-size: 0.92rem; }
.res-summary-list { margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.res-summary-list > div { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; }
.res-summary-list dt { font-size: 0.72rem; color: var(--muted); font-weight: 650; }
.res-summary-list dd { margin: 0; font-size: 0.88rem; font-weight: 650; text-align: right; max-width: 65%; word-break: break-word; }
.res-summary-hint { font-size: 0.75rem; margin: 0.85rem 0 0; }
.res-summary-actions { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn.is-loading { opacity: 0.75; cursor: wait; }
@media (max-width: 960px) {
  .res-form-layout { grid-template-columns: 1fr; }
  .sticky-summary { position: static; }
  .res-inline-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .res-inline-grid, .res-inline-grid-3 { grid-template-columns: 1fr; }
}

/* Job application detail */
.app-detail-toolbar { align-items: flex-start; }
.app-detail-hero { flex: 1; min-width: 0; }
.app-detail-name { margin: 0; font-size: 1.25rem; font-weight: 750; }
.app-detail-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.35rem; }
.app-detail-job { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.app-detail-layout {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr);
  gap: 1.1rem; align-items: start;
}
.app-detail-main { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.detail-kv-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1rem;
}
.detail-kv-grid .span-all { grid-column: 1 / -1; }
.detail-kv { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.detail-kv-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #7a7b8f;
}
.detail-kv-value { font-size: 0.92rem; font-weight: 550; word-break: break-word; }
.detail-prose { white-space: pre-wrap; line-height: 1.5; font-weight: 450; }
.status-card .status-current { margin-bottom: 0.75rem; }
.badge-lg { font-size: 0.85rem; padding: 0.35rem 0.65rem; }
.status-update-form { display: flex; flex-direction: column; gap: 0.75rem; }
.status-update-form .form-row label { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.status-update-form select {
  width: 100%; font: inherit; padding: 0.5rem 0.6rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.interview-assign {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.interview-assign-title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.interview-assign-when {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  color: var(--ink);
}
.mt { margin-top: 1rem; }
@media (max-width: 960px) {
  .app-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .detail-kv-grid { grid-template-columns: 1fr; }
}

.wizard-steps { display:flex; flex-wrap:wrap; gap:0.35rem; margin-bottom:1rem; }
.wizard-step {
  border:1px solid var(--border); background: var(--surface); border-radius:999px;
  padding:0.35rem 0.7rem; font-size:0.75rem; font-weight:650; cursor:pointer; color:#6b6c84;
}
.wizard-step.is-active { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); color: var(--primary); }
.wizard-panel { margin-bottom:1rem; }
.wizard-panel[hidden], .i18n-pane[hidden], .btn[hidden], .wizard-nav [hidden] { display: none !important; }
.wizard-panel .has-error input,
.wizard-panel .has-error select { border-color: var(--danger); }
.wizard-nav { margin-top:1rem; gap:0.5rem; flex-wrap:wrap; justify-content: space-between; }
.wizard-nav-end { display:flex; gap:0.5rem; margin-left:auto; align-items:center; }
.menu-tabs { margin-bottom: 1rem; }
.form-section-title { font-size: 0.95rem; margin: 1.25rem 0 0.35rem; font-weight: 700; }
.check-label { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 550; }
.check-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Category picker (wizard step 1) */
.cat-picker-field { max-width: none; width: 100%; }
.cat-picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
}
.cat-picker-head label { margin: 0; }
.cat-picker {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-3); overflow: hidden;
}
.cat-picker-search {
  position: relative; display: flex; align-items: center;
  padding: 0.45rem 0.75rem 0.45rem 0.55rem; border-bottom: 1px solid var(--border); background: var(--surface);
}
.cat-picker-search .icon-input { left: 0.85rem; }
.cat-picker-search input[type="search"] {
  border: 0; padding: 0.45rem 0.35rem 0.45rem 1.85rem; background: transparent;
  box-shadow: none; width: 100%; min-width: 0; border-radius: 0;
}
.cat-picker-search input[type="search"]:focus { outline: none; box-shadow: none; }
.cat-picker-list {
  max-height: 22rem; overflow: auto; padding: 0.55rem 0.65rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}
.cat-picker-group-title {
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.4rem 0.15rem;
}
.cat-picker-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.45rem; }
.cat-picker-option {
  display: flex; align-items: flex-start; gap: 0.5rem;
  margin: 0; padding: 0.55rem 0.65rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.cat-picker-option:hover { border-color: #b6d0fe; background: #f8fbff; }
.cat-picker-option:has(input:checked),
.cat-picker-option.is-selected {
  border-color: #0d6efd; background: #eef4ff; box-shadow: 0 0 0 1px #0d6efd inset;
}
.cat-picker-option input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.cat-picker-option-mark {
  flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: 0.1rem;
  border: 1.5px solid #c5c8d6; border-radius: 999px; background: var(--surface);
}
.cat-picker-option:has(input:checked) .cat-picker-option-mark,
.cat-picker-option.is-selected .cat-picker-option-mark {
  border-color: #0d6efd; background: #0d6efd;
  box-shadow: inset 0 0 0 3px #fff;
}
.cat-picker-option-label {
  font-size: 0.86rem; font-weight: 600; line-height: 1.3; color: var(--text);
}
.cat-picker-empty { padding: 1rem 0.75rem; text-align: center; margin: 0; }
.cat-picker-field.has-error .cat-picker { border-color: var(--danger); }
@media (max-width: 560px) {
  .cat-picker-options { grid-template-columns: 1fr; }
  .cat-picker-list { max-height: 16rem; }
}

/* Image live preview (menu item new/edit) */
.image-field {
  display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: 0.75rem; align-items: start;
}
.image-field-inputs { min-width: 0; }
.image-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0,0,0,0); }
.image-preview-wrap {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  overflow: hidden; display: grid; place-items: center;
}
.image-preview {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.image-preview-ph { color: #a0a2b5; display: grid; place-items: center; }
.image-preview-ph[hidden], .image-preview[hidden], .image-dropzone-body[hidden] { display: none !important; }

/* Modern dropzone upload (wizard basics step) - balanced 3 columns */
.wizard-basics {
  display: grid;
  grid-template-columns: minmax(15rem, 1.05fr) minmax(17rem, 1.25fr) minmax(16rem, 1fr);
  gap: 1rem 0;
  align-items: stretch;
}
.wizard-basics-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  min-height: 100%;
  align-self: stretch;
}
.wizard-basics-col + .wizard-basics-col {
  padding-left: 1.35rem;
  margin-left: 1.15rem;
}
.wizard-basics-col + .wizard-basics-col::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-image: radial-gradient(circle closest-side, #b7bbca 1.15px, transparent 1.25px);
  background-size: 1px 9px;
  background-repeat: repeat-y;
  background-position: center top;
  opacity: 0.9;
  pointer-events: none;
}
.wizard-basics-pricing,
.wizard-basics-placement {
  width: 100%;
}
.wizard-basics-media {
  min-width: 0;
  align-items: stretch;
}
.wizard-basics-media > .form-row {
  margin: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.wizard-basics-media > .form-row > label {
  align-self: stretch;
  text-align: left;
}
.image-field-modern {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
}
.image-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: min(100%, 18rem);
  height: auto;
  min-height: 0;
  padding: 1.25rem 1rem;
  border: 1.5px dashed #c5c8d6;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  box-sizing: border-box;
}
.image-dropzone:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--surface-2) 100%);
}
.image-dropzone:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
  border-color: var(--primary);
}
.image-dropzone.is-dragover {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}
.image-field-modern.has-image .image-dropzone {
  min-height: 0;
  padding: 0;
  border-style: solid;
  border-color: var(--border);
  background: var(--ink);
  cursor: default;
}
.image-field-modern.has-image .image-dropzone .image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}
.image-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid #e2e5ef;
  color: var(--primary);
  margin-bottom: 0.25rem;
  box-shadow: 0 1px 2px rgba(24, 28, 50, 0.06);
}
.image-dropzone-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.image-dropzone-hint {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 16rem;
  line-height: 1.35;
}
.image-dropzone-cta {
  margin-top: 0.55rem;
  pointer-events: none;
}
.image-dropzone-clear {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(24, 28, 50, 0.12);
}
.image-dropzone-clear:hover {
  background: var(--surface);
  color: var(--danger, #c0392b);
}
.image-url-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 16rem;
  min-width: 0;
}
.image-url-row {
  display: grid;
  gap: 0.28rem;
}
.image-url-row label {
  font-size: 0.72rem !important;
  font-weight: 650 !important;
  color: #6b6c84;
  margin: 0;
}
.image-url-row input {
  width: 100%;
}
@media (max-width: 980px) {
  .wizard-basics {
    grid-template-columns: minmax(14rem, 1fr) minmax(16rem, 1.2fr);
  }
  .wizard-basics-media { grid-column: 1 / -1; }
  .wizard-basics-media.wizard-basics-col {
    padding-left: 0;
    margin-left: 0;
    padding-top: 1.15rem;
    margin-top: 0.85rem;
  }
  .wizard-basics-media.wizard-basics-col::before {
    left: 0.2rem;
    right: 0.2rem;
    top: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    background-image: radial-gradient(circle closest-side, #b7bbca 1.15px, transparent 1.25px);
    background-size: 9px 1px;
    background-repeat: repeat-x;
    background-position: left center;
  }
}
@media (max-width: 640px) {
  .wizard-basics { grid-template-columns: 1fr; }
  .wizard-basics-media { grid-column: auto; }
  .wizard-basics-col + .wizard-basics-col {
    padding-left: 0;
    margin-left: 0;
    padding-top: 1.15rem;
    margin-top: 0.85rem;
  }
  .wizard-basics-col + .wizard-basics-col::before {
    left: 0.2rem;
    right: 0.2rem;
    top: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    background-image: radial-gradient(circle closest-side, #b7bbca 1.15px, transparent 1.25px);
    background-size: 9px 1px;
    background-repeat: repeat-x;
    background-position: left center;
  }
}
@media (max-width: 560px) {
  .image-field { grid-template-columns: 1fr; }
  .image-preview-wrap { max-width: 12rem; }
}
.chip-grid { display:flex; flex-wrap:wrap; gap:0.45rem; }
.chip-check {
  display:inline-flex; align-items:center; gap:0.35rem; padding:0.4rem 0.6rem;
  border:1px solid var(--border); border-radius:999px; font-size:0.8rem; cursor:pointer; background: var(--surface);
}
.chip-check input { margin:0; }
.chip-type { font-size:0.65rem; font-weight:700; color:#0d6efd; text-transform:uppercase; }

/* Label picker (wizard step 4) */
.label-picker { max-width: none; width: 100%; }
.label-picker-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.label-picker-count { font-size: 0.78rem; font-weight: 650; white-space: nowrap; }
.label-picker-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-bottom: 0.65rem;
}
.label-picker-search {
  position: relative; flex: 1 1 11rem; min-width: 10rem; max-width: 16rem;
}
.label-picker-search input[type="search"] {
  width: 100%; min-width: 0; padding: 0.45rem 0.65rem 0.45rem 2rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit;
}
.label-picker-list {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-3);
  max-height: 24rem; overflow: auto; padding: 0.65rem 0.7rem 0.8rem;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.label-picker-group-title {
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.4rem 0.1rem;
}
.label-picker-options {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.45rem;
}
.label-picker-option {
  display: flex; align-items: flex-start; gap: 0.55rem; margin: 0;
  min-height: 3.4rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.label-picker-option:hover { border-color: #b6d0fe; background: #f8fbff; }
.label-picker-option:has(input:checked),
.label-picker-option.is-selected {
  border-color: #0d6efd; background: #eef4ff; box-shadow: 0 0 0 1px #0d6efd inset;
}
.label-picker-option input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.label-picker-check {
  flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin-top: 0.08rem;
  border: 1.5px solid #c5c8d6; border-radius: 5px; background: var(--surface);
}
.label-picker-option:has(input:checked) .label-picker-check,
.label-picker-option.is-selected .label-picker-check {
  border-color: #0d6efd; background: #0d6efd;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-size: 0.75rem; background-repeat: no-repeat; background-position: center;
}
.label-picker-option-body {
  min-width: 0; display: flex; flex-direction: column; gap: 0.12rem; flex: 1;
}
.label-picker-option-name {
  font-size: 0.84rem; font-weight: 600; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.label-picker-option-code {
  font-size: 0.7rem; color: var(--muted); font-weight: 550;
}
.label-picker-empty { text-align: center; padding: 1rem 0.5rem; margin: 0; }
@media (max-width: 560px) {
  .label-picker-options { grid-template-columns: 1fr; }
  .label-picker-toolbar { flex-direction: column; align-items: stretch; }
  .label-picker-search { max-width: none; }
}
.menu-product-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(14rem,1fr)); gap:0.75rem;
}
.menu-product-card {
  display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch;
  padding:0; border:1px solid var(--border); border-radius:12px;
  background: var(--surface); color:inherit; overflow:hidden;
}
.menu-product-card.has-side {
  grid-template-columns:minmax(0,1fr) 2.85rem;
}
.menu-product-card:hover { border-color:#b6d0fe; box-shadow:0 4px 14px rgba(13,110,253,0.08); }
.menu-product-thumb {
  grid-column:2; grid-row:1; align-self:start; justify-self:end;
  width:2.5rem; height:2.5rem; margin:0.65rem 0.35rem 0 0;
  border-radius:8px; object-fit:cover; display:block;
  border:1px solid var(--border); background:#f0f1f5; box-shadow:0 1px 2px rgba(15,23,42,0.06);
  pointer-events:none;
}
.menu-product-main {
  grid-column:1; grid-row:1; min-width:0;
  display:block; padding:0.85rem 0.85rem 0.85rem 0.95rem; text-decoration:none; color:inherit;
}
.menu-product-main:hover { text-decoration:none; }
.menu-product-edit {
  grid-column:2; grid-row:1; align-self:end; justify-self:end;
  width:1.85rem; height:1.85rem; margin:0 0.35rem 0.55rem 0;
  color:var(--muted); z-index:2;
  border:1px solid var(--border); background: var(--surface);
  box-shadow:0 1px 2px rgba(15,23,42,0.04);
}
.menu-product-edit:hover,
.menu-product-edit:focus-visible {
  color:var(--text); text-decoration:none;
  border-color:#b6d0fe; background:#f5f9ff;
}
.menu-product-edit.tooltip::after {
  bottom:auto; top:50%; left:auto; right:calc(100% + 8px);
  transform:translateY(-50%);
}
/* Menu wizard review - live-menu style preview */
.menu-preview-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.menu-preview-title {
  margin: 0 0 0.2rem; font-size: 1.05rem; font-weight: 750;
}
.menu-preview-badge {
  flex: 0 0 auto; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em;
  text-transform: uppercase; color: #7a1f2b; background: #f7ecee;
  border: 1px solid #e8c9cf; border-radius: 999px; padding: 0.28rem 0.6rem;
}
.menu-preview {
  display: grid; gap: 0.85rem;
}
.menu-preview-card {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.9rem;
  padding: 0.85rem; border: 1px solid #e4e0dc; border-radius: 14px;
  background: #fffaf6; box-shadow: 0 1px 0 rgba(90, 40, 48, 0.04);
}
.menu-preview-media {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #efeae4; border: 1px solid #e6e0da;
  display: grid; place-items: center;
}
.menu-preview-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.menu-preview-media-ph { color: #b2a89f; }
.menu-preview-body { min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.menu-preview-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
}
.menu-preview-titles { min-width: 0; }
.menu-preview-cat {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: #8a6a70; margin-bottom: 0.2rem;
}
.menu-preview-name {
  margin: 0; font-size: 1.15rem; line-height: 1.25; font-weight: 750;
  color: #5a1f28; font-family: Georgia, "Times New Roman", serif;
}
.menu-preview-name-alt {
  margin-top: 0.15rem; font-size: 0.92rem; font-weight: 700; color: #3f4254;
}
.menu-preview-price {
  flex: 0 0 auto; font-size: 1.05rem; font-weight: 800; color: #5a1f28;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.menu-preview-desc {
  margin: 0; font-size: 0.82rem; line-height: 1.4; color: #6b6c84;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.menu-preview-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.menu-preview-tag {
  font-size: 0.7rem; font-weight: 700; color: #7a4a1a;
  background: #f7f0e6; border-radius: 999px; padding: 0.18rem 0.5rem;
}
.menu-preview-tag.is-diet { color: #1f6b3a; background: #e8f6ec; }
.menu-preview-tag.is-allergen { color: #8a2f2f; background: #f8eaea; }
.menu-preview-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem;
  padding: 0.75rem 0.85rem; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-3);
}
.menu-preview-meta-row {
  display: flex; flex-direction: column; gap: 0.12rem; min-width: 0;
}
.menu-preview-meta-row span {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
}
.menu-preview-meta-row strong {
  font-size: 0.88rem; font-weight: 650; color: var(--text); word-break: break-word;
}
.menu-preview-meta-row.is-wide { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .menu-preview-card { grid-template-columns: 1fr; }
  .menu-preview-media { max-width: 12rem; }
  .menu-preview-meta { grid-template-columns: 1fr; }
}

.input-with-suffix {
  display: flex; align-items: stretch; width: 100%; max-width: 12rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden;
}
.input-with-suffix:focus-within { box-shadow: var(--focus-ring); border-color: #0d6efd; }
.input-with-suffix input {
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  flex: 1; min-width: 0; width: auto !important; max-width: none !important;
}
.input-with-suffix .input-suffix {
  display: flex; align-items: center; padding: 0 0.7rem;
  background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 0.9rem;
  border-left: 1px solid var(--border); user-select: none;
}
.menu-product-cat {
  font-size:0.7rem; text-transform:uppercase; letter-spacing:0.04em; margin-bottom:0.25rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.menu-product-name {
  font-weight:700; font-size:0.95rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.menu-product-num {
  display: inline-block; font-variant-numeric: tabular-nums; font-weight: 750;
  color: var(--muted); margin-right: 0.15rem;
}
.item-number-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.item-number-field input {
  flex: 1;
  min-width: 0;
}
.item-number-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 3.5rem;
  justify-content: flex-end;
}
.item-number-preview {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--danger, #c0392b);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.item-number-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.item-number-icon[hidden] { display: none !important; }
.item-number-icon.is-ok {
  color: #0f8a3b;
  background: #e8fff3;
  border: 1px solid #b7ebc9;
}
.item-number-icon.is-bad {
  color: #c0392b;
  background: #fdecea;
  border: 1px solid #f5c6cb;
}
.form-row.has-error[data-field="item_number"] .item-number-field input {
  border-color: var(--danger, #c0392b);
}
.menu-preview-num {
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted);
}
.menu-product-meta { display:flex; justify-content:space-between; margin-top:0.35rem; min-width:0; }
.menu-product-price {
  font-weight:750; color:#0d6efd; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.menu-product-desc { margin:0.45rem 0 0; font-size:0.8rem; color:#6b6c84; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.i18n-pane label { display:block; margin-top:0.65rem; }

/* --- FAZ 2/3: shell extras, dialog, toast, skeleton --- */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.btn:focus-visible, .btn-icon:focus-visible, .nav-item:focus-visible, a:focus-visible {
  box-shadow: var(--focus-ring);
}

.content { max-width: none; width: 100%; margin: 0; padding: var(--space-5) var(--space-6) var(--space-10); }
.topbar-titles { min-width: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: var(--text-xs); color: var(--muted); margin-bottom: 0.15rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.bc-sep { opacity: 0.5; }

.brand { position: relative; align-items: center; }
.sidebar-collapse {
  margin-left: auto; color: #c5c5d6;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
  width: 1.9rem; height: 1.9rem; border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.sidebar-collapse:hover {
  color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
}
.sidebar-collapse-ico { display: inline-flex; align-items: center; justify-content: center; }
.sidebar-collapse .is-expand { display: none; }
.app-shell.is-collapsed .sidebar-collapse .is-collapse { display: none; }
.app-shell.is-collapsed .sidebar-collapse .is-expand { display: inline-flex; }
.app-shell.is-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  overflow: visible;
}
.app-shell.is-collapsed .brand {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.25rem 0.85rem;
}
.app-shell.is-collapsed .brand-mark {
  height: 2.35rem;
}
.app-shell.is-collapsed .sidebar-collapse {
  margin-left: 0;
  width: 2rem;
  height: 2rem;
}
.app-shell.is-collapsed .brand-text,
.app-shell.is-collapsed .nav-label,
.app-shell.is-collapsed .nav-group-title,
.app-shell.is-collapsed .nav-badge,
.app-shell.is-collapsed .icon-chevron,
.app-shell.is-collapsed .sidebar-footer { display: none; }
.app-shell.is-collapsed .nav-item,
.app-shell.is-collapsed .nav-accordion-toggle { justify-content: center; padding-left: 0.55rem; padding-right: 0.55rem; }
.app-shell.is-collapsed .nav-accordion-items { display: none !important; }

.theme-toggle { position: relative; }
.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-icon-light { display: none; }
  html:not([data-theme="light"]) .theme-icon-dark { display: inline; }
}

.progress-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 40% 100%; animation: progress-slide var(--duration-slow) linear infinite;
}
.progress-bar[hidden] { display: none !important; }
@keyframes progress-slide {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

.toast-host {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 80;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: min(22rem, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.75rem 0.9rem; border-radius: var(--radius-md);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--elev-3);
  animation: toast-in var(--duration-base) var(--ease-out);
}
.toast-success { border-color: #9ad9b3; }
.toast-error { border-color: #f5a0b5; }
.toast-msg { flex: 1; font-size: var(--text-md); font-weight: 600; }
.toast-action { appearance: none; border: 0; background: transparent; color: var(--primary); font-weight: 700; cursor: pointer; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ui-dialog {
  border: 0; padding: 0; border-radius: var(--radius-lg);
  box-shadow: var(--elev-3); max-width: min(26rem, calc(100vw - 2rem));
  background: var(--card); color: var(--text);
}
.embed-share-dialog { max-width: min(36rem, calc(100vw - 2rem)); width: 100%; }
.embed-share-hint { margin: 0 0 0.85rem; font-size: var(--text-sm); }
.embed-share-copy { display: flex; align-items: flex-start; width: 100%; }
.embed-share-copy input.mono,
.embed-share-textarea {
  flex: 1; min-width: 0; width: 100%;
  font-size: 0.78rem; line-height: 1.4;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--bg-accent));
  color: var(--text);
  resize: vertical;
}
.embed-share-copy .btn-icon { flex-shrink: 0; margin-top: 0.15rem; }
.table-empty-cell {
  text-align: center; padding: 1.75rem 1rem !important;
  color: var(--muted); font-size: var(--text-md);
}
.ui-dialog::backdrop { background: rgba(16, 18, 28, 0.5); }
.ui-dialog-inner { margin: 0; }
.ui-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-soft);
}
.ui-dialog-head h3 { margin: 0; font-size: var(--text-base); font-weight: 750; }
.ui-dialog-body { padding: 1rem; font-size: var(--text-md); line-height: 1.45; }
.confirm-delete-dialog { max-width: min(28rem, calc(100vw - 2rem)); }
.confirm-delete-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.confirm-delete-lead {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}
.confirm-delete-entity {
  margin: 0;
  align-self: flex-start;
  max-width: 100%;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--hover-bg);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.confirm-delete-deps {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, #c47b00 28%, var(--border-soft));
  border-radius: 10px;
  background: color-mix(in srgb, #c47b00 8%, var(--card));
}
.confirm-delete-deps-note {
  margin: 0 0 0.55rem;
  color: #8a6500;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}
.confirm-delete-impact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}
.confirm-delete-impact li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  font-size: 0.84rem;
  line-height: 1.3;
}
.confirm-delete-impact .impact-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 550;
}
.confirm-delete-impact .impact-count {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  color: var(--text);
  letter-spacing: 0.01em;
}
.confirm-delete-type {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.confirm-delete-type label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.confirm-delete-type input {
  width: 100%;
  max-width: 12rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.04em;
}
html[data-theme="dark"] .confirm-delete-deps {
  border-color: color-mix(in srgb, #e0b84a 30%, var(--border-soft));
  background: color-mix(in srgb, #e0b84a 10%, var(--card));
}
html[data-theme="dark"] .confirm-delete-deps-note { color: #e0b84a; }
.ui-dialog-foot {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 0.85rem 1rem 1rem; border-top: 1px solid var(--border-soft);
}

.skeleton {
  background: linear-gradient(90deg, var(--border-soft), var(--bg-accent), var(--border-soft));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.1s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 0.85rem; margin: 0.45rem 0; }
.skeleton-row { height: 2.6rem; margin: 0.35rem 0; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.list-live.is-loading { position: relative; }
.list-live.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  pointer-events: none;
}
.btn.is-loading { position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin var(--duration-base) linear infinite; margin-left: 0.35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(13, 110, 253, 0.12), transparent 55%),
    radial-gradient(900px 400px at -10% 100%, rgba(23, 198, 83, 0.08), transparent 50%),
    var(--bg);
}
html[data-theme="dark"] .topbar { background: rgba(23, 26, 34, 0.88); }
html[data-theme="dark"] .data-table th { background: var(--surface-3); }
html[data-theme="dark"] .data-table tbody tr:hover td { background: var(--row-hover); }
html[data-theme="dark"] .main .btn-ghost, html[data-theme="dark"] .content .btn-ghost {
  background: var(--card); color: var(--text);
}
html[data-theme="dark"] .main .btn-ghost:hover, html[data-theme="dark"] .content .btn-ghost:hover {
  background: var(--hover-bg);
}
html[data-theme="dark"] .pager-btn, html[data-theme="dark"] .pager-num {
  background: var(--card); color: var(--text);
}
html[data-theme="dark"] .res-form .form-row input,
html[data-theme="dark"] .res-form .form-row select,
html[data-theme="dark"] .res-form .form-row textarea,
html[data-theme="dark"] .admin-form input,
html[data-theme="dark"] .admin-form select,
html[data-theme="dark"] .admin-form textarea,
html[data-theme="dark"] .filters input,
html[data-theme="dark"] .filters select,
html[data-theme="dark"] .list-controls input,
html[data-theme="dark"] .list-controls select,
html[data-theme="dark"] .res-filter select,
html[data-theme="dark"] .res-date-range input[type="date"],
html[data-theme="dark"] .slot-role select,
html[data-theme="dark"] .time-field select.input-time {
  background: var(--input-bg); color: var(--text); border-color: var(--border);
  color-scheme: dark;
}
html[data-theme="dark"] .sticky-summary,
html[data-theme="dark"] .res-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .hours-grid,
html[data-theme="dark"] .hours-day,
html[data-theme="dark"] .hours-slot,
html[data-theme="dark"] .hours-add,
html[data-theme="dark"] .hours-remove,
html[data-theme="dark"] .slot-toggle-icon,
html[data-theme="dark"] .time-chip,
html[data-theme="dark"] .slot-date,
html[data-theme="dark"] .slot-chip,
html[data-theme="dark"] .slot-pill,
html[data-theme="dark"] .cal-cell,
html[data-theme="dark"] .hub-card,
html[data-theme="dark"] .seg-control,
html[data-theme="dark"] .seg-indicator {
  background: var(--surface);
  color: var(--text);
}
html[data-theme="dark"] .hours-modes {
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
  box-shadow: none;
}
html[data-theme="dark"] .hours-mode {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--muted);
}
html[data-theme="dark"] .hours-mode:hover,
html[data-theme="dark"] .hours-mode.is-active {
  background: var(--surface);
  color: var(--text);
}
html[data-theme="dark"] .hours-mode-icon {
  background: var(--surface-2);
  border-color: var(--border);
}
html[data-theme="dark"] .slot-builder {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: none;
}
html[data-theme="dark"] .slot-date.is-active,
html[data-theme="dark"] .slot-chip.is-active,
html[data-theme="dark"] .slot-submit,
html[data-theme="dark"] .recruit-tab.is-active::after {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .cal-cell.is-muted { background: var(--surface-2); }
html[data-theme="dark"] .cal-head-cell { background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .cal-event.is-pending { color: #e0b84a; }
html[data-theme="dark"] .cal-event.is-cancelled { color: #ff8eab; }
html[data-theme="dark"] .badge-dark,
html[data-theme="dark"] .badge-muted { background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .badge-success { color: #5dde8f; }
html[data-theme="dark"] .badge-warning { color: #e0b84a; }
html[data-theme="dark"] .badge-danger { color: #ff8eab; }
html[data-theme="dark"] .badge-info { color: #6ec1f0; }
html[data-theme="dark"] .alert-danger { color: #ff8eab; border-color: rgba(248, 40, 90, 0.28); }
html[data-theme="dark"] .alert-info { color: #6ec1f0; border-color: rgba(4, 132, 214, 0.28); }
html[data-theme="dark"] .alert-success { color: #5dde8f; border-color: rgba(23, 198, 83, 0.28); }
html[data-theme="dark"] .text-success { color: #5dde8f; }
html[data-theme="dark"] .text-warning { color: #e0b84a; }
html[data-theme="dark"] .text-danger { color: #ff8eab; }
html[data-theme="dark"] .detail-value.mono,
html[data-theme="dark"] .detail-row dd.mono { color: var(--muted); }
html[data-theme="dark"] .field-tip,
html[data-theme="dark"] .password-toggle:hover,
html[data-theme="dark"] .col-toggle.is-off { background: var(--surface-2); }
html[data-theme="dark"] .sticky-cols .sticky-start,
html[data-theme="dark"] .sticky-cols .sticky-end { background: var(--card); }
html[data-theme="dark"] .sticky-cols thead .sticky-start,
html[data-theme="dark"] .sticky-cols thead .sticky-end,
html[data-theme="dark"] .data-table thead th,
html[data-theme="dark"] .data-table thead th:first-child,
html[data-theme="dark"] .data-table thead th:last-child {
  background: var(--surface-3);
}
html[data-theme="dark"] .lang-btn:hover { background: var(--hover-bg); }
html[data-theme="dark"] .lang-btn.active { background: var(--surface-2); }
html[data-theme="dark"] .auth-lang .lang-switch { background: var(--surface); }
html[data-theme="dark"] .menu-preview-shell,
html[data-theme="dark"] .menu-preview-card,
html[data-theme="dark"] .cat-picker,
html[data-theme="dark"] .label-picker,
html[data-theme="dark"] .wizard-step,
html[data-theme="dark"] .product-card {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .cat-picker-option:hover,
html[data-theme="dark"] .label-picker-option:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
html[data-theme="dark"] .btn-logout,
html[data-theme="dark"] .btn-logout.btn-icon {
  border-color: rgba(248, 40, 90, 0.35);
  background: var(--danger-soft);
  color: #ff8eab;
}
html[data-theme="dark"] .switch-track { background: #3a4154; }
html[data-theme="dark"] .time-chip:hover { background: var(--hover-bg); border-color: var(--border); }
html[data-theme="dark"] .slot-times-empty.is-warning {
  background: var(--warning-soft);
  border-color: rgba(246, 192, 0, 0.28);
}
html[data-theme="dark"] .slot-times-empty.is-warning .slot-times-empty-text { color: #e0b84a; }
html[data-theme="dark"] .stat-card-icon { border-color: var(--border); }
html[data-theme="dark"] .admin-form .field-tip { background: var(--surface-2); }
html[data-theme="dark"] .wizard-step { color: var(--muted); }
html[data-theme="dark"] .wizard-step.is-active { color: #8eb6ff; }
html[data-theme="dark"] .menu-preview-card { background: var(--surface-2); box-shadow: none; }
html[data-theme="dark"] .menu-preview-badge { background: var(--danger-soft); color: #ff8eab; }
html[data-theme="dark"] .menu-preview-tag { background: var(--surface-3); color: var(--muted); }
html[data-theme="dark"] .menu-preview-tag.is-diet { background: var(--success-soft); color: #5dde8f; }
html[data-theme="dark"] .menu-preview-tag.is-allergen { background: var(--danger-soft); color: #ff8eab; }
html[data-theme="dark"] .menu-product-card:hover { box-shadow: 0 4px 14px rgba(13,110,253,0.16); }
html[data-theme="dark"] .cat-picker-option:hover,
html[data-theme="dark"] .label-picker-option:hover { background: var(--primary-soft); }
html[data-theme="dark"] .image-dropzone {
  border-color: var(--border);
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
}
html[data-theme="dark"] .res-form .form-row label { color: var(--muted); }
html[data-theme="dark"] .btn-logout:hover,
html[data-theme="dark"] .btn-logout.btn-icon:hover {
  color: #fff; background: #c0392b; border-color: #c0392b;
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: var(--space-4); flex-wrap: wrap;
}
.page-header > div:first-child {
  display: flex; flex-direction: column; gap: 0.25rem; min-width: 0;
}
.page-header h2 {
  margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3;
}
.page-header .muted {
  margin: 0; font-size: 0.84rem; line-height: 1.35; font-weight: 500;
}
.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
}
.empty-state h3 { margin: 0.5rem 0 0.25rem; color: var(--text); }
.empty-icon { margin-bottom: 0.35rem; }

.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--neutral-800); color: #fff; font-size: var(--text-xs); font-weight: 600;
  padding: 0.3rem 0.5rem; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-out);
}
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; }

.seg-control {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.15rem;
  padding: 0.2rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-accent);
}
.seg-indicator {
  position: absolute; top: 0.2rem; bottom: 0.2rem; left: 0;
  border-radius: 8px; background: var(--card); box-shadow: var(--elev-1);
  transition: transform var(--duration-base) var(--ease-out), width var(--duration-base) var(--ease-out);
  pointer-events: none; z-index: 0;
}
.seg-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.7rem; border-radius: 8px; border: 0; background: transparent;
  font-size: var(--text-sm); font-weight: 650; color: var(--muted);
  text-decoration: none; cursor: pointer;
}
.seg-btn:hover { color: var(--text); text-decoration: none; }
.seg-btn.is-active {
  background: transparent; color: var(--text); box-shadow: none;
}
.seg-control:not(:has(.seg-indicator)) .seg-btn.is-active {
  background: var(--card); box-shadow: var(--elev-1);
}

@media (max-width: 900px) {
  .app-shell.is-collapsed .sidebar { width: var(--sidebar-w); }
  .sidebar-collapse { display: none; }
}

.menu-group-title {
  margin: 1.25rem 0 0.55rem; font-size: var(--text-sm); font-weight: 750;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.menu-group-title:first-child { margin-top: 0.25rem; }
.form-compact .form-grid { gap: 0.65rem; }
.form-compact .form-row label { font-size: var(--text-xs); }
.form-compact .card-body { padding-top: 0.85rem; }

.repeater-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.repeater-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.repeater-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.repeater-actions {
  margin-top: 0.45rem;
}

.form-layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: var(--space-6);
  align-items: start;
}
.form-layout-main { min-width: 0; }
.form-layout-side { min-width: 0; }
@media (max-width: 900px) {
  .form-layout-2col { grid-template-columns: 1fr; }
  .form-layout-side .sticky-summary { position: static; }
}

/* --- Motion + polish (FAZ 5/12 completion) --- */
.page-enter {
  animation: page-enter var(--duration-base) var(--ease-out);
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.data-table tbody tr {
  animation: row-in var(--duration-base) var(--ease-out) both;
}
.data-table tbody tr:nth-child(1) { animation-delay: 0ms; }
.data-table tbody tr:nth-child(2) { animation-delay: 20ms; }
.data-table tbody tr:nth-child(3) { animation-delay: 40ms; }
.data-table tbody tr:nth-child(4) { animation-delay: 60ms; }
.data-table tbody tr:nth-child(5) { animation-delay: 80ms; }
.data-table tbody tr:nth-child(6) { animation-delay: 100ms; }
.data-table tbody tr:nth-child(7) { animation-delay: 120ms; }
.data-table tbody tr:nth-child(8) { animation-delay: 140ms; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.data-table tbody tr.is-removing {
  animation: row-out var(--duration-base) var(--ease-out) forwards;
}
@keyframes row-out {
  to { opacity: 0; transform: scale(0.97); height: 0; padding: 0; }
}

.ui-dialog[open] {
  animation: dialog-in var(--duration-base) var(--ease-out);
}
.ui-dialog[open]::backdrop {
  animation: backdrop-in var(--duration-base) var(--ease-out);
}
@keyframes dialog-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.toast {
  position: relative;
  overflow: hidden;
  animation: toast-slide-in var(--duration-base) var(--ease-out);
}
.toast-timer {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: rgba(13, 110, 253, 0.35);
  transform-origin: left center;
  animation: toast-timer-shrink 4.5s linear forwards;
}
.toast-error .toast-timer { background: rgba(248, 40, 90, 0.45); }
.toast-success .toast-timer { background: rgba(23, 198, 83, 0.45); }
@keyframes toast-timer-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}
.toast.is-leaving {
  animation: toast-slide-out var(--duration-fast) var(--ease-out) forwards;
}
@keyframes toast-slide-out {
  to { opacity: 0; transform: translateX(12px); }
}

.field-error, .form-error, .alert-danger.is-field {
  animation: field-shake var(--duration-slow) var(--ease-out);
}
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.wizard-pane {
  animation: wizard-fade var(--duration-base) var(--ease-out);
}
@keyframes wizard-fade {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

.seg-btn {
  transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.btn, .btn-icon, .card {
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.btn:active:not(:disabled), .btn-icon:active:not(:disabled) {
  transform: scale(0.98);
}
.col-toggle, .col-toggles-nav {
  transition: opacity var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.nav-accordion-items {
  transition: max-height var(--duration-slow) var(--ease-out), opacity var(--duration-base) var(--ease-out);
}
.icon-chevron {
  transition: transform var(--duration-base) var(--ease-out);
}
.nav-accordion.is-open .icon-chevron { transform: rotate(180deg); }

.slot-builder-panel {
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.slot-builder-panel.is-collapsed {
  display: none;
}

.empty-state { animation: page-enter var(--duration-base) var(--ease-out); }
.stat-card { animation: page-enter var(--duration-base) var(--ease-out); }

img.fade-in { animation: page-enter var(--duration-slow) var(--ease-out); }
.img-preview-box { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-md); background: var(--bg-accent); }
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; }

/* System mail SMTP options */
.smtp-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.smtp-option {
  display: flex; align-items: flex-start; gap: 0.7rem;
  margin: 0; padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, var(--surface-3));
  cursor: pointer;
  font-weight: 400; /* override .admin-form label */
}
.smtp-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
/* .admin-form input { width:100% } would stretch checkboxes into huge bars */
.smtp-option > input[type="checkbox"] {
  width: 1.05rem !important;
  height: 1.05rem !important;
  max-width: 1.05rem !important;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--primary);
}
.smtp-option-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; flex: 1 1 auto; }
.smtp-option-title { font-size: 0.88rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.smtp-option-hint { font-size: 0.76rem; font-weight: 500; color: var(--muted); line-height: 1.4; }
.smtp-port-hint:not([hidden]) { margin: -0.25rem 0 0.85rem; }
.admin-form .password-field input {
  width: 100%;
  padding-right: 2.75rem;
}
@media (max-width: 720px) {
  .smtp-option-grid { grid-template-columns: 1fr; }
}
.smtp-test-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.05rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2, var(--surface-3));
}
.smtp-test-head h3 {
  margin: 0;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.92rem; font-weight: 700;
}
.smtp-test-head .muted {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}
.smtp-test-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.65rem;
  margin-top: 0.75rem;
}
.smtp-test-row .btn { flex: 0 0 auto; }

/* Design form - tabs + section cards + media tiles */
.design-form { display: flex; flex-direction: column; gap: 1rem; }
.design-form-main { display: flex; flex-direction: column; gap: 1rem; }
.design-tabs {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0.25rem;
  padding: 0.3rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
  position: sticky; top: 0; z-index: 4;
  scrollbar-width: thin;
}
.design-tab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.82rem; font-weight: 650;
  color: var(--muted); white-space: nowrap;
}
.design-tab:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.design-tab.is-active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.08);
}
.design-tab .icon-sm { opacity: 0.85; }
.design-tab-panel { display: flex; flex-direction: column; gap: 1rem; }
.design-tab-panel[hidden] { display: none !important; }
.design-form.is-media-tab [data-design-save-bar] { display: none; }
html[data-theme="dark"] .design-tab.is-active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
@media (max-width: 640px) {
  .design-tab span { display: none; }
  .design-tab { padding: 0.55rem 0.7rem; }
}

/* Logo nudge (parity with Platform appearance settings) */
.design-logo-nudges {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(15.5rem, 0.85fr);
  gap: 1.15rem 1.35rem;
  align-items: start;
  margin-top: 0.85rem;
}
.design-logo-nudges > .field-hint { grid-column: 1 / -1; margin: 0; }
.design-logo-nudge { min-width: 0; }
@media (max-width: 900px) {
  .design-logo-nudges { grid-template-columns: 1fr; }
}
.design-logo-nudge-head {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.design-logo-nudge-title {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 700;
}
.design-nudge-reset {
  margin-left: auto;
  border: 0; background: transparent;
  color: var(--text-muted, #7a7b8f);
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer;
}
.design-nudge-reset:hover { color: var(--primary, #de2910); }
.design-logo-stage {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: visible;
  border-radius: 8px;
}
.design-logo-stage-cream {
  position: relative; z-index: 1;
  display: flex; height: 70px;
  align-items: flex-start; justify-content: center;
  overflow: visible;
  border-radius: 8px 8px 0 0;
}
.design-logo-stage-mark {
  display: flex; position: relative; z-index: 5;
  flex-direction: column; align-items: center;
  margin-bottom: -65px;
}
.design-logo-preview {
  height: 100px; width: auto; max-width: 14rem;
  object-fit: contain;
  cursor: grab; touch-action: none; user-select: none;
  transform: translate(var(--header-logo-x, 0px), var(--header-logo-y, 0px));
}
.design-logo-preview:active { cursor: grabbing; }
.design-logo-preview-ph {
  height: 100px; width: 7rem;
  display: grid; place-items: center;
  color: #a0a2b5;
  opacity: 0.7;
  transform: translate(var(--header-logo-x, 0px), var(--header-logo-y, 0px));
}
.design-logo-stage-text {
  display: flex; height: 65px;
  flex-direction: column; align-items: center; justify-content: center;
  margin-top: -30px; padding: 0 1rem;
  color: #faf4dd; pointer-events: none; text-align: center;
}
.design-logo-stage-text span {
  font-size: 1.35rem; font-weight: 700; line-height: 1;
  white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis;
}
.design-logo-stage-text small {
  margin-top: 0.15rem;
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.28em; line-height: 1;
  text-transform: uppercase;
  opacity: 0.9;
}
.design-logo-stage-text small[hidden] { display: none !important; }
.design-logo-stage-red {
  height: 65px;
  border-radius: 0 0 8px 8px;
}
.design-logo-nudge.is-mobile .design-logo-stage { max-width: none; }
.design-logo-nudge.is-mobile .design-logo-stage-cream { height: 56px; }
.design-logo-nudge.is-mobile .design-logo-preview,
.design-logo-nudge.is-mobile .design-logo-preview-ph { height: 58px; }
.design-logo-nudge.is-mobile .design-logo-stage-mark { margin-bottom: -40px; }
.design-logo-nudge.is-mobile .design-logo-stage-text {
  height: 40px; margin-top: -16px; padding: 0 0.625rem;
}
.design-logo-nudge.is-mobile .design-logo-stage-text span { font-size: 1.05rem; }
.design-logo-nudge.is-mobile .design-logo-stage-text small {
  margin-top: 0.1rem; font-size: 0.5rem; letter-spacing: 0.35em;
}
.design-logo-nudge.is-mobile .design-logo-stage-red { height: 40px; }
.design-device {
  background: #1d2030;
  box-shadow: 0 10px 24px rgba(18, 22, 38, 0.18);
}
.design-device.is-desktop {
  border-radius: 12px 12px 6px 6px;
  padding: 0.45rem 0.45rem 0;
}
.design-device-chrome {
  display: flex; align-items: center; gap: 0.28rem;
  height: 1.05rem; padding: 0 0.35rem 0.2rem;
}
.design-device-chrome span {
  width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: #5c6174;
}
.design-device-chrome span:nth-child(1) { background: #ff6b6b; }
.design-device-chrome span:nth-child(2) { background: #f5c542; }
.design-device-chrome span:nth-child(3) { background: #3ddc84; }
.design-device-screen {
  overflow: hidden;
  background: #0f1118;
}
.design-device.is-desktop .design-device-screen { border-radius: 4px; }
.design-device.is-desktop .design-logo-stage {
  border: 0; border-radius: 0;
}
.design-device-stand {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 0.35rem;
}
.design-device-stand i {
  display: block; width: 3.2rem; height: 0.55rem;
  background: #2a2e40;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}
.design-device-stand::after {
  content: "";
  display: block;
  width: 7.5rem; height: 0.38rem;
  border-radius: 999px;
  background: #2a2e40;
}
.design-device.is-phone {
  width: 13.5rem;
  margin: 0 auto;
  border-radius: 1.55rem;
  padding: 0.55rem 0.42rem 0.7rem;
  box-shadow: inset 0 0 0 2px #3a3f54, 0 10px 24px rgba(18, 22, 38, 0.18);
}
.design-device-notch {
  width: 4.4rem; height: 0.42rem;
  margin: 0 auto 0.4rem;
  border-radius: 999px;
  background: #0b0d14;
}
.design-device.is-phone .design-device-screen {
  border-radius: 0.55rem;
}
.design-device.is-phone .design-logo-stage {
  border: 0; border-radius: 0;
}
.design-device-home {
  width: 2.4rem; height: 0.28rem;
  margin: 0.45rem auto 0;
  border-radius: 999px;
  background: #4a4f63;
}
html[data-theme="dark"] .design-device { background: #141722; }
html[data-theme="dark"] .design-device-stand i,
html[data-theme="dark"] .design-device-stand::after { background: #2c3144; }
.design-nudge {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 4.2rem;
  gap: 0.55rem; align-items: center;
  margin-top: 0.55rem;
  font-size: 0.72rem; color: var(--text-muted, #7a7b8f);
}
.design-nudge input[type="range"] { width: 100%; accent-color: var(--primary, #de2910); }
.design-nudge input[type="number"] {
  width: 100%; font: inherit; padding: 0.3rem 0.4rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface);
}
.design-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.design-section-head {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.85rem 1rem 0.15rem;
}
.design-section-ico {
  flex: 0 0 auto;
  width: 2rem; height: 2rem;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-muted, #7a7b8f);
}
.design-section-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.design-section-head .muted {
  margin-top: 0.15rem;
  font-size: 0.82rem;
}
.design-section-head > .btn { margin-left: auto; flex-shrink: 0; }
.design-label-with-info {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.design-info { position: relative; display: inline-flex; }
.design-info-btn {
  width: 1.25rem; height: 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted, #7a7b8f);
  font-size: 0.72rem; font-weight: 800; line-height: 1;
  cursor: pointer; padding: 0;
}
.design-info-btn.is-on,
.design-info-btn[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}
.design-info-pop {
  position: absolute; z-index: 8;
  left: 0; top: calc(100% + 0.35rem);
  width: min(22rem, 70vw);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem; font-weight: 500; line-height: 1.4;
}
.design-place-check {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted, #7a7b8f);
  line-height: 1.4;
}
.admin-form textarea#uber_eats_images,
.admin-form textarea#lieferando_images {
  min-height: 5.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}
.design-delivery {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.design-delivery-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.design-delivery-divider {
  height: 1px;
  margin: 1.15rem 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border) 12%,
    var(--border) 88%,
    transparent 100%
  );
}
.design-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.design-delivery-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.design-delivery-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface-3));
  color: var(--text);
  flex-shrink: 0;
}
.design-delivery-brand h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.2;
}
.design-delivery-head .switch { margin: 0; }
.design-delivery-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: opacity 0.18s ease;
}
.design-delivery-block:not(:has(.design-delivery-head input[type="checkbox"]:checked)) .design-delivery-fields {
  opacity: 0.48;
}
.design-delivery-url input {
  width: 100%;
  max-width: none;
}
.design-delivery-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.design-delivery-meta .form-row { margin: 0; }
.design-delivery-meta input {
  width: 100%;
  max-width: none;
}
@media (max-width: 720px) {
  .design-delivery-meta { grid-template-columns: 1fr; }
}
.design-section-body {
  padding: 0.65rem 1rem 1rem;
}
.design-about-layout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}
.design-about-langs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  width: max-content;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  position: sticky;
  top: 4.35rem;
}
.design-about-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.38rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.design-about-lang:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.design-about-lang.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.08);
}
.design-about-panels { min-width: 0; }
.design-about-panel { display: flex; flex-direction: column; gap: 0.85rem; }
.design-about-panel[hidden] { display: none !important; }
[data-about-locales].has-rte [data-about-body] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.design-about-panel .rte-editor { min-height: 16rem; }
html[data-theme="dark"] .design-about-lang.is-active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
@media (max-width: 720px) {
  .design-about-layout { grid-template-columns: 1fr; }
  .design-about-langs {
    width: max-content;
    position: static;
  }
}
.design-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.75rem, 1fr));
  gap: 0.7rem 0.75rem;
}
.design-color-swatch {
  display: flex; flex-direction: column; gap: 0.3rem; min-width: 0;
}
.design-color-swatch > label {
  font-weight: 700; font-size: 0.84rem;
}
.design-color-controls {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
}
.design-color-swatch input[type="color"] {
  width: 2.7rem;
  min-width: 2.7rem;
  max-width: 2.7rem;
  height: 2.35rem;
  padding: 0.12rem;
  border-radius: 8px;
  cursor: pointer;
}
.admin-form .design-color-hex {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.design-brand-rows { display: flex; flex-direction: column; gap: 0.85rem; }
.design-brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: end;
}
.design-brand-row .form-row { margin-bottom: 0; }
.design-field-with-switch {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.design-field-with-switch > input { flex: 1; min-width: 0; }
.design-field-with-switch .switch { margin: 0; flex-shrink: 0; }
@media (max-width: 720px) {
  .design-brand-row { grid-template-columns: 1fr; }
}
.design-check-row {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1.1rem;
  align-items: center;
  padding: 0.35rem 0 0.15rem;
}
.design-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.85rem;
}
.design-media-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2, var(--surface-3));
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
}
.design-media-tile-label {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 650;
}
.design-media-preview {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #a0a2b5;
}
.design-media-preview img,
.design-media-preview video {
  width: 100%; height: 100%; object-fit: contain;
  background: #f6f6f8;
}
.design-media-preview.is-poster img { object-fit: cover; }
.design-media-preview.is-favicon {
  aspect-ratio: 1;
  max-width: 4.5rem;
  margin-inline: auto;
}
.design-media-actions {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.design-media-pick {
  position: relative;
  cursor: pointer;
  justify-content: center;
  width: 100%;
}
.design-media-pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.design-gallery-empty {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted, #7a7b8f);
  background: var(--surface-2, transparent);
}
.design-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 0.75rem 0 0.15rem;
  margin-top: 0.25rem;
  background: linear-gradient(180deg, transparent, var(--bg, #fff) 28%);
}
html[data-theme="dark"] .design-media-preview img,
html[data-theme="dark"] .design-media-preview video {
  background: #1c1d22;
}
html[data-theme="dark"] .design-sticky-actions {
  background: linear-gradient(180deg, transparent, var(--bg, #121317) 28%);
}
@media (max-width: 720px) {
  .design-media-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .design-media-grid { grid-template-columns: 1fr; }
}

body.is-upload-locked,
body.is-page-busy { overflow: hidden; }
.page-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, #10121c 55%, transparent);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.page-busy-overlay[hidden] { display: none !important; }
.page-busy-card {
  width: min(20rem, 100%);
  padding: 1.25rem 1.2rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 18, 28, 0.28);
  text-align: center;
}
.page-busy-spinner {
  width: 1.85rem;
  height: 1.85rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  border: 2.5px solid var(--border-soft);
  border-top-color: var(--primary, #de2910);
  animation: page-busy-spin 0.7s linear infinite;
}
.page-busy-msg {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--text);
}
@keyframes page-busy-spin {
  to { transform: rotate(360deg); }
}
.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: color-mix(in srgb, #10121c 62%, transparent);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.upload-overlay[hidden] { display: none !important; }
.upload-overlay-card {
  width: min(22.5rem, 100%);
  padding: 1.55rem 1.4rem 1.3rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(16, 18, 28, 0.32);
  text-align: center;
  outline: none;
}
.upload-overlay-meter {
  --p: 0;
  width: 5.75rem;
  height: 5.75rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary, #de2910) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid;
  place-items: center;
}
.upload-overlay-meter > span {
  width: 4.35rem;
  height: 4.35rem;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.upload-overlay-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}
.upload-overlay-file {
  margin: 0.4rem 0 0.95rem;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}
.upload-overlay-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.upload-overlay-track > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--primary, #de2910);
  transition: width 0.16s ease-out;
}
.upload-overlay.is-indeterminate .upload-overlay-track > span {
  width: 38%;
  animation: upload-indeterminate 1.05s ease-in-out infinite;
}
.upload-overlay-card .muted {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
}
.upload-overlay.is-error .upload-overlay-meter {
  background: conic-gradient(#b42318 calc(var(--p) * 1%), var(--surface-3) 0);
}
.upload-overlay.is-error .upload-overlay-track > span {
  background: #b42318;
}
.upload-overlay.is-error .upload-overlay-card h3 {
  color: #b42318;
}
.upload-overlay.is-error .upload-overlay-card .muted {
  color: #7a1c16;
  font-weight: 600;
}
@keyframes upload-indeterminate {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}
html[data-theme="dark"] .upload-overlay {
  background: color-mix(in srgb, #05060a 72%, transparent);
}
html[data-theme="dark"] .upload-overlay-card {
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.rte {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  overflow: hidden;
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--hover-bg);
}
.rte-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.rte-btn:hover { background: var(--card); border-color: var(--border); }
.rte-sep {
  width: 1px;
  height: 1.15rem;
  background: var(--border);
  margin: 0 0.2rem;
}
.rte-u { text-decoration: underline; }
.rte-editor {
  min-height: 14rem;
  padding: 0.8rem 0.9rem;
  outline: none;
  line-height: 1.55;
}
.rte-editor:empty:before {
  content: attr(data-placeholder);
  color: #a0a4b8;
}
.rte-editor p { margin: 0 0 0.65rem; }
.rte-editor ul, .rte-editor ol { margin: 0 0 0.65rem; padding-left: 1.25rem; }
html[data-theme="dark"] .rte-editor:empty:before { color: #6b7085; }

/* Company → nested branches expand */
.org-count-cell { white-space: nowrap; }
.org-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 2.4rem;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
}
.org-expand-count {
  font-size: 0.85rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.org-expand-ico {
  display: inline-flex;
  transition: transform 0.15s ease;
}
.org-expand-btn.is-open .org-expand-ico { transform: rotate(180deg); }
.org-branch-row > td {
  padding: 0 !important;
  background: color-mix(in srgb, var(--surface) 88%, var(--primary-soft));
  border-bottom: 1px solid var(--border);
}
.org-branch-panel { padding: 0.55rem 0.75rem 0.85rem 1.5rem; }
.data-table-nested {
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.data-table-nested th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .skeleton { animation: none !important; }
  .org-expand-ico { transition: none; }
}

/* --- Mobile shell (must stay last so it wins over earlier .content/.topbar rules) --- */
body.nav-open { overflow: hidden; touch-action: none; }

@media (max-width: 980px) {
  html, body { overflow-x: clip; max-width: 100%; }
  .app-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    width: min(var(--sidebar-w), calc(100vw - 3rem));
    max-width: 20rem;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 40;
    box-shadow: 8px 0 28px rgba(15, 16, 28, 0.28);
    padding-top: max(1.1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    z-index: 35;
  }
  .sidebar-backdrop.show { display: block; }
  .menu-toggle,
  .menu-toggle.btn-icon { display: inline-flex !important; }
  .sidebar.open ~ .main .menu-toggle,
  .sidebar.open ~ .main .menu-toggle.btn-icon { display: none !important; }
  .sidebar-collapse { display: none !important; }
  .app-shell.is-collapsed .sidebar { width: min(var(--sidebar-w), calc(100vw - 3rem)); }

  .main { width: 100%; min-width: 0; }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left right"
      "context context";
    align-items: center;
    gap: 0.55rem 0.65rem;
    padding: 0.7rem 0.85rem;
    padding-top: max(0.7rem, env(safe-area-inset-top));
  }
  .topbar-left {
    grid-area: left;
    order: initial;
    flex: initial;
    gap: 0.55rem;
    min-width: 0;
  }
  .topbar-right {
    grid-area: right;
    order: initial;
    margin-left: 0 !important;
    gap: 0.3rem;
  }
  .topbar-context {
    grid-area: context;
    order: initial;
    margin-left: 0;
    max-width: none;
    width: 100%;
    padding-right: 0;
    border-right: 0;
  }
  .topbar:not(:has(.topbar-context)) {
    grid-template-areas: "left right";
  }

  .page-title {
    font-size: 1.02rem;
    line-height: 1.25;
  }
  .breadcrumbs {
    display: none;
  }
  .topbar-account-text { display: none; }
  .topbar-account { gap: 0; }
  .topbar-brand { display: inline-flex; }
  .restaurant-switch.topbar-context {
    width: 100%;
  }
  .restaurant-switch.topbar-context label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0,0,0,0);
  }
  .restaurant-switch.topbar-context select {
    width: 100%;
    min-height: 2.35rem;
    padding-right: 2.25rem;
    background-position: right 0.75rem center;
  }
  .topbar-restaurant.topbar-context {
    max-width: none;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: 0.8rem;
  }

  .content {
    padding: 0.85rem 0.85rem 1.75rem !important;
    padding-bottom: max(1.75rem, env(safe-area-inset-bottom)) !important;
  }

  .card-header.between,
  .detail-panel-head.between,
  .res-header {
    align-items: stretch;
  }
  .card-header.between .actions-row,
  .detail-panel-actions,
  .block-header-actions {
    width: 100%;
  }
  .detail-panel-actions {
    margin-left: 0;
    justify-content: flex-start;
  }
  .actions-row { gap: 0.45rem; }
  .btn-with-icon span { max-width: 100%; }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
  .list-controls {
    align-items: stretch;
  }
  .list-controls-left,
  .list-controls-right {
    width: 100%;
  }
  .list-controls input[type="search"] {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }
  .list-controls-right {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
  }
  .list-controls-right .btn { flex: 0 0 auto; }
  .table-wrap,
  .table-scroll {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    -webkit-overflow-scrolling: touch;
  }
  .data-table th,
  .data-table td {
    padding: 0.55rem 0.55rem;
  }
  .filters {
    flex-wrap: wrap;
    width: 100%;
  }
  .filters input[type="search"],
  .filters select {
    width: 100%;
    min-width: 0;
  }
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .ui-dialog {
    width: calc(100vw - 1.25rem);
    max-width: calc(100vw - 1.25rem);
    margin: auto;
  }
  .ui-dialog-foot {
    flex-wrap: wrap;
  }
  .ui-dialog-foot .btn { flex: 1 1 auto; justify-content: center; }
  .form-layout-2col { grid-template-columns: 1fr; }
  .embed-share-copy {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 0.98rem; }
  .card-body,
  .card-header { padding-left: 0.9rem; padding-right: 0.9rem; }
  .detail-panel-head,
  .detail-row { padding-left: 0.85rem; padding-right: 0.85rem; }
  .btn.btn-with-icon { padding-left: 0.7rem; padding-right: 0.7rem; }
  .seg-control {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-right .theme-toggle { width: 2.25rem; height: 2.25rem; }
  .btn-logout.btn-icon { width: 2.25rem; height: 2.25rem; }
}

/* Guest table-menu settings (Wi-Fi / waiter / bill) */
.guest-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 42rem;
}
.guest-settings-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.guest-settings-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.guest-settings-copy h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 650;
}
.guest-settings-copy .muted {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}
.guest-wifi-fields {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.guest-wifi-fields[hidden] { display: none !important; }
.guest-wifi-fields .form-row { margin: 0; }

.guest-requests-controls {
  margin-bottom: 0.85rem;
}
.guest-sse-hint {
  font-size: 0.8rem;
  font-weight: 600;
}
.guest-sse-hint.is-live { color: var(--primary); }
.guest-sse-hint.is-off { color: var(--muted); }
.guest-requests-table .inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.guest-requests-table .btn-sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
}
.empty-state.compact {
  padding: 1.5rem 1rem;
}
