/* ── Admin Portal — Shared Styles ── */
/* Apple macOS aesthetic — dark theme for internal tooling */

:root {
  --bg: #1d1d1f;
  --bg-elevated: #2c2c2e;
  --bg-card: #2c2c2e;
  --bg-card-hover: #3a3a3c;
  --bg-input: #1c1c1e;
  --bg-header: #1a1a1c;
  --border: #48484a;
  --border-subtle: #38383a;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --blue: #0a84ff;
  --blue-hover: #409cff;
  --blue-bg: rgba(10,132,255,0.12);
  --green: #30d158;
  --green-bg: rgba(48,209,88,0.12);
  --red: #ff453a;
  --red-bg: rgba(255,69,58,0.12);
  --orange: #ff9f0a;
  --orange-bg: rgba(255,159,10,0.12);
  --purple: #bf5af2;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.4);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, 'SF Pro Display', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── Typography ── */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

/* ── Nav ── */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: rgba(29,29,31,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.admin-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-nav-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.admin-nav-logo .ai { color: var(--text); }
.admin-nav-logo .crm { color: var(--blue); }
.admin-nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-back:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}
.admin-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-nav-user {
  font-size: 13px;
  color: var(--text-secondary);
}
.admin-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.admin-nav-link:hover { color: var(--text); }
.admin-nav-link.active { color: var(--blue); }
.btn-logout {
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.btn-logout:hover { opacity: 0.8; }

/* ── Page Layout ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { margin: 0; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-elevated);
}
.card-body { padding: 20px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Hub Tiles ── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.hub-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-subtle, #e8e8ed);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.hub-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: rgba(0,113,227,0.25);
}
.hub-tile:active { transform: scale(0.98); }
.hub-tile-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--blue-bg);
  color: var(--blue);
}
.hub-tile-body { flex: 1; min-width: 0; }
.hub-tile-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}
.hub-tile-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}
.hub-tile:hover {
  border-color: var(--blue);
}

/* ── Dealer Cards ── */
.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.dealer-card {
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.dealer-card:hover {
  transform: translateY(-2px);
}
.dealer-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}
.dealer-card-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
}
.dealer-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: var(--red-bg); color: var(--red); }
.badge-role { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255,69,58,0.2); }
.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
}
.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ── Search ── */
.search-bar {
  position: relative;
  max-width: 400px;
}
.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-bar .form-input {
  padding-left: 38px;
  background: var(--bg-elevated);
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-header);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-elevated);
  width: min(520px, calc(100vw - 32px));
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 { font-size: 18px; }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state svg {
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-tertiary);
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 68px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-elevated);
  font-size: 14px;
  min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Credential Rows ── */
.cred-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.cred-service {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  min-width: 120px;
}
.cred-key {
  font-size: 13px;
  color: var(--text);
  min-width: 140px;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
}
.cred-value {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, monospace;
  flex: 1;
}
.cred-actions {
  display: flex;
  gap: 6px;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login Page ── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #000 0%, #1d1d1f 50%, #0a0a0a 100%);
}
.login-card {
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  padding: 40px;
}
.login-logo {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.login-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.login-error {
  display: none;
  padding: 10px 14px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-error.show { display: block; }
.login-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.login-btn:hover { background: var(--blue-hover); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Audit Timeline ── */
.audit-entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.audit-entry:last-child { border-bottom: none; }
.audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}
.audit-content { flex: 1; }
.audit-summary {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.audit-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── Stat Cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border); }
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}
.stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ── Health Dot ── */
.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* ── Pipeline Board ── */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pipeline-col {
  min-width: 260px;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}
.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.pipeline-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pipeline-col-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 10px;
}
.pipeline-col-total {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 16px 8px;
}
.pipeline-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}
.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.pipeline-card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
}
.pipeline-card-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.pipeline-card-account {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.pipeline-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
}
.pipeline-card-amount {
  font-weight: 600;
  color: var(--green);
}

/* ── List/Table Card ── */
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
}
.list-card .card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(255,255,255,0.02); }
.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.list-item-right {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
  flex-shrink: 0;
}

/* ── Two-column dashboard layout ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Badge additions ── */
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-purple { background: rgba(191,90,242,0.12); color: var(--purple); }

/* ── Account row ── */
.account-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
}
.account-row:last-child { border-bottom: none; }
.account-row:hover { background: rgba(255,255,255,0.02); }
.account-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
}
.account-owner {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 120px;
}
.account-arr {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  min-width: 100px;
  text-align: right;
}
.account-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  flex: 1;
  text-align: right;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-pill:hover { border-color: var(--blue); color: var(--text); }
.filter-pill.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue);
}
.filter-pill .count {
  margin-left: 6px;
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 8px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .page-container { padding: 20px clamp(12px, 4vw, 24px); }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dealer-grid { grid-template-columns: 1fr; }
  .admin-nav { padding: 0 16px; }
  .nav-hamburger { display: flex; }
  .admin-nav-right {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(29,29,31,0.97);
    backdrop-filter: blur(20px);
    padding: 12px 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
  }
  .admin-nav-right.nav-open { display: flex; }
  .admin-nav-link { padding: 8px 0; font-size: 15px; }
  .search-bar { max-width: 100%; }
  .login-card { padding: 28px 24px; }
  .cred-row { flex-wrap: wrap; }
  .dash-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .pipeline-board { grid-template-columns: 1fr; }
  .account-row { flex-wrap: wrap; gap: 8px; }
  .account-name { min-width: unset; flex: 1 1 100%; }
}

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

/* ── Extended Nav (v3) ── */
.admin-nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-nav-center::-webkit-scrollbar { display: none; }
.admin-nav-right { display: flex; align-items: center; gap: 12px; }
.admin-nav-mobile {
  display: none;
  position: absolute;
  top: 52px; left: 0; right: 0;
  flex-direction: column;
  background: rgba(29,29,31,0.97);
  backdrop-filter: blur(20px);
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 4px;
  z-index: 99;
}
.admin-nav-mobile.nav-open { display: flex; }
.admin-nav-mobile .admin-nav-link { padding: 8px 0; font-size: 15px; }

/* ── Global Search ── */
.nav-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
}
.nav-search-input {
  width: 200px;
  height: 32px;
  padding: 0 10px 0 30px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition), width var(--transition);
}
.nav-search-input:focus {
  outline: none;
  border-color: var(--blue);
  width: 280px;
  box-shadow: 0 0 0 3px rgba(10,132,255,0.1);
}
.nav-search-input::placeholder { color: var(--text-tertiary); }
.nav-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  z-index: 200;
  max-height: 400px;
  overflow-y: auto;
}
.nav-search-results.open { display: block; }
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
  cursor: pointer;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255,255,255,0.04); }
.search-result-item.muted { color: var(--text-tertiary); cursor: default; }
.search-result-icon { color: var(--text-tertiary); margin-top: 2px; flex-shrink: 0; }
.search-result-label { font-size: 13px; color: var(--text); font-weight: 500; }
.search-result-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ── Priority Dot ── */
.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Critical Badge ── */
.badge-critical { background: rgba(191,90,242,0.15); color: var(--purple); }

/* ── Ticket / Task List Row ── */
.ticket-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: rgba(255,255,255,0.02); }
.ticket-subject {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* ── Task Row ── */
.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: rgba(255,255,255,0.02); }
.task-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.task-check:hover { border-color: var(--green); }
.task-check.done { background: var(--green); border-color: var(--green); }
.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.task-title.done { text-decoration: line-through; color: var(--text-tertiary); }
.task-due {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.task-due.overdue { color: var(--red); font-weight: 600; }

/* ── Onboarding Checklist ── */
.onboard-category {
  margin-bottom: 24px;
}
.onboard-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.onboard-category-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.onboard-progress {
  font-size: 12px;
  color: var(--text-tertiary);
}
.onboard-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: background var(--transition);
}
.onboard-item:hover { background: var(--bg-card-hover); }
.onboard-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.onboard-check.done { background: var(--green); border-color: var(--green); }
.onboard-check:hover:not(.done) { border-color: var(--green); }
.onboard-item-body { flex: 1; }
.onboard-item-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.onboard-item-title.done { color: var(--text-tertiary); text-decoration: line-through; }
.onboard-item-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.onboard-item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Team User Row ── */
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: rgba(255,255,255,0.02); }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.user-name { font-size: 15px; font-weight: 600; color: var(--text); }
.user-email { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.user-meta { flex: 1; }

/* ── Ticket Detail ── */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.ticket-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}
.ticket-sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
}
.ticket-sidebar-row:last-child { border-bottom: none; }
.ticket-sidebar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  margin-top: 2px;
}
.ticket-sidebar-val { font-size: 13px; color: var(--text); text-align: right; }

/* ── Comment Thread ── */
.comment-thread { display: flex; flex-direction: column; gap: 14px; }
.comment-bubble {
  display: flex;
  gap: 10px;
}
.comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comment-body {
  flex: 1;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.comment-body.internal {
  background: rgba(255,159,10,0.06);
  border: 1px solid rgba(255,159,10,0.15);
}
.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.comment-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.comment-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.comment-reply {
  margin-top: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

/* ── Deal Activity Feed ── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.activity-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

/* ── Report Section ── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}
.report-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.report-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.report-card-value.green { color: var(--green); }
.report-card-value.blue { color: var(--blue); }
.report-card-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-label { min-width: 110px; color: var(--text-secondary); }
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 3px; background: var(--blue); }
.bar-val { min-width: 50px; text-align: right; color: var(--text-tertiary); font-size: 12px; }

/* ── Accounts page additions ── */
.acct-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.acct-row {
  display: grid;
  grid-template-columns: 2fr 1fr 90px 80px 90px 100px 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition);
}
.acct-row:last-child { border-bottom: none; }
.acct-row:hover { background: rgba(255,255,255,0.02); }
.acct-row-header {
  grid-template-columns: 2fr 1fr 90px 80px 90px 100px 80px;
  background: var(--bg-header);
  cursor: default;
  border-bottom: 1px solid var(--border-subtle);
}
.acct-row-header:hover { background: var(--bg-header); }
.acct-col-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.acct-name { font-size: 14px; font-weight: 600; color: var(--text); }
.acct-sub { font-size: 12px; color: var(--text-tertiary); font-family: 'SF Mono', monospace; }

/* ── Health score circle ── */
.health-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}
.health-circle.green { background: var(--green-bg); color: var(--green); }
.health-circle.yellow { background: var(--orange-bg); color: var(--orange); }
.health-circle.red { background: var(--red-bg); color: var(--red); }
.health-circle.gray { background: var(--bg-input); color: var(--text-tertiary); }

/* ── Contacts grid ── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.contact-card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}
.contact-name { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.contact-title-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.contact-info a { color: var(--blue); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }
.contact-dealer { font-size: 12px; color: var(--blue); margin-top: 8px; text-decoration: none; }

/* ── Responsive additions ── */
@media (max-width: 768px) {
  .admin-nav-center { display: none; }
  .admin-nav-right { gap: 8px; }
  .nav-search-input { width: 140px; }
  .nav-search-input:focus { width: 180px; }
  .nav-search-results { right: -40px; width: 300px; }
  .ticket-detail-grid { grid-template-columns: 1fr; }
  .acct-row { grid-template-columns: 1fr auto; }
  .acct-row > *:not(:nth-child(1)):not(:nth-child(2)):not(:nth-last-child(1)) { display: none; }
  .acct-row-header { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .report-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ────────────────────────────────────────────────────────────────────────
   Shared Component Layer — Apple macOS dark, Cognitive Neutral
   Use these classes on every admin page instead of hand-rolling inline.
   ────────────────────────────────────────────────────────────────────── */

/* Card chrome — every "section" on a page */
.ap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.ap-card + .ap-card { margin-top: 20px; }

.ap-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 0 0 14px;
}
.ap-card-head h3 {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-secondary); margin: 0;
}
.ap-card-head .meta {
  font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

/* Section labels (small uppercase form labels) */
.ap-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin: 0 0 6px; letter-spacing: -0.2px;
}

/* ── Header controls — standard 38px row of toolbar widgets ────────── */
.ap-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  flex-wrap: wrap;
}

.ap-search { position: relative; flex: 1; min-width: 200px; }
.ap-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text-secondary);
}
.ap-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-input); color: var(--text);
  font-size: 14px; letter-spacing: -0.2px;
}
.ap-search input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}
.ap-search input::placeholder { color: var(--text-tertiary); }

/* iOS-style segmented pill group */
.ap-seg {
  display: inline-flex; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px; padding: 2px;
  height: 38px; box-sizing: border-box;
}
.ap-seg button {
  border: none; background: transparent; padding: 0 14px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; border-radius: 8px; letter-spacing: -0.2px;
  height: 100%;
}
.ap-seg button:hover { color: var(--text); }
.ap-seg button.active {
  background: var(--bg-card-hover); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Form input (taller body-form variant — 42px) */
.ap-input,
.ap-textarea,
.ap-select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-input); color: var(--text);
  font-family: inherit; font-size: 14px; letter-spacing: -0.2px;
}
.ap-input, .ap-select { height: 42px; }
.ap-textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.ap-input:focus, .ap-textarea:focus, .ap-select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}

/* Buttons */
.ap-btn {
  height: 38px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-input); color: var(--text);
  font-size: 14px; font-weight: 600; letter-spacing: -0.2px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.ap-btn:hover:not(:disabled) {
  background: var(--bg-card-hover); border-color: var(--text-tertiary);
}
.ap-btn-primary {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
.ap-btn-primary:hover:not(:disabled) {
  background: var(--blue-hover); border-color: var(--blue-hover);
}
.ap-btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.ap-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ap-btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }

/* ── Status pills — Cognitive Neutral default, color only on state ── */
.ap-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: -0.2px;
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-subtle);
}
.ap-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.ap-pill.is-active,
.ap-pill.is-done,
.ap-pill.is-success     { background: var(--green-bg); color: var(--green); border-color: transparent; }
.ap-pill.is-progress,
.ap-pill.is-pending,
.ap-pill.is-info        { background: var(--blue-bg);  color: var(--blue);  border-color: transparent; }
.ap-pill.is-progress .dot { animation: ap-pulse 1.2s ease-in-out infinite; }
.ap-pill.is-warn        { background: var(--orange-bg); color: var(--orange); border-color: transparent; }
.ap-pill.is-failed,
.ap-pill.is-danger      { background: var(--red-bg); color: var(--red); border-color: transparent; }
@keyframes ap-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Aspect / option tiles — neutral surface, blue ring when selected */
.ap-tile {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; text-align: center; background: var(--bg-input);
  transition: background 0.12s, border-color 0.12s;
  color: var(--text);
}
.ap-tile:hover { background: var(--bg-card-hover); }
.ap-tile.selected {
  border-color: var(--blue); background: rgba(10,132,255,0.10);
  box-shadow: 0 0 0 2px rgba(10,132,255,0.20) inset;
}
.ap-tile .t-label { font-weight: 700; font-size: 14px; }
.ap-tile .t-blurb { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Image / avatar tile (square thumb + label) */
.ap-thumb-tile {
  position: relative; cursor: pointer;
  border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-input);
  transition: border-color 0.12s, transform 0.12s;
  display: flex; flex-direction: column;
}
.ap-thumb-tile:hover { border-color: rgba(10,132,255,0.5); transform: translateY(-1px); }
.ap-thumb-tile.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(10,132,255,0.25);
}
.ap-thumb-tile .thumb {
  width: 100%; aspect-ratio: 1/1; background: #1c1c1e;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ap-thumb-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ap-thumb-tile .thumb-fallback { color: var(--text-tertiary); font-size: 22px; font-weight: 700; }
.ap-thumb-tile .meta { padding: 7px 9px; }
.ap-thumb-tile .name {
  font-weight: 600; font-size: 11.5px; line-height: 1.3; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  letter-spacing: -0.2px;
}
.ap-thumb-tile .kind-pill {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

/* Empty state — outline icon + sentence, centered */
.ap-empty {
  text-align: center; padding: 40px 16px;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.ap-empty svg {
  width: 40px; height: 40px; stroke: var(--text-tertiary);
  stroke-width: 1.5; opacity: 0.85;
}

/* Character counter under textareas */
.ap-char-counter {
  font-size: 11px; color: var(--text-secondary);
  margin-top: 6px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Help text below form rows */
.ap-help {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 8px; line-height: 1.5;
}
.ap-help strong { color: var(--text); font-weight: 600; }

/* iOS-style preference toggle (used for boolean settings) */
.pref-toggle {
  width: 51px; height: 31px; border-radius: 16px; border: none;
  background: var(--border); cursor: pointer; position: relative;
  transition: background 0.25s cubic-bezier(0.65, 0, 0.35, 1); flex-shrink: 0;
}
.pref-toggle::after {
  content: ''; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: transform 0.25s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(0,0,0,0.08);
}
.pref-toggle.on { background: var(--green); }
.pref-toggle.on::after { transform: translateX(20px); }

