/* Solstaq Design System */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ── Design Tokens ── */
:root {
  --bg-primary: #0C0F12;
  --bg-secondary: #13171C;
  --bg-card: #181D24;
  --bg-card-hover: #1E242D;
  --border: #252D38;
  --border-subtle: #1C222B;
  --text-primary: #E8ECF1;
  --text-secondary: #8B95A5;
  --text-muted: #5A6478;
  --accent-solar: #E8A832;
  --accent-solar-dim: #E8A83220;
  --accent-solar-glow: #E8A83240;
  --accent-green: #34D399;
  --accent-green-dim: #34D39920;
  --accent-red: #F87171;
  --accent-red-dim: #F8717120;
  --accent-blue: #60A5FA;
  --accent-blue-dim: #60A5FA20;
  --accent-purple: #A78BFA;
  --accent-purple-dim: #8B5CF620;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 200ms cubic-bezier(.4, 0, .2, 1);
  --shadow-card: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  top: -40%; left: -20%;
  width: 80%; height: 80%;
  background: radial-gradient(ellipse, var(--accent-solar-dim) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, var(--accent-blue-dim) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.sb-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sb-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 36px;
}

.sb-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.sb-logo-text {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.sb-logo-text span { color: var(--accent-solar); }

.sb-nav-section { margin-bottom: 28px; }

.sb-nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.sb-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sb-nav-item.active {
  background: var(--accent-solar-dim);
  color: var(--accent-solar);
}
.sb-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent-solar);
  border-radius: 0 3px 3px 0;
}

.sb-nav-icon {
  width: 18px; height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.sb-nav-item.active .sb-nav-icon { opacity: 1; }

.sb-nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent-solar-dim);
  color: var(--accent-solar);
}

.sb-sidebar-footer {
  margin-top: auto;
  padding: 16px 8px;
  border-top: 1px solid var(--border-subtle);
}

.sb-tenant-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
}
.sb-tenant-switcher:hover { background: var(--bg-card-hover); }

.sb-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: all var(--transition);
}
.sb-signout-btn:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.sb-tenant-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.sb-tenant-info { flex: 1; min-width: 0; }
.sb-tenant-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-tenant-role { font-size: 11px; color: var(--text-muted); }

/* ── Main Content ── */
.sb-main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1280px;
  min-width: 0;
}

/* ── Header ── */
.sb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.sb-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.sb-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}
.sb-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Buttons ── */
.sb-btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sb-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.sb-btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sb-btn-primary {
  background: linear-gradient(135deg, var(--accent-solar), #D4922A);
  color: #0C0F12;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--accent-solar-glow);
}
.sb-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-solar-glow);
}
.sb-btn-sm { padding: 7px 14px; font-size: 12px; }

/* ── Connection Banner ── */
.sb-connection-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  animation: sb-fadeSlideIn 0.5s ease both;
}

.sb-connection-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sb-connection-dot.ok {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: sb-pulse 2s infinite;
}
.sb-connection-dot.mock {
  background: var(--accent-solar);
  box-shadow: 0 0 8px var(--accent-solar);
  animation: sb-pulse 2s infinite;
}

.sb-connection-info { flex: 1; }
.sb-connection-info strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.sb-connection-info span {
  font-size: 12px;
  color: var(--text-secondary);
}
.sb-connection-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}
.sb-connection-meta strong {
  color: var(--text-secondary);
  font-weight: 500;
  display: block;
}

/* ── Stats Grid ── */
.sb-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.sb-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.sb-stat-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.sb-stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
}
.sb-stat-card:nth-child(1)::after { background: linear-gradient(90deg, var(--accent-solar), transparent); }
.sb-stat-card:nth-child(2)::after { background: linear-gradient(90deg, var(--accent-green), transparent); }
.sb-stat-card:nth-child(3)::after { background: linear-gradient(90deg, var(--accent-blue), transparent); }
.sb-stat-card:nth-child(4)::after { background: linear-gradient(90deg, var(--accent-red), transparent); }

.sb-stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sb-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sb-stat-card:nth-child(1) .sb-stat-icon { background: var(--accent-solar-dim); color: var(--accent-solar); }
.sb-stat-card:nth-child(2) .sb-stat-icon { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-stat-card:nth-child(3) .sb-stat-icon { background: var(--accent-blue-dim); color: var(--accent-blue); }
.sb-stat-card:nth-child(4) .sb-stat-icon { background: var(--accent-red-dim); color: var(--accent-red); }

.sb-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.sb-stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.sb-stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.sb-stat-change.up { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-stat-change.down { background: var(--accent-red-dim); color: var(--accent-red); }
.sb-stat-change.neutral { background: var(--accent-blue-dim); color: var(--accent-blue); }

/* ── Cards ── */
.sb-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.sb-card:hover { border-color: var(--border); }

.sb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.sb-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sb-card-action {
  font-size: 12px;
  color: var(--accent-solar);
  cursor: pointer;
  font-weight: 500;
  transition: opacity var(--transition);
}
.sb-card-action:hover { opacity: 0.8; }

/* ── Content Grid ── */
.sb-content-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.sb-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* ── Data Table ── */
.sb-data-table {
  width: 100%;
  border-collapse: collapse;
}
.sb-data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.sb-data-table td {
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.sb-data-table tr:last-child td { border-bottom: none; }
.sb-data-table tbody tr { transition: background var(--transition); }
.sb-data-table tbody tr:hover { background: var(--bg-card-hover); }

/* ── Status Pills ── */
.sb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}
.sb-pill-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.sb-pill.delivered { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-pill.shipped { background: var(--accent-purple-dim); color: var(--accent-purple); }
.sb-pill.pending { background: var(--accent-solar-dim); color: var(--accent-solar); }

/* ── Activity Feed ── */
.sb-activity-list { list-style: none; padding: 0; margin: 0; }

.sb-activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: opacity var(--transition);
}
.sb-activity-item:last-child { border-bottom: none; }
.sb-activity-item:hover { opacity: 0.85; }

.sb-activity-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.sb-activity-icon.stock { background: var(--accent-solar-dim); }
.sb-activity-icon.sync { background: var(--accent-green-dim); }
.sb-activity-icon.ship { background: var(--accent-blue-dim); }
.sb-activity-icon.alert { background: var(--accent-red-dim); }

.sb-activity-content { flex: 1; min-width: 0; }
.sb-activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.sb-activity-text strong {
  color: var(--text-primary);
  font-weight: 500;
}
.sb-activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── AI Insights Card ── */
.sb-ai-card {
  background: linear-gradient(135deg, var(--bg-card), #1A1F2A);
  border-color: var(--accent-solar-dim);
  position: relative;
  overflow: hidden;
}
.sb-ai-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent-solar-dim) 0%, transparent 70%);
  pointer-events: none;
}
.sb-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-solar);
  margin-bottom: 14px;
  padding: 4px 10px;
  background: var(--accent-solar-dim);
  border-radius: 20px;
}
.sb-ai-insight {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  position: relative;
}
.sb-ai-insight strong { color: var(--text-primary); }

/* ── Sync Status ── */
.sb-sync-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.sb-sync-row:last-child { border-bottom: none; }
.sb-sync-entity {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}
.sb-sync-time { font-size: 11px; color: var(--text-muted); }
.sb-sync-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.sb-sync-icon.ok { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-sync-icon.warn { background: var(--accent-solar-dim); color: var(--accent-solar); }

/* ── Warehouse Bar ── */
.sb-warehouse-bar-track {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}
.sb-warehouse-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── Animations ── */
@keyframes sb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes sb-fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.sb-stats-grid .sb-stat-card:nth-child(1) { animation: sb-fadeSlideIn 0.4s ease 0.1s both; }
.sb-stats-grid .sb-stat-card:nth-child(2) { animation: sb-fadeSlideIn 0.4s ease 0.15s both; }
.sb-stats-grid .sb-stat-card:nth-child(3) { animation: sb-fadeSlideIn 0.4s ease 0.2s both; }
.sb-stats-grid .sb-stat-card:nth-child(4) { animation: sb-fadeSlideIn 0.4s ease 0.25s both; }
.sb-content-grid > *:nth-child(1) { animation: sb-fadeSlideIn 0.4s ease 0.3s both; }
.sb-content-grid > *:nth-child(2) { animation: sb-fadeSlideIn 0.4s ease 0.35s both; }
.sb-bottom-grid > *:nth-child(1) { animation: sb-fadeSlideIn 0.4s ease 0.4s both; }
.sb-bottom-grid > *:nth-child(2) { animation: sb-fadeSlideIn 0.4s ease 0.45s both; }
.sb-bottom-grid > *:nth-child(3) { animation: sb-fadeSlideIn 0.4s ease 0.5s both; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .sb-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sb-content-grid { grid-template-columns: 1fr; }
  .sb-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sb-sidebar { display: none; }
  .sb-main { padding: 20px; }
  .sb-stats-grid { grid-template-columns: 1fr; }
  .sb-header { flex-direction: column; gap: 16px; }
}

/* ── Devise forms (dark theme) ── */
.sb-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.sb-auth-card h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}
.sb-auth-card label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.sb-auth-card input[type="email"],
.sb-auth-card input[type="password"],
.sb-auth-card input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.sb-auth-card input:focus {
  outline: none;
  border-color: var(--accent-solar);
}
.sb-auth-card input[type="submit"] {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--accent-solar), #D4922A);
  color: #0C0F12;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.sb-auth-card input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-solar-glow);
}
.sb-auth-card .field_with_errors input {
  border-color: var(--accent-red);
}

/* Flash messages */
.sb-flash {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}
.sb-flash.notice { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-flash.alert { background: var(--accent-red-dim); color: var(--accent-red); }

/* ── Breadcrumbs ── */
.sb-breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sb-breadcrumbs a {
  color: var(--text-secondary);
  transition: color var(--transition);
}
.sb-breadcrumbs a:hover { color: var(--accent-solar); }
.sb-breadcrumbs span { color: var(--text-muted); font-size: 11px; }

/* ── Filter Tabs ── */
.sb-filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
}
.sb-filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.sb-filter-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.sb-filter-tab.active {
  background: var(--accent-solar-dim);
  color: var(--accent-solar);
}

/* ── Search Bar ── */
.sb-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  color: var(--text-muted);
  transition: border-color var(--transition);
}
.sb-search-bar:focus-within {
  border-color: var(--accent-solar);
}
.sb-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.sb-search-input::placeholder { color: var(--text-muted); }

/* ── Category Pills ── */
.sb-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}
.sb-category-pill.panels { background: var(--accent-solar-dim); color: var(--accent-solar); }
.sb-category-pill.inverters { background: var(--accent-blue-dim); color: var(--accent-blue); }
.sb-category-pill.batteries { background: var(--accent-green-dim); color: var(--accent-green); }
.sb-category-pill.accessories { background: var(--accent-purple-dim); color: var(--accent-purple); }

/* ── Detail Grid (2-col layout) ── */
.sb-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) {
  .sb-detail-grid { grid-template-columns: 1fr; }
}

/* ── Detail Rows ── */
.sb-detail-rows { display: flex; flex-direction: column; }
.sb-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.sb-detail-row:last-child { border-bottom: none; }
.sb-detail-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 120px;
}
.sb-detail-value {
  font-size: 13px;
  color: var(--text-primary);
  text-align: right;
}

/* ── Warehouse Grid ── */
.sb-warehouse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1200px) {
  .sb-warehouse-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sb-warehouse-grid { grid-template-columns: 1fr; }
}

.sb-warehouse-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
}
.sb-warehouse-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.sb-warehouse-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sb-warehouse-code {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
}
.sb-warehouse-name {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.sb-warehouse-location {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.sb-warehouse-stats {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.sb-warehouse-stat { display: flex; flex-direction: column; }
.sb-warehouse-stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 4px;
}
.sb-warehouse-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Row Highlighting ── */
.sb-row-highlight-red {
  background: rgba(248, 113, 113, 0.05);
}
.sb-row-highlight-amber {
  background: rgba(232, 168, 50, 0.05);
}

/* ── Clickable Stat Card Links ── */
.sb-stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.sb-stat-card-link .sb-stat-card {
  cursor: pointer;
}

/* ── Clickable Row ── */
.sb-clickable-row {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
tr.sb-clickable-row { display: table-row; }

/* ── Shipment Timeline ── */
.sb-shipment-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 0;
}
.sb-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sb-timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border-subtle);
  transition: all var(--transition);
}
.sb-timeline-step.active .sb-timeline-dot {
  background: var(--accent-solar);
  border-color: var(--accent-solar);
  box-shadow: 0 0 8px var(--accent-solar-glow);
}
.sb-timeline-step.current .sb-timeline-dot {
  box-shadow: 0 0 12px var(--accent-solar-glow), 0 0 24px var(--accent-solar-dim);
}
.sb-timeline-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.sb-timeline-step.active .sb-timeline-label {
  color: var(--text-primary);
}
.sb-timeline-line {
  width: 80px;
  height: 2px;
  background: var(--border);
  margin-bottom: 22px;
}
.sb-timeline-line.active {
  background: var(--accent-solar);
}

/* ── Insight Item ── */
.sb-insight-item {
  padding: 8px 0;
  position: relative;
}
.sb-insight-item + .sb-insight-item {
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
  padding-top: 12px;
}

/* ── Pagination ── */
.sb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.sb-pagination-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.sb-pagination-btn:hover:not(.disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.sb-pagination-btn.disabled {
  opacity: 0.4;
  cursor: default;
}
.sb-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sb-pagination-page {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.sb-pagination-page:hover { background: var(--bg-card); color: var(--text-primary); }
.sb-pagination-page.active {
  background: var(--accent-solar-dim);
  color: var(--accent-solar);
}
.sb-pagination-gap {
  width: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Forms ── */
.sb-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}

.sb-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.sb-input,
.sb-select,
.sb-textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 14px;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
}

.sb-input:focus,
.sb-select:focus,
.sb-textarea:focus {
  border-color: var(--accent-solar);
}

.sb-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B95A5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.sb-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.sb-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-solar);
  cursor: pointer;
}

.sb-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sb-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

/* ── Tables ── */
.sb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sb-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sb-table td {
  padding: 14px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.sb-table tbody tr:hover td { background: var(--bg-card-hover); }

/* ── Empty State ── */
.sb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 16px;
}

.sb-empty-state svg { opacity: 0.4; }

.sb-empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.sb-empty-state p a { color: var(--accent-solar); text-decoration: none; }
.sb-empty-state p a:hover { text-decoration: underline; }

/* ── Alert type badges ── */
.sb-alert-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.sb-alert-type-low_stock    { background: var(--accent-solar-dim); color: var(--accent-solar); }
.sb-alert-type-out_of_stock { background: var(--accent-red-dim);   color: var(--accent-red); }
.sb-alert-type-high_demand  { background: var(--accent-purple-dim); color: var(--accent-purple); }
.sb-alert-type-transfer_delay { background: var(--accent-blue-dim); color: var(--accent-blue); }
.sb-alert-type-sync_failure { background: var(--accent-red-dim);   color: var(--accent-red); }

/* ── Status dot ── */
.sb-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.sb-status-dot.active   { background: var(--accent-green); }
.sb-status-dot.inactive { background: var(--text-muted); }

/* ── Notification bell dot ── */
.sb-signout-btn { position: relative; }

.sb-bell-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
  border: 1.5px solid var(--bg-secondary);
}
