:root {
  color-scheme: light;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --bg: #eef1f6;
  --bg-accent: radial-gradient(1200px 600px at 10% -10%, #d9e6ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e7f7ef 0%, transparent 50%),
    var(--bg);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-hover: #0b5f59;
  --primary-soft: rgba(15, 118, 110, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --success: #16a34a;
  --warning: #d97706;
  --info: #0284c7;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-accent: radial-gradient(1000px 500px at 0% 0%, #123047 0%, transparent 55%),
    radial-gradient(800px 400px at 100% 10%, #12261f 0%, transparent 45%),
    var(--bg);
  --surface: #121a2b;
  --surface-2: #182235;
  --text: #e8eef8;
  --muted: #94a3b8;
  --border: #243044;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --primary-hover: #14b8a6;
  --primary-soft: rgba(45, 212, 191, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --success: #4ade80;
  --warning: #fbbf24;
  --info: #38bdf8;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.28);
  --focus: 0 0 0 3px rgba(45, 212, 191, 0.28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-accent);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
[data-theme='dark'] .btn--primary { color: #06221f; }
.btn--primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: .4rem .7rem; font-size: .85rem; border-radius: 10px; }
.btn--block { width: 100%; }

.icon-btn, .ghost-btn, .link-btn {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; font-size: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover, .ghost-btn:hover, .link-btn:hover:not(:disabled) {
  color: var(--text); background: var(--surface-2);
}
.link-btn { color: var(--primary); padding: .35rem 0; }
.link-btn:disabled { opacity: .55; cursor: wait; }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .95rem; }
.field > span { font-size: .86rem; font-weight: 700; color: var(--muted); }
.field em { color: var(--danger); font-style: normal; margin-inline-start: .2rem; }
.field input, .field select, .field textarea, .search-form input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .78rem .9rem;
  outline: none;
}
.field textarea { min-height: 5rem; resize: vertical; }
.field input.field-related-name {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: default;
}
.field input:focus, .field select:focus, .field textarea:focus, .search-form input:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
  background: var(--surface);
}
.row-customer-picker {
  position: relative;
}
.row-customer-trigger-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.row-customer-display {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .78rem 2.1rem .78rem .9rem;
  outline: none;
  cursor: pointer;
}
.row-customer-picker.is-open .row-customer-display,
.row-customer-display:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
  background: var(--surface);
}
.row-customer-chevron {
  position: absolute;
  inset-inline-end: .85rem;
  pointer-events: none;
  color: var(--muted);
}
.row-customer-panel {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 30;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.row-customer-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface-2);
}
.row-customer-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: start;
  padding: .62rem .85rem;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.35;
}
.row-customer-option:hover,
.row-customer-option:focus {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  outline: none;
}
.row-customer-option.is-selected {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  font-weight: 700;
}
.row-customer-empty {
  padding: .75rem .85rem;
  color: var(--muted);
  font-size: .86rem;
}
.row-customer-load-more {
  appearance: none;
  display: block;
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  padding: .65rem .85rem;
  font-weight: 700;
  font-size: .86rem;
  cursor: pointer;
  text-align: center;
}
.row-customer-load-more:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.input-with-action { position: relative; }
.input-with-action input { width: 100%; padding-inline-end: 4.2rem; }
.input-with-action .ghost-btn {
  position: absolute; inset-inline-end: .35rem; top: 50%; transform: translateY(-50%);
  padding: .35rem .55rem; border-radius: 8px;
}
.check-row {
  display: inline-flex; align-items: center; gap: .55rem;
  margin: .2rem 0 1.1rem; font-weight: 600; color: var(--muted); cursor: pointer;
}
.alert {
  border-radius: var(--radius-sm);
  padding: .8rem .9rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: .92rem;
}
.alert--error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
}
.muted { color: var(--muted); }
.mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .86rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
}
.theme-fab {
  position: fixed;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  z-index: 5;
}
.lang-fab {
  position: fixed;
  top: 1rem;
  inset-inline-start: 1rem;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  z-index: 5;
  font-weight: 700;
}
.auth-stack {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.auth-card {
  width: 100%;
  padding: 1.6rem 1.35rem 1.25rem;
  box-shadow: var(--shadow);
}
.login-footer {
  text-align: center;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.auth-brand { text-align: center; margin-bottom: 1.35rem; }
.auth-mark {
  width: 56px; height: 56px; margin: 0 auto .9rem; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.auth-mark svg { width: 28px; height: 28px; }
.auth-mark--sm { width: 40px; height: 40px; margin: 0; border-radius: 12px; }
.auth-mark--sm svg { width: 20px; height: 20px; }
.auth-brand h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }
.auth-brand p { margin: .45rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.otp-input { text-align: center; letter-spacing: .28em; font-weight: 700; }
.auth-footnote { margin: 1.1rem 0 0; text-align: center; color: var(--muted); font-size: .78rem; }

.app-body {
  height: 100vh;
  overflow: hidden;
}

.app-fullscreen {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-accent);
}
.app-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem; position: sticky; top: .65rem; z-index: 20;
  backdrop-filter: blur(10px);
}
.topbar--full {
  position: sticky;
  top: 0;
  z-index: 20;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: .7rem 1.1rem;
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.topbar--full .topbar__brand { justify-self: start; }
.topbar--full .topbar__actions { justify-self: end; }
.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .2rem .75rem .2rem .2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  justify-self: center;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  flex: none;
}
[data-theme='dark'] .user-avatar { color: #06221f; }
.user-chip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.user-chip__text strong {
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.user-chip__text .muted {
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.topbar__brand { display: flex; align-items: center; gap: .75rem; }
.topbar__brand strong { display: block; font-size: 1.05rem; }
.topbar__brand .muted { font-size: .8rem; }
.topbar__actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.live-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .65rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: .78rem; font-weight: 700; color: var(--muted);
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.live-pill.is-on {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.live-pill.is-on i {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent);
}

.toolbar { padding: 1rem; }
.toolbar--full {
  flex: none;
  padding: .75rem 1.1rem .85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  margin-bottom: .75rem;
}
.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  padding-inline-start: .4rem;
  border-inline-start: 2px solid var(--border);
}
.tab-group__label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-inline-end: .15rem;
}
.tab-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .4rem .8rem;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.tab-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme='dark'] .tab-chip.is-active { color: #06221f; }

.nav-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.nav-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.nav-add-entry { margin-inline-start: auto; }

.picker-panel { margin-bottom: .5rem; }
.group-picker {
  padding: 0 1.1rem 1.1rem;
  margin-bottom: 0;
  background: var(--bg);
}
.folder-strip-wrap {
  position: relative;
  margin: 0 0 .75rem;
}
.folder-strip-wrap::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 2.2rem;
  pointer-events: none;
  background: linear-gradient(to left, var(--surface), transparent);
}
[dir='rtl'] .folder-strip-wrap::after {
  background: linear-gradient(to right, var(--surface), transparent);
}
.folder-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: .4rem;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .1rem .2rem .4rem;
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x;
}
.folder-strip.is-dragging {
  cursor: grabbing;
}
.folder-strip.is-dragging .folder-chip {
  pointer-events: none;
}
.folder-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: .38rem .7rem;
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  white-space: nowrap;
  max-width: none;
}
.folder-chip > span:first-child {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-chip:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.folder-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme='dark'] .folder-chip.is-active { color: #06221f; }
.folder-chip__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  font-size: .7rem;
  font-weight: 800;
}
.folder-chip.is-active .folder-chip__count {
  background: color-mix(in srgb, #fff 28%, transparent);
}
.customer-browse__search { margin-bottom: .75rem; }
.picker-card--customer {
  min-height: 4.5rem;
}
.picker-card--customer strong {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .65rem;
}
.picker-grid--entries { margin-top: .35rem; }
.picker-section-title {
  margin: 1rem 0 .45rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.picker-hint { margin: .5rem 0; font-size: .9rem; }
.picker-card {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  text-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.picker-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.picker-card strong { font-size: .95rem; }
.picker-card .muted { font-size: .78rem; }
.picker-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}

.customer-profile {
  margin: 0;
  padding: .9rem 1.1rem 1.1rem;
  background: var(--bg);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.detail-hero,
.detail-card,
.customer-profile__aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
[data-theme='dark'] .detail-hero,
[data-theme='dark'] .detail-card,
[data-theme='dark'] .customer-profile__aside-card {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.detail-hero {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 1.15rem 1.2rem;
}
.customer-profile__avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex: none;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}
[data-theme='dark'] .customer-profile__avatar { color: #06221f; }
.customer-profile__identity { flex: 1; min-width: 180px; }
.customer-profile__identity h2 {
  margin: 0 0 .4rem;
  font-size: 1.28rem;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.customer-profile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.customer-status-inline select {
  min-width: 180px;
  height: 34px;
  padding: .35rem .65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}
.customer-status-inline select:disabled {
  opacity: .7;
  cursor: wait;
}
.detail-hero__company {
  color: var(--muted);
  font-weight: 700;
  font-size: .88rem;
}
.customer-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-inline-start: auto;
}
.customer-profile__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .9rem;
}
.customer-profile__main {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-width: 0;
}
.detail-card {
  padding: 1rem 1.1rem 1.15rem;
}
.detail-card h3,
.customer-profile__aside-card h3 {
  margin: 0 0 .85rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.aside-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.aside-card__head h3 { margin-bottom: 0; }
.aside-card__edit {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 800;
}
.aside-card__editor {
  margin-top: .65rem;
  display: grid;
  gap: .5rem;
}
.aside-card__editor select,
.aside-card__editor input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: .48rem .6rem;
}
.aside-card__editor-actions {
  display: flex;
  gap: .35rem;
}
.detail-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.detail-contact:last-child { margin-bottom: 0; }
.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .9rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
  font-size: .9rem;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
}
.detail-chip:hover { filter: brightness(0.97); }
.detail-chip--wa {
  background: color-mix(in srgb, #16a34a 14%, var(--surface));
  color: #15803d;
  border-color: color-mix(in srgb, #16a34a 28%, var(--border));
}
[data-theme='dark'] .detail-chip--wa { color: #4ade80; }
.detail-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .7rem;
}
.detail-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .75rem .85rem;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.detail-tile span {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-tile strong {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.detail-tile a {
  font-weight: 800;
  word-break: break-all;
}
.detail-subtitle {
  grid-column: 1 / -1;
  margin: .15rem 0 0;
  font-size: .82rem;
  font-weight: 800;
  color: var(--muted);
}
.detail-tile--action {
  min-height: auto;
  justify-content: center;
}
.detail-auto-btn {
  width: 100%;
  border: 0;
  color: #fff;
  font-weight: 800;
}
.detail-group__row + .detail-group__row {
  margin-top: .7rem;
  padding-top: .7rem;
  border-top: 1px dashed var(--border);
}
.customer-edit-dynamic {
  display: grid;
  gap: .75rem;
}
.customer-edit-dynamic__title {
  margin: .15rem 0 0;
  padding-top: .35rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 800;
  color: var(--muted);
}
.customer-edit-dynamic__group {
  margin-top: .25rem;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.customer-edit-dynamic__group h4 {
  margin: 0 0 .55rem;
  font-size: .86rem;
}
.customer-profile__status { margin: 0; }
.customer-profile__aside {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.customer-profile__aside-card {
  padding: .9rem 1rem;
}
.customer-profile__aside-card h3 { margin-bottom: .65rem; }
.customer-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.customer-avatars span,
.customer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0 .55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
}
.customer-chip {
  gap: .35rem;
  padding-inline-end: .35rem;
}
.customer-chip--action {
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  padding: .15rem .55rem;
}
.customer-chip--action small {
  margin-inline-start: .3rem;
  color: var(--muted);
  font-size: .7rem;
}
.customer-chip__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .15rem;
}
.customer-chip__remove:hover { color: var(--danger); }
.customer-avatars span {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary-strong);
}
.customer-profile__run {
  width: 100%;
  justify-content: center;
}
@media (min-width: 960px) {
  .customer-profile__body {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }
}

.modal-backdrop--field {
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.modal-backdrop--field .modal {
  width: min(640px, 100%);
  max-height: min(90vh, 720px);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.field-modal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  overflow: hidden;
}
[data-theme='dark'] .field-modal {
  background: #151d2e;
  border-color: #2a364c;
  color: #e8eef8;
}
.field-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem .75rem;
}
.field-modal__header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.field-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
}
.field-modal__close:hover { background: rgba(15, 23, 42, 0.06); }
[data-theme='dark'] .field-modal__close:hover { background: rgba(255,255,255,.06); }
.field-modal__body {
  padding: 0 1.35rem 1.35rem;
}
.field-modal__details {
  margin-top: 1rem;
}
.field-modal__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
.field-modal .settings-field > span {
  color: #64748b;
}
[data-theme='dark'] .field-modal .settings-field > span {
  color: #7eb8d8;
}
.field-modal .settings-select,
.field-modal .settings-field input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}
[data-theme='dark'] .field-modal .settings-select,
[data-theme='dark'] .field-modal .settings-field input {
  background: #0f172a;
  border-color: #334155;
  color: #e8eef8;
}

.modal-backdrop--settings {
  place-items: center;
  padding: 1.25rem;
  background: rgba(6, 10, 20, 0.78);
  backdrop-filter: blur(6px);
}
.modal-backdrop--settings .modal {
  width: min(960px, 100%);
  max-height: min(92vh, 880px);
  border-radius: 18px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
body.modal-open { overflow: hidden; }

.settings-modal {
  background: #151d2e;
  border: 1px solid #2a364c;
  color: #e8eef8;
  overflow: hidden;
}
[data-theme='light'] .settings-modal {
  background: #ffffff;
  border-color: #dbe3ef;
  color: #0f172a;
}
.settings-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem .85rem;
}
.settings-modal__header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.settings-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
}
.settings-modal__close:hover { background: rgba(255,255,255,.06); }
[data-theme='light'] .settings-modal__close:hover { background: #f1f5f9; }
.settings-modal__body {
  padding: 0 1.5rem 1.35rem;
  overflow: auto;
  max-height: calc(92vh - 4.75rem);
}
.settings-section { margin-bottom: .35rem; }
.settings-section--fields { margin-top: .15rem; }
.settings-divider {
  border: none;
  border-top: 1px solid #2a364c;
  margin: 1.1rem 0;
}
[data-theme='light'] .settings-divider { border-top-color: #e2e8f0; }
.settings-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1.35rem;
  padding-top: 0;
  border-top: none;
}
.settings-grid {
  display: grid;
  gap: 1rem 1.1rem;
}
.settings-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 34px;
  align-items: end;
  gap: .85rem 1rem;
  margin-bottom: .85rem;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
}
.settings-field--full { margin-top: 0; }
.settings-field > span {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7eb8d8;
}
[data-theme='light'] .settings-field > span {
  color: #4b7f9c;
}
.settings-field input,
.settings-select {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f1524;
  color: inherit;
  padding: .68rem .8rem;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
[data-theme='light'] .settings-field input,
[data-theme='light'] .settings-select {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.settings-field input:focus,
.settings-select:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.settings-select--dropdown {
  appearance: auto;
  cursor: pointer;
  min-height: 2.65rem;
}
.settings-select--list {
  min-height: 9.5rem;
  padding: .35rem;
}
.tag-input {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
}
.tag-input--list {
  gap: .55rem;
}
.tag-input__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 0;
  padding: .45rem .55rem;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f1524;
}
.tag-input__tags:not(:empty) {
  min-height: 2.65rem;
  align-items: center;
}
[data-theme='light'] .tag-input__tags {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.tag-input__select {
  width: 100%;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  padding: .28rem .45rem .28rem .6rem;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
}
[data-theme='light'] .tag-chip {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.tag-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-chip__remove {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .1rem;
}
.tag-chip__remove:hover { color: #f87171; }

.combo-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.combo-picker__control {
  position: relative;
  display: flex;
  align-items: center;
}
.combo-picker__input {
  width: 100%;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0f1524;
  color: inherit;
  padding: .68rem 2.1rem .68rem .8rem;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
[data-theme='light'] .combo-picker__input {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.combo-picker__input:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.combo-picker__input:disabled {
  opacity: .65;
  cursor: wait;
}
.combo-picker__chevron {
  position: absolute;
  inset-inline-end: .75rem;
  pointer-events: none;
  color: #94a3b8;
  font-size: .9rem;
}
.combo-picker__menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #151d2e;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}
[data-theme='light'] .combo-picker__menu {
  background: #ffffff;
  border-color: #cbd5e1;
}
.combo-picker__option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: start;
  padding: .58rem .8rem;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.35;
}
.combo-picker__option:hover,
.combo-picker__option:focus {
  background: rgba(45, 212, 191, 0.12);
  outline: none;
}
.combo-picker__option.is-selected {
  background: rgba(45, 212, 191, 0.18);
  font-weight: 700;
}
.combo-picker__empty {
  padding: .75rem .8rem;
  color: #94a3b8;
  font-size: .86rem;
}
.combo-picker.is-open .combo-picker__input {
  border-color: #2dd4bf;
}
.combo-picker > .btn {
  align-self: flex-start;
}
.settings-select--list option {
  padding: .45rem .55rem;
  border-radius: 6px;
}
.settings-custom-field-rows { margin-top: .15rem; }
.settings-custom-field-row {
  position: relative;
  padding-right: 2.5rem;
  margin-bottom: 1rem;
}
.settings-custom-field-details {
  margin-top: .75rem;
}
.settings-field-actions {
  display: flex;
  justify-content: flex-end;
  margin: .15rem 0 .35rem;
}
.settings-add-field-btn {
  appearance: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #2490ef;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(36, 144, 239, 0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.settings-add-field-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(36, 144, 239, 0.42);
}
.custom-field-remove {
  position: absolute;
  top: 1.65rem;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.1rem;
}
.custom-field-remove:hover {
  background: rgba(255,255,255,.08);
}
[data-theme='light'] .custom-field-remove:hover { background: #f1f5f9; }
.settings-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin: .25rem 0 .5rem;
}
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem;
  user-select: none;
}
.toggle-row > span:first-child { color: inherit; }
.toggle-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-ui {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #3a2a30;
  border: 1px solid #5c3d45;
  transition: background .2s ease, border-color .2s ease;
  flex: none;
  order: 2;
}
.toggle-ui::after {
  content: '✕';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #ef4444;
  font-size: .65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
  transition: transform .2s ease, color .2s ease;
}
.toggle-row input:checked + .toggle-ui {
  background: #163528;
  border-color: #1f6b4f;
}
.toggle-row input:checked + .toggle-ui::after {
  content: '✓';
  color: #22c55e;
  transform: translateX(20px);
}
[dir='rtl'] .toggle-row input:checked + .toggle-ui::after {
  transform: translateX(-20px);
}
.settings-btn-cancel {
  min-width: 6.5rem;
  border-color: #334155;
  color: inherit;
}
[data-theme='light'] .settings-btn-cancel { border-color: #cbd5e1; }
.btn--save {
  min-width: 7.5rem;
  padding: .72rem 1.35rem;
  background: #2dd4bf;
  border-color: #2dd4bf;
  color: #06221f;
  font-weight: 800;
}
.btn--save:hover:not(:disabled) {
  background: #14b8a6;
  border-color: #14b8a6;
}
.settings-modal .alert--error {
  margin-bottom: .85rem;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.toolbar__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.field--inline { margin: 0; min-width: min(240px, 100%); }
.search-form { display: flex; flex: 1; gap: .5rem; min-width: min(280px, 100%); align-items: center; }
.toolbar__hint { margin: .75rem 0 0; font-size: .86rem; }

.field-picker {
  position: relative;
  flex: none;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.field-picker__trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 44px;
  padding: 0 .85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  white-space: nowrap;
}
.field-picker__trigger svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.field-picker__trigger:hover,
.field-picker.is-open .field-picker__trigger {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.field-picker.is-open .field-picker__trigger svg { color: var(--primary); }
.field-picker__panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 2rem));
  max-height: min(420px, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.field-picker__panel.hidden { display: none !important; }
.field-picker__search {
  position: relative;
  padding: .7rem .75rem .45rem;
  flex: none;
}
.field-picker__search svg {
  position: absolute;
  top: calc(.7rem + 17px);
  inset-inline-start: 1.2rem;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.field-picker__search input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: .55rem .75rem .55rem 2.1rem;
  outline: none;
  font-size: .86rem;
}
[dir='rtl'] .field-picker__search input { padding: .55rem 2.1rem .55rem .75rem; }
.field-picker__search input:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
  background: var(--surface);
}
.field-picker__list {
  overflow: auto;
  padding: .15rem 0 .45rem;
  max-height: 340px;
}
.field-picker__empty {
  padding: .85rem 1rem;
  color: var(--muted);
  font-size: .84rem;
}
.field-picker__item {
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  padding: .42rem .75rem;
  cursor: grab;
}
.field-picker__item:hover { background: var(--surface-2); }
.field-picker__item.is-dragging {
  opacity: .55;
  background: var(--primary-soft);
}
.field-picker__item.is-drag-over {
  box-shadow: inset 0 2px 0 var(--primary);
}
.field-picker__handle {
  color: var(--muted);
  font-size: 1.05rem;
  letter-spacing: -.12em;
  line-height: 1;
  user-select: none;
}
.field-picker__switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
}
.field-picker__switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.field-picker__knob {
  display: block;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
  cursor: pointer;
}
.field-picker__knob::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .18s ease;
}
.field-picker__switch input:checked + .field-picker__knob {
  background: #22c55e;
}
.field-picker__switch input:checked + .field-picker__knob::after {
  transform: translateX(16px);
}
[dir='rtl'] .field-picker__switch input:checked + .field-picker__knob::after {
  transform: translateX(-16px);
}
.field-picker__name {
  min-width: 0;
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.th-sort__icon {
  font-size: .65rem;
  opacity: .35;
}
.th-sort.is-sorted .th-sort__icon { opacity: 1; color: var(--primary); }
.customer-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.customer-link:hover { text-decoration: underline; }

.list-panel { padding: 1rem; }
.list-panel__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem;
}
.list-panel__meta h2 { margin: 0; font-size: 1.1rem; }
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}
.entry-card { padding: .95rem; transition: transform .18s ease, box-shadow .18s ease; }
.entry-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.entry-card__head {
  display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .75rem;
}
.entry-card__head > div:first-child { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.entry-card__actions { display: flex; gap: .35rem; flex-shrink: 0; }
.entry-fields { display: grid; gap: .55rem; margin: 0; }
.entry-fields > div { display: grid; gap: .15rem; }
.entry-fields dt {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700;
}
.entry-fields dd { margin: 0; font-weight: 600; word-break: break-word; }
.pager {
  display: flex; justify-content: flex-end; gap: .5rem;
  margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border);
}

.table-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  position: relative;
}
.table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
  -webkit-overflow-scrolling: touch;
}
.table-scroll.hidden { display: none !important; }
.empty-state {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  gap: .35rem;
}
.empty-state.hidden { display: none !important; }
.empty-state h3 { margin: 0; }
.empty-state p { margin: 0 0 .75rem; color: var(--muted); max-width: 28rem; }
.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table td.col-customer-name {
  font-weight: 700;
}
.data-table tbody tr.customer-row { cursor: pointer; }
.data-table th,
.data-table td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: middle;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  font-size: .78rem;
  letter-spacing: .01em;
  color: var(--muted);
  font-weight: 800;
}
.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.data-table tbody tr.pulse-effect td {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}
.data-table th.col-check,
.data-table td.col-check {
  position: sticky;
  inset-inline-start: 0;
  z-index: 3;
  background: var(--surface);
  padding: 0 0 0 .2rem !important;
  text-align: center;
  vertical-align: middle;
}
.data-table th.col-check {
  z-index: 5;
  background: var(--surface-2);
}
.col-actions {
  position: sticky;
  inset-inline-end: 0;
  z-index: 3;
  background: var(--surface);
  box-shadow: -8px 0 12px rgba(15, 23, 42, .04);
  white-space: nowrap;
  padding-inline: .9rem !important;
}
[dir='rtl'] .col-actions { box-shadow: 8px 0 12px rgba(15, 23, 42, .04); }
.data-table th.col-actions {
  z-index: 5;
  background: var(--surface-2);
}
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.row-action-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: .28rem .6rem;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.row-action-btn:hover,
.row-action-btn:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  outline: none;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
}
.row-action-btn--danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-2));
}
.col-actions .btn { margin-inline-end: .3rem; }
.col-customer { font-weight: 700; color: var(--muted); }
.select-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0 auto;
}
.select-cell input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.custom-check {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  position: relative;
  box-shadow: none;
}
.select-cell input:checked + .custom-check {
  background: var(--primary);
  border-color: var(--primary);
}
.select-cell input:checked + .custom-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.select-cell input:focus,
.select-cell input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.bulk-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.bulk-bar.hidden { display: none !important; }
.bulk-bar__run {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.toolbar .bulk-bar__run svg,
.bulk-bar__run svg {
  width: 18px;
  height: 18px;
}
.bulk-bar__meta {
  font-size: .84rem;
  font-weight: 700;
  color: var(--muted);
}
.automation-label {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem !important;
}
.btn--reset {
  background: #94a3b8;
  color: #fff;
  border-color: #94a3b8;
}
.btn--reset:hover:not(:disabled) {
  background: #64748b;
  border-color: #64748b;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  color: #fff;
  background: var(--chip, #64748b);
}
.pager-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.pager-bar__meta { font-size: .86rem; font-weight: 700; color: var(--muted); }
.pager-bar__pages { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.page-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  cursor: pointer;
}
.page-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme='dark'] .page-btn.is-active { color: #06221f; }
.page-btn:disabled { opacity: .45; cursor: default; }
.page-ellipsis { color: var(--muted); padding: 0 .2rem; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 22, .48);
  display: grid; place-items: end center; z-index: 40;
}
.modal {
  width: min(520px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: var(--shadow);
}
.modal--sm { width: min(420px, 100%); }
.modal__header {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 1rem 1rem .4rem; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal__header h2 { margin: 0; font-size: 1.15rem; }
.modal__header p { margin: .25rem 0 0; color: var(--muted); font-size: .86rem; }
.modal__body { padding: .6rem 1rem 1rem; }
.modal__footer { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .5rem; }

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70% { box-shadow: 0 0 0 12px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.pulse-effect {
  animation: pulse-green 1.4s ease-out 1;
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}

.toast-stack {
  position: fixed; right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column; gap: .55rem;
  z-index: 60; width: min(340px, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .85rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  animation: toast-in .28s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast__body { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.toast__body strong { font-size: .9rem; }
.toast__body span { font-size: .8rem; color: var(--muted); }
.toast__close { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.toast--success { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.toast--warning { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.toast--info { border-color: color-mix(in srgb, var(--info) 40%, var(--border)); }

.boot-screen {
  min-height: 100vh; display: grid; place-content: center; gap: .75rem;
  text-align: center; color: var(--muted);
}
.boot-spinner {
  width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 768px) {
  .modal-backdrop { place-items: center; padding: 1.5rem; }
  .modal { border-radius: var(--radius); }
}
@media (max-width: 720px) {
  .app-body { height: 100vh; overflow: hidden; }
  .app-fullscreen { height: 100vh; }
  .app-main { overflow: auto; }
  .topbar { flex-direction: column; align-items: stretch; position: static; }
  .topbar--full { position: static; display: flex; }
  .topbar__actions { justify-content: flex-start; }
  .user-chip { margin: 0; }
  .toolbar__row { flex-direction: column; align-items: stretch; }
  .field-picker { width: 100%; }
  .field-picker__trigger { width: 100%; justify-content: flex-start; }
  .field-picker__panel { width: 100%; }
  .search-form { flex-wrap: wrap; }
  .entry-card__head { flex-direction: column; }
  .entry-card__actions { width: 100%; }
  .entry-card__actions .btn { flex: 1; }
  .table-scroll { max-height: none; }
  .pager-bar { flex-direction: column; align-items: stretch; }
  .settings-grid--3,
  .settings-grid--2,
  .settings-grid--4 { grid-template-columns: 1fr; }
  .settings-custom-field-row { padding-right: 0; }
  .custom-field-remove { position: static; justify-self: end; margin-top: .35rem; }
  .nav-bar { flex-wrap: wrap; }
  .nav-add-entry { width: 100%; }
  .modal-backdrop--settings { padding: .75rem; }
  .settings-modal__body { padding-inline: 1rem; }
  .settings-toggles { flex-direction: column; gap: .85rem; }
}
