/* ============================================================
   components.css — Jimeat ERP component library
   Design system: Airtable DESIGN.md, Jimeat brand override
   Depends on: layout.css (CSS variables defined there)
   ============================================================ */

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--sp-lg);
  height: 40px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--j-red);
  color: #ffffff;
  border-color: var(--j-red);
}

.btn-primary:hover {
  background: var(--j-red-dark);
  border-color: var(--j-red-dark);
}

.btn-primary:active {
  background: #5e0f17;
  border-color: #5e0f17;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--j-canvas);
  color: var(--j-ink);
  border-color: var(--j-hairline);
}

.btn-secondary:hover {
  background: var(--j-surface-soft);
  border-color: var(--j-border-strong);
}

.btn-secondary:active {
  background: var(--j-surface-strong);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--j-canvas);
  color: #c0392b;
  border-color: #f5c6cb;
}

.btn-danger:hover {
  background: #fde8ea;
  border-color: #c0392b;
}

.btn-danger:active {
  background: #fbd2d6;
  border-color: #a31212;
  color: #a31212;
}

/* Size modifier */
.btn-sm {
  height: 32px;
  padding: 0 var(--sp-sm);
  font-size: 12px;
}

.btn-lg {
  height: 48px;
  padding: 0 var(--sp-xl);
  font-size: 15px;
}

.btn-full {
  width: 100%;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-success {
  background: var(--j-success-bg);
  color: var(--j-success-text);
}

.badge-warning {
  background: var(--j-warning-bg);
  color: var(--j-warning-text);
}

.badge-danger {
  background: var(--j-danger-bg);
  color: var(--j-danger-text);
}

.badge-info {
  background: var(--j-info-bg);
  color: var(--j-info-text);
}

.badge-neutral {
  background: var(--j-neutral-bg);
  color: var(--j-neutral-text);
}

/* Alias names used in hub.html */
.badge-live    { background: var(--j-success-bg); color: var(--j-success-text); }
.badge-planned { background: var(--j-neutral-bg); color: var(--j-neutral-text); }
.badge-dev     { background: var(--j-warning-bg); color: var(--j-warning-text); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--j-canvas);
  border: 1px solid var(--j-hairline);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
  gap: var(--sp-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--j-ink);
  line-height: 1.4;
}

.card-subtitle {
  font-size: 13px;
  color: var(--j-muted);
  margin-top: 2px;
}

/* ── Data table ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--j-body);
}

.data-table thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--j-hairline);
}

.data-table th {
  padding: var(--sp-sm) var(--sp-md);
  font-weight: 500;
  font-size: 12px;
  color: var(--j-muted);
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.data-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--j-hairline);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

/* Wrap table in this for horizontal scroll on mobile */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--j-hairline);
  border-radius: var(--r-md);
}

/* ── Form controls ──────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--j-ink);
  margin-bottom: var(--sp-xxs);
  line-height: 1.4;
}

.form-label .optional {
  font-weight: 400;
  color: var(--j-muted);
  font-size: 12px;
  margin-left: 4px;
}

.form-input,
.form-select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--j-ink);
  background: var(--j-canvas);
  border: 1px solid var(--j-hairline);
  border-radius: var(--r-sm);
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--j-border-strong);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--j-red);
  box-shadow: 0 0 0 3px var(--j-red-alpha-15);
}

.form-input:disabled,
.form-select:disabled {
  background: var(--j-surface-soft);
  color: var(--j-muted);
  cursor: not-allowed;
}

.form-group {
  margin-bottom: var(--sp-md);
}

.form-hint {
  margin-top: var(--sp-xxs);
  font-size: 12px;
  color: var(--j-muted);
}

.form-error {
  margin-top: var(--sp-xxs);
  font-size: 12px;
  color: var(--j-red);
  min-height: 18px;
}

/* Textarea variant */
.form-textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: var(--sp-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--j-ink);
  background: var(--j-canvas);
  border: 1px solid var(--j-hairline);
  border-radius: var(--r-sm);
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--j-red);
  box-shadow: 0 0 0 3px var(--j-red-alpha-15);
}

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--sp-xl);
}

.page-header h1,
.page-header-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--j-ink);
  line-height: 1.35;
  text-decoration: none;
  border-bottom: none;
}

.page-header-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--j-muted);
  margin-bottom: var(--sp-xxs);
  display: block;
}

.page-header-name-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-xs);
}

.page-header-subtitle {
  margin-top: var(--sp-xxs);
  font-size: 14px;
  color: var(--j-muted);
  line-height: 1.5;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  margin-top: var(--sp-sm);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

/* ── Stat card ──────────────────────────────────────────────── */
.stat-card {
  background: var(--j-canvas);
  border: 1px solid var(--j-hairline);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xxs);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--j-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--j-ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  margin-top: var(--sp-xxs);
}

.stat-trend.up   { color: var(--j-success); }
.stat-trend.down { color: var(--j-red); }
.stat-trend.flat { color: var(--j-muted); }

/* ── Stat grid ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xxl) var(--sp-lg);
  text-align: center;
  color: var(--j-muted);
  gap: var(--sp-sm);
}

.empty-state-icon {
  font-size: 40px;
  line-height: 1;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--j-ink);
}

.empty-state-desc {
  font-size: 13px;
  color: var(--j-muted);
  max-width: 300px;
  line-height: 1.5;
}

/* ── Loading spinner ────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--j-hairline);
  border-top-color: var(--j-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.loading-spinner.lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xxl);
}

/* ── Alert / inline message ─────────────────────────────────── */
.alert {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--j-success-bg);
  color: var(--j-success-text);
  border-color: #a7f3c0;
}

.alert-warning {
  background: var(--j-warning-bg);
  color: var(--j-warning-text);
  border-color: #fde68a;
}

.alert-danger {
  background: var(--j-danger-bg);
  color: var(--j-danger-text);
  border-color: #fca5a5;
}

.alert-info {
  background: var(--j-info-bg);
  color: var(--j-info-text);
  border-color: #93c5fd;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--j-hairline);
  margin: var(--sp-lg) 0;
}

/* ── Section label (table section headers) ──────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--j-muted);
  margin-bottom: var(--sp-sm);
  display: block;
}

/* ── Portal card (hub.html portal grid) ─────────────────────── */
.portal-card {
  background: var(--j-canvas);
  border: 1px solid var(--j-hairline);
  border-left: 3px solid transparent;
  border-radius: var(--r-md);
  padding: var(--sp-md);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-sm);
  text-decoration: none;
  color: var(--j-ink);
  transition: box-shadow 0.18s, border-left-color 0.18s;
  cursor: pointer;
  position: relative;
  min-height: 72px;
}

a.portal-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-left-color: var(--j-red);
}

.portal-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.4);
}

.portal-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--j-red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-card.disabled .portal-card-icon {
  background: var(--j-neutral-bg);
  color: var(--j-neutral-text);
}

.portal-card-body {
  flex: 1;
  min-width: 0;
}

.portal-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--j-ink);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-card-desc {
  font-size: 12px;
  color: var(--j-muted);
  line-height: 1.4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-card-badge {
  position: absolute;
  top: 8px;
  right: 10px;
}

/* ── Portal grid (hub layout) ───────────────────────────────── */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-md);
}

@media (max-width: 639px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Hub signature banner ───────────────────────────────────── */
.hub-banner {
  background: var(--j-red);
  color: #ffffff;
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
}

.hub-banner-left {}

.hub-banner-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hub-banner-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 6px;
  line-height: 1.4;
}

.hub-banner-right {
  flex-shrink: 0;
  width: 80px;
}

/* ── Sidebar nav monogram badge ─────────────────────────────── */
.sidebar-nav-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 18px;
  border-radius: var(--r-xs);
  background: var(--j-surface-strong);
  color: var(--j-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-nav a.active .sidebar-nav-monogram {
  background: var(--j-red);
  color: #ffffff;
}

/* ── Login overlay ──────────────────────────────────────────── */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(24, 29, 38, 0.96);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
}

.login-overlay.visible {
  display: flex;
}

.login-card {
  background: var(--j-canvas);
  border-radius: var(--r-lg);
  padding: var(--sp-xl) var(--sp-xl);
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.login-brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--j-red);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-xxs);
}

.login-subtitle {
  font-size: 13px;
  color: var(--j-muted);
  margin-bottom: var(--sp-xl);
}

.login-btn {
  width: 100%;
  height: 44px;
  background: var(--j-red);
  color: #ffffff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--sp-xs);
  transition: background 0.15s;
}

.login-btn:hover {
  background: var(--j-red-dark);
}

.login-btn:active {
  background: #5e0f17;
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  color: var(--j-red);
  font-size: 13px;
  margin-top: var(--sp-sm);
  min-height: 20px;
  text-align: center;
  line-height: 1.4;
}

/* ============================================================
   sh-* Unified Component Library (Wave 2 B4)
   Depends on: shell.css (--sh-* tokens)
   Prefix: sh- to avoid collision with existing classes
   ============================================================ */

/* ── Empty state ─────────────────────────────────────────── */
.sh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.sh-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--sh-radius-xl);
  background: var(--sh-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.sh-empty-icon--success { background: var(--sh-success-bg); }
.sh-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sh-ink);
  margin-bottom: 6px;
}
.sh-empty-title--success { color: var(--sh-success-text); }
.sh-empty-desc {
  font-size: 13px;
  color: var(--sh-ink-muted);
  margin-bottom: 20px;
  line-height: 1.5;
  max-width: 280px;
}

/* ── Error state ─────────────────────────────────────────── */
.sh-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.sh-error-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--sh-radius-xl);
  background: var(--sh-danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.sh-error-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sh-ink);
  margin-bottom: 6px;
}
.sh-error-desc {
  font-size: 13px;
  color: var(--sh-ink-muted);
  margin-bottom: 20px;
  line-height: 1.5;
  max-width: 280px;
}
.sh-error-code {
  font-family: var(--sh-mono);
  font-size: 11px;
  color: var(--sh-danger-text);
  background: var(--sh-danger-bg);
  padding: 6px 12px;
  border-radius: var(--sh-radius);
  margin-bottom: 20px;
}

/* ── Skeleton / loading ──────────────────────────────────── */
.sh-skeleton {
  background: var(--sh-surface-3);
  border-radius: var(--sh-radius-xs);
  position: relative;
  overflow: hidden;
}
.sh-skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: sh-shimmer 1.5s infinite;
}
@keyframes sh-shimmer { to { left: 150%; } }
@media (prefers-reduced-motion: reduce) {
  .sh-skeleton::after { animation: none; background: transparent; }
}
.sh-skeleton-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}
.sh-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sh-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sh-skeleton-line { height: 10px; }
.sh-skeleton-table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sh-border);
}
.sh-skeleton-table-row:last-child { border-bottom: none; }
.sh-skeleton-card {
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  padding: 20px;
}

/* ── Toast notifications ─────────────────────────────────── */
.sh-toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
@media (max-width: 600px) {
  .sh-toast-region {
    left: 16px;
    right: 16px;
    top: 12px;
  }
}
.sh-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--sh-radius-md);
  border: 1px solid var(--sh-border);
  background: var(--sh-surface);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  max-width: 360px;
  width: 100%;
  pointer-events: all;
}
.sh-toast--success { border-color: #A7F3D0; }
.sh-toast--error   { border-color: #FCA5A5; }
.sh-toast--warning { border-color: #FCD34D; }
.sh-toast--info    { border-color: #93C5FD; }
.sh-toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sh-toast-icon--success { background: var(--sh-success-bg); }
.sh-toast-icon--error   { background: var(--sh-danger-bg);  }
.sh-toast-icon--warning { background: var(--sh-warning-bg); }
.sh-toast-icon--info    { background: var(--sh-info-bg);    }
.sh-toast-body { flex: 1; }
.sh-toast-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sh-ink);
  margin-bottom: 2px;
}
.sh-toast-desc {
  font-size: 12.5px;
  color: var(--sh-ink-muted);
  line-height: 1.4;
}
.sh-toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--sh-ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sh-radius-xs);
  flex-shrink: 0;
  padding: 0;
}
.sh-toast-close:hover {
  background: var(--sh-surface-3);
  color: var(--sh-ink);
}

/* ── Confirmation dialog ─────────────────────────────────── */
.sh-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  padding: 16px;
}
.sh-dialog-backdrop.sh-hidden { display: none; }
.sh-dialog {
  background: var(--sh-surface);
  border-radius: var(--sh-radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.sh-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--sh-radius-md);
  background: var(--sh-danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.sh-dialog-icon--warning { background: var(--sh-warning-bg); }
.sh-dialog-icon--info    { background: var(--sh-info-bg); }
.sh-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--sh-ink);
  margin-bottom: 6px;
}
.sh-dialog-body {
  font-size: 13.5px;
  color: var(--sh-ink-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.sh-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Form validation states ──────────────────────────────── */
.sh-field { margin-bottom: 16px; }
.sh-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--sh-ink);
  margin-bottom: 6px;
}
.sh-label-required { color: var(--sh-danger-text); margin-left: 2px; }
.sh-label-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--sh-ink-faint);
  margin-left: 4px;
}
.sh-input,
.sh-select,
.sh-textarea {
  display: block;
  width: 100%;
  padding: 0 12px;
  font-family: var(--sh-font);
  font-size: 14px;
  color: var(--sh-ink);
  background: var(--sh-surface);
  border: 1px solid var(--sh-border-strong);
  border-radius: var(--sh-radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.sh-input,
.sh-select { height: 44px; }
.sh-textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
.sh-input::placeholder,
.sh-textarea::placeholder { color: var(--sh-ink-faint); }
.sh-input:focus,
.sh-select:focus,
.sh-textarea:focus {
  border-color: var(--sh-red);
  box-shadow: 0 0 0 3px rgba(164,29,43,.12);
}
.sh-input--valid,
.sh-select--valid { border-color: var(--sh-success-text); }
.sh-input--invalid,
.sh-select--invalid,
.sh-textarea--invalid { border-color: var(--sh-danger-text); }
.sh-input--invalid:focus,
.sh-textarea--invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.sh-field-hint {
  font-size: 12px;
  color: var(--sh-ink-faint);
  margin-top: 5px;
  line-height: 1.4;
}
.sh-field-error {
  font-size: 12px;
  color: var(--sh-danger-text);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}
.sh-field-success {
  font-size: 12px;
  color: var(--sh-success-text);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

/* ── Search component ────────────────────────────────────── */
.sh-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sh-search-icon-left {
  position: absolute;
  left: 12px;
  color: var(--sh-ink-faint);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.sh-search-icon-right {
  position: absolute;
  right: 10px;
  color: var(--sh-ink-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--sh-radius-xs);
  display: flex;
  align-items: center;
}
.sh-search-icon-right:hover {
  background: var(--sh-surface-3);
  color: var(--sh-ink);
}
.sh-search-input {
  width: 100%;
  height: 44px;
  padding: 0 36px;
  font-family: var(--sh-font);
  font-size: 14px;
  color: var(--sh-ink);
  background: var(--sh-surface);
  border: 1px solid var(--sh-border-strong);
  border-radius: var(--sh-radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.sh-search-input::placeholder { color: var(--sh-ink-faint); }
.sh-search-input:focus {
  border-color: var(--sh-red);
  box-shadow: 0 0 0 3px rgba(164,29,43,.12);
}
.sh-search-results {
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  overflow: hidden;
}
.sh-search-section-head {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--sh-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sh-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--sh-border);
  transition: background 0.08s;
}
.sh-search-result-item:last-child { border-bottom: none; }
.sh-search-result-item:hover { background: var(--sh-surface-2); }
.sh-search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--sh-radius);
  background: var(--sh-red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sh-search-result-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sh-ink);
}
.sh-search-result-sub {
  font-size: 11.5px;
  color: var(--sh-ink-faint);
}
.sh-search-result-type {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sh-ink-faint);
  background: var(--sh-surface-3);
  padding: 2px 8px;
  border-radius: var(--sh-radius-pill);
  flex-shrink: 0;
}

/* ── Pagination ──────────────────────────────────────────── */
.sh-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sh-page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--sh-border);
  background: var(--sh-surface);
  border-radius: var(--sh-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sh-font);
  color: var(--sh-ink-muted);
  transition: background 0.1s, border-color 0.1s;
  padding: 0;
}
.sh-page-btn:hover {
  background: var(--sh-surface-3);
  color: var(--sh-ink);
  border-color: var(--sh-border-strong);
}
.sh-page-btn--active {
  background: var(--sh-red);
  color: white;
  border-color: var(--sh-red);
  font-weight: 600;
}
.sh-page-btn--active:hover {
  background: var(--sh-red-dark);
  border-color: var(--sh-red-dark);
}
.sh-page-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.sh-page-ellipsis {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--sh-ink-faint);
}
.sh-pagination-meta {
  font-size: 13px;
  color: var(--sh-ink-muted);
  margin-left: 12px;
}
