/* Saint Bernard Theme — gold, cream, dark navy. Applies globally across all modules.
 * Loaded after design-tokens.css. Uses !important where inline styles need overriding.
 */

/* ── Module overlays (full-screen dark panels) ─────────────────────────── */
.lb-overlay,
.module-overlay,
[id$="-overlay"][style*="position:fixed"],
[id$="-panel"][style*="position:fixed"] {
  font-family: var(--font-sans) !important;
}

/* ── Module header bar pattern ─────────────────────────────────────────── */
.module-header-bar {
  background: var(--color-dark-1);
  border-bottom: 3px solid var(--color-gold);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.module-header-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.module-title { font-size: 17px; font-weight: 800; color: var(--color-text-on-dark); letter-spacing: -.3px; }
.module-subtitle { font-size: 11px; color: var(--color-text-muted-dark); }

/* ── Tab bar pattern ───────────────────────────────────────────────────── */
.module-tab-bar {
  background: var(--color-dark-3);
  border-bottom: 1px solid #334155;
  padding: 0 20px;
  display: flex;
  flex-shrink: 0;
}
.module-tab {
  padding: 13px 22px;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  color: var(--color-text-secondary);
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.module-tab:hover { color: var(--color-gold-light); }
.module-tab.active {
  border-bottom-color: var(--color-gold) !important;
  color: var(--color-text-on-dark) !important;
}

/* ── Content area ──────────────────────────────────────────────────────── */
.module-content {
  flex: 1; overflow-y: auto;
  background: var(--color-panel);
}
.module-pane { padding: 20px; }

/* ── KPI bar cards ─────────────────────────────────────────────────────── */
.kpi-card {
  background: var(--color-dark-2);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.kpi-val { font-size: 20px; font-weight: 800; color: var(--color-text-on-dark); line-height: 1; }
.kpi-lbl { font-size: 9px; color: var(--color-text-muted-dark); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ── Data tables ───────────────────────────────────────────────────────── */
.module-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.module-table thead th {
  background: var(--color-dark-1);
  color: var(--color-text-muted-dark);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px; text-align: left;
}
.module-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.module-table tbody tr:hover { background: var(--color-gold-bg); }
.module-table tbody td { padding: 10px 12px; color: var(--color-text-primary); }

/* ── Action / row cards ─────────────────────────────────────────────────── */
.module-card {
  background: var(--color-card);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-gold);
  transition: box-shadow .15s, transform .15s;
}
.module-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ── Close button (consistent across all overlays) ─────────────────────── */
.module-close-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--color-text-on-dark);
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
  transition: background .15s;
}
.module-close-btn:hover { background: rgba(201,168,76,.2); color: var(--color-gold-light); }

/* ── Gold primary button (all modules) ─────────────────────────────────── */
.btn-gold,
.module-btn-primary {
  background: var(--color-gold);
  color: var(--color-dark-2);
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-gold:hover,
.module-btn-primary:hover { background: var(--color-gold-dark); }

/* ── Section headings inside modules ───────────────────────────────────── */
.module-section-title {
  font-size: 15px; font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-gold-border);
}

/* ── Form inputs inside modules ─────────────────────────────────────────── */
.module-input,
.module-select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: var(--color-card);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  transition: border-color .15s;
}
.module-input:focus,
.module-select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-border);
}

/* ── Leaderboard / rank highlight ───────────────────────────────────────── */
.rank-gold { background: linear-gradient(90deg, rgba(201,168,76,.15), transparent); }
.rank-gold .rank-name { color: var(--color-gold-dark) !important; font-weight: 900 !important; }
.rank-1-badge { background: var(--color-gold); color: var(--color-dark-2); font-weight: 800; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ── Position badges (inventory bookout) ────────────────────────────────── */
.pos-healthy { color: #22c55e; font-weight: 700; }
.pos-tight   { color: var(--color-warning); font-weight: 700; }
.pos-under   { color: var(--color-danger); font-weight: 700; }

/* ── Sidebar launch button helper ───────────────────────────────────────── */
.sidebar-module-btn {
  width: 100%; text-align: left;
  background: none; border: none;
  padding: 8px 12px;
  color: var(--color-text-muted-dark);
  font-size: 13px; cursor: pointer;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.sidebar-module-btn:hover { background: rgba(201,168,76,.12); color: var(--color-gold-light); }

/* ── Global: Any module using .sb-active for tab indicator ─────────────── */
.sb-active { border-bottom-color: var(--color-gold) !important; color: #f1f5f9 !important; }
