/* =====================================================================
   PeerPush Contacts — Design System
   Light-first, with an opt-in dark theme. Navy + electric-blue accent,
   Inter for UI, JetBrains Mono for data. Tokens drive everything.
   ===================================================================== */

:root {
  /* Brand / accent */
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);

  /* Semantic surfaces (light) */
  --bg: #eef2f7;
  --bg-accent: radial-gradient(1200px 600px at 100% -10%, #dbe6fb 0%, rgba(219, 230, 251, 0) 60%),
    radial-gradient(900px 500px at -10% 0%, #e6edf9 0%, rgba(230, 237, 249, 0) 55%), #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e5eaf0;
  --border-strong: #d4dbe4;

  /* Text */
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Status */
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --slate-soft: #eef2f6;

  /* Shape & motion */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px -6px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.28);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 180ms;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-soft: #1e3a63;
  --accent-grad: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);

  --bg: #0b1120;
  --bg-accent: radial-gradient(1200px 600px at 100% -10%, #16233f 0%, rgba(22, 35, 63, 0) 60%),
    radial-gradient(900px 500px at -10% 0%, #131c33 0%, rgba(19, 28, 51, 0) 55%), #0b1120;
  --surface: #111a2e;
  --surface-2: #0e1728;
  --surface-hover: #17233c;
  --border: #22304c;
  --border-strong: #2c3d5e;

  --text: #e9eef7;
  --text-muted: #93a2ba;
  --text-subtle: #64748b;

  --green: #4ade80;
  --green-soft: #0f2e1e;
  --red: #f87171;
  --red-soft: #3a1618;
  --amber: #fbbf24;
  --amber-soft: #3a2c0c;
  --slate-soft: #1a2740;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 60px -18px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-accent);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ===================== Layout ===================== */
.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===================== App bar ===================== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 4px;
  margin-bottom: 20px;
}

.appbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  margin: 0 -24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.6);
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand__subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn i {
  font-size: 1.05em;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn--sm {
  height: 36px;
  padding: 0 13px;
  font-size: 0.82rem;
}

.btn--primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.7);
}
.btn--primary:hover {
  box-shadow: 0 10px 22px -6px rgba(37, 99, 235, 0.75);
  filter: brightness(1.04);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--outline:hover {
  background: var(--surface-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: var(--shadow-sm);
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn--ghost.is-loading::after,
.btn--outline.is-loading::after {
  color: var(--accent);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn--sm {
  width: 30px;
  height: 30px;
  font-size: 1rem;
  border-radius: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===================== Panel / table ===================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel__toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 1.1rem;
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.search input::placeholder {
  color: var(--text-subtle);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--ring);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  padding-left: 2px;
}

.select-wrap {
  position: relative;
}
.select-wrap i {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  font-size: 0.95rem;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  padding: 0 34px 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  min-width: 130px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.select-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.count-pill {
  margin-left: auto;
  align-self: flex-end;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Date range filter */
.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-range input[type="date"] {
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  color-scheme: light;
}
[data-theme="dark"] .date-range input[type="date"] {
  color-scheme: dark;
}
.date-range input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.date-range input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}
.date-range input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.date-range__sep {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* Pagination footer */
.panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-size label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.page-size .select-wrap select {
  height: 36px;
  min-width: 78px;
  font-size: 0.84rem;
}
.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.page-range {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pager__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-indicator {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  text-align: center;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  white-space: nowrap;
}
.data-table th.col-num,
.data-table td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--dur) var(--ease);
}
.data-table tbody tr:hover {
  background: var(--surface-hover);
}
.data-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.col-select {
  width: 44px;
}

/* Startup cell */
.startup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.startup__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  text-transform: uppercase;
}
.startup__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.startup__name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.startup__tagline {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Links */
.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  max-width: 200px;
}
.link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link:hover {
  text-decoration: underline;
}
.link i {
  font-size: 0.9em;
  opacity: 0.7;
}

.muted-dash {
  color: var(--text-subtle);
}

/* Email cell */
.email-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
}
.email-cell code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
tr:hover .copy-btn {
  opacity: 1;
}
.copy-btn:hover {
  background: var(--surface);
  color: var(--accent);
}
.copy-btn.is-copied {
  opacity: 1;
  color: var(--green);
}

/* Social */
.social {
  display: inline-flex;
  gap: 6px;
}
.social a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--valid {
  background: var(--green-soft);
  color: var(--green);
}
.badge--invalid {
  background: var(--red-soft);
  color: var(--red);
}
.badge--pending {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge--none {
  background: var(--slate-soft);
  color: var(--text-subtle);
}

/* Checkbox */
.checkbox {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox__box {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: #fff;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.checkbox__box i {
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.checkbox input:checked + .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:checked + .checkbox__box i {
  opacity: 1;
  transform: scale(1);
}
.checkbox input:indeterminate + .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:indeterminate + .checkbox__box::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}
.checkbox input:focus-visible + .checkbox__box {
  box-shadow: var(--ring);
}

/* States: empty / loading / error */
.state-cell {
  padding: 0 !important;
  border-bottom: none !important;
}
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}
.state__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1.7rem;
  color: var(--text-subtle);
}
.state__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.state__hint {
  font-size: 0.82rem;
  max-width: 360px;
}
.state--error .state__icon {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}

/* Skeleton rows */
.skel {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border) 37%, var(--surface-hover) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skel--avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.skel--pill {
  height: 22px;
  width: 68px;
  border-radius: 999px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ===================== Bulk action bar ===================== */
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 12px 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: bar-in 0.25s var(--ease);
}
.bulk-bar[hidden] {
  display: none;
}
@keyframes bar-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.bulk-bar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.bulk-bar__info strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bulk-bar__actions {
  display: flex;
  gap: 8px;
}

/* ===================== Modal ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.2s var(--ease);
}
.modal-overlay[hidden] {
  display: none;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.25s var(--ease);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.modal__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
}
.modal h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal p {
  margin: 0 0 22px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Form-style modal (settings) */
.modal--form {
  max-width: 500px;
  text-align: left;
  position: relative;
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}
.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.modal--form .modal__icon {
  margin: 0;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
}
.modal--form h2 {
  margin: 0;
}
.modal__sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.settings-status {
  display: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
}
.settings-status.is-visible {
  display: block;
}
.settings-status.is-ok {
  background: var(--green-soft);
  color: var(--green);
}
.settings-status.is-warn {
  background: var(--amber-soft);
  color: var(--amber);
}
.settings-status.is-error {
  background: var(--red-soft);
  color: var(--red);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: flex;
  gap: 14px;
}
.form-row .form-field {
  flex: 1;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.form-opt {
  font-weight: 400;
  color: var(--text-subtle);
}
.form-field input {
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.form-field input::placeholder {
  color: var(--text-subtle);
}
.form-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--ring);
}
.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.modal--form .modal-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
  }
}

/* ===================== Toasts ===================== */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.28s var(--ease);
}
.toast.is-leaving {
  animation: toast-out 0.22s var(--ease) forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}
.toast--success {
  border-left-color: var(--green);
}
.toast--error {
  border-left-color: var(--red);
}
.toast--info {
  border-left-color: var(--accent);
}
.toast--progress {
  border-left-color: var(--amber);
}
.toast__icon {
  font-size: 1.25rem;
  line-height: 1.3;
  flex-shrink: 0;
}
.toast--success .toast__icon {
  color: var(--green);
}
.toast--error .toast__icon {
  color: var(--red);
}
.toast--info .toast__icon {
  color: var(--accent);
}
.toast--progress .toast__icon {
  color: var(--amber);
}
.toast__body {
  flex: 1;
  min-width: 0;
}
.toast__title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.toast__msg {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.45;
  word-wrap: break-word;
}
.toast__msg a {
  color: var(--accent);
  font-weight: 600;
}
.toast__close {
  border: none;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  border-radius: 6px;
  flex-shrink: 0;
}
.toast__close:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.toast__spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--amber);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-top: 2px;
}

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  .app-shell {
    padding: 0 14px 96px;
  }
  .appbar::before {
    margin: 0 -14px;
  }
  .brand__subtitle {
    display: none;
  }
  .appbar__actions .btn span {
    display: none;
  }
  .appbar__actions .btn {
    padding: 0 12px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .count-pill {
    margin-left: 0;
  }
  .field--dates {
    flex: 1 1 100%;
  }
  .date-range {
    flex-wrap: wrap;
  }
  .date-range input[type="date"] {
    flex: 1 1 40%;
    min-width: 0;
  }
  .panel__footer {
    justify-content: center;
  }
  .pager {
    margin-left: 0;
  }
}

/* ===================== Motion preferences ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
