/* ============================================================
   OreQuant — Member-Area Custom Stylesheet
   Depends on: tokens.css, deco.css (loaded before this file)
   Scope: member shell + Bootstrap overrides + all page widgets
   ============================================================ */

/* ---------- LAYOUT VARIABLES ---------- */
:root {
  --sidebar-width: 260px;
  --header-height: 70px;
}

/* ============================================================
   SECTION 1 — MEMBER SHELL: SIDEBAR
   ============================================================ */

.sidebar-overlay { display: none; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--oq-surface-deep);
  border-right: 1px solid var(--oq-hairline);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--oq-dur) var(--oq-ease);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--oq-space-5);
  border-bottom: 1px solid var(--oq-border);
  gap: var(--oq-space-3);
  flex-shrink: 0;
}

.sidebar-brand h4 {
  font-family: var(--oq-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oq-ivory);
  margin: 0;
  line-height: 1.2;
}

.sidebar-brand small {
  font-size: 10px;
  color: var(--oq-brass);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--oq-font-body);
}

/* Nav container */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--oq-space-3) 0;
}

/* Individual nav link */
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 10px var(--oq-space-5);
  color: var(--oq-text-muted);
  font-size: 13px;
  font-family: var(--oq-font-body);
  gap: var(--oq-space-3);
  transition: background var(--oq-dur-fast) var(--oq-ease),
              color var(--oq-dur-fast) var(--oq-ease),
              border-color var(--oq-dur-fast) var(--oq-ease);
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.sidebar-nav .nav-item:hover {
  background: var(--oq-surface-hover);
  color: var(--oq-ivory);
  text-decoration: none;
}

/* Active state — brass left rule + chevron */
.sidebar-nav .nav-item.active,
.sidebar-nav .nav-item.oq-sidebar-active {
  background: var(--oq-brass-faint);
  color: var(--oq-brass-light);
  border-left-color: var(--oq-brass);
}

/* Chevron prefix (added by sidebar.php update) */
.sidebar-nav .nav-item .chev {
  font-size: 14px;
  color: var(--oq-brass-dark);
  opacity: 0;
  transition: opacity var(--oq-dur-fast) var(--oq-ease);
  flex-shrink: 0;
  line-height: 1;
  margin-left: -4px;
}

.sidebar-nav .nav-item.active .chev,
.sidebar-nav .nav-item.oq-sidebar-active .chev {
  opacity: 1;
  color: var(--oq-brass);
}

.sidebar-nav .nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-nav .nav-item.locked {
  opacity: 0.55;
}

/* Accordion section headers */
.sidebar-accordion {
  margin: 2px 0;
}

.sidebar-accordion-toggle {
  display: flex;
  align-items: center;
  padding: 8px var(--oq-space-5) 6px;
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  color: var(--oq-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: color var(--oq-dur-fast) var(--oq-ease);
}

.sidebar-accordion-toggle:hover {
  color: var(--oq-brass);
}

.sidebar-accordion-toggle .accordion-chevron {
  margin-left: auto;
  font-size: 12px;
  transition: transform var(--oq-dur) var(--oq-ease);
  color: var(--oq-text-dim);
}

.sidebar-accordion.open .accordion-chevron {
  transform: rotate(90deg);
}

.sidebar-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--oq-ease);
}

.sidebar-accordion.open .sidebar-accordion-body {
  max-height: 600px;
}

/* Indented accordion items */
.sidebar-accordion-body .nav-item {
  padding-left: var(--oq-space-7);
}

/* Separator rule */
.sidebar-separator {
  height: 1px;
  background: var(--oq-border);
  margin: var(--oq-space-2) var(--oq-space-5);
}

/* ============================================================
   SECTION 2 — MEMBER SHELL: TOP HEADER (TOPBAR)
   ============================================================ */

.top-header {
  height: var(--header-height);
  background: rgba(13, 21, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--oq-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.top-header .header-left {
  display: flex;
  align-items: center;
  gap: var(--oq-space-4);
}

.top-header .header-left h5 {
  font-family: var(--oq-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oq-ivory);
  margin: 0;
}

.top-header .header-right {
  display: flex;
  align-items: center;
  gap: var(--oq-space-4);
}

/* Freshness badge */
.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--oq-space-2);
  padding: 4px 12px;
  border-radius: var(--oq-radius-pill);
  font-size: 11px;
  font-family: var(--oq-font-body);
  font-weight: 500;
}

.freshness-badge.fresh {
  background: rgba(127, 179, 137, 0.12);
  color: var(--oq-gain);
  border: 1px solid rgba(127, 179, 137, 0.2);
}

.freshness-badge.stale {
  background: rgba(212, 180, 131, 0.12);
  color: var(--oq-warn);
  border: 1px solid rgba(212, 180, 131, 0.2);
}

.freshness-badge.very-stale {
  background: rgba(201, 125, 111, 0.12);
  color: var(--oq-loss);
  border: 1px solid rgba(201, 125, 111, 0.2);
}

.freshness-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: oq-pulse 2s infinite;
}

.freshness-badge.fresh .dot     { background: var(--oq-gain); }
.freshness-badge.stale .dot     { background: var(--oq-warn); }
.freshness-badge.very-stale .dot { background: var(--oq-loss); }

@keyframes oq-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Per-section staleness indicators */
.staleness-indicator {
  font-size: 10px;
  padding: 2px 6px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.staleness-indicator.fresh     { color: var(--oq-gain); }
.staleness-indicator.stale     { color: var(--oq-warn); }
.staleness-indicator.very-stale { color: var(--oq-loss); }

.staleness-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.staleness-dot.fresh     { background: var(--oq-gain); }
.staleness-dot.stale     { background: var(--oq-warn); }
.staleness-dot.very-stale { background: var(--oq-loss); }

.staleness-indicator-inline.fresh     { color: var(--oq-gain); }
.staleness-indicator-inline.stale     { color: var(--oq-warn); }
.staleness-indicator-inline.very-stale { color: var(--oq-loss); }

/* Header icon buttons */
.header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--oq-radius-md);
  background: var(--oq-surface-hover);
  border: 1px solid var(--oq-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--oq-text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: border-color var(--oq-dur-fast) var(--oq-ease),
              color var(--oq-dur-fast) var(--oq-ease);
  position: relative;
  text-decoration: none;
}

.header-icon:hover {
  border-color: var(--oq-brass);
  color: var(--oq-brass-light);
  text-decoration: none;
}

.header-icon .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--oq-loss);
  border-radius: 50%;
}

/* User avatar */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--oq-radius-md);
  background: linear-gradient(135deg, var(--oq-brass), var(--oq-brass-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--oq-font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--oq-bg);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--oq-brass-dark);
}

.user-avatar:hover { text-decoration: none; }

/* Topbar page title (added hook by header.php) */
.oq-topbar-title {
  font-family: var(--oq-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oq-ivory);
  margin: 0;
}

/* Sidebar mobile toggle */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--oq-radius-md);
  background: var(--oq-surface-hover);
  border: 1px solid var(--oq-border);
  align-items: center;
  justify-content: center;
  color: var(--oq-text-muted);
  font-size: 18px;
  cursor: pointer;
}

/* ============================================================
   SECTION 3 — MEMBER SHELL: MAIN CONTENT AREA
   ============================================================ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--oq-bg);
}

.page-content {
  padding: var(--oq-space-5) 28px;
}

/* ============================================================
   SECTION 4 — BOOTSTRAP OVERRIDES: CARDS
   ============================================================ */

/* BS .card → surface bg, brass border, no default white */
.card {
  background: var(--oq-surface) !important;
  border: 1px solid var(--oq-border) !important;
  border-radius: var(--oq-radius-md) !important;
  color: var(--oq-ivory) !important;
}

.card-header {
  background: var(--oq-surface-accent) !important;
  border-bottom: 1px solid var(--oq-border) !important;
  font-family: var(--oq-font-serif);
  font-weight: 600;
  color: var(--oq-ivory) !important;
}

.card-body {
  color: var(--oq-text) !important;
}

/* ============================================================
   SECTION 5 — BOOTSTRAP OVERRIDES: BUTTONS
   ============================================================ */

/* Primary → brass filled, dark-green text */
.btn-primary,
.btn-primary:visited {
  background: var(--oq-brass) !important;
  border-color: var(--oq-brass-light) !important;
  color: var(--oq-bg) !important;
  font-family: var(--oq-font-serif);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--oq-brass-light) !important;
  border-color: var(--oq-brass-light) !important;
  color: var(--oq-bg) !important;
}

/* Outline primary → brass outline */
.btn-outline-primary {
  background: transparent !important;
  border-color: var(--oq-brass) !important;
  color: var(--oq-brass-light) !important;
  font-family: var(--oq-font-serif);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--oq-brass) !important;
  color: var(--oq-bg) !important;
}

/* Secondary → ivory outline */
.btn-secondary {
  background: transparent !important;
  border-color: var(--oq-ivory) !important;
  color: var(--oq-ivory) !important;
  font-family: var(--oq-font-body);
}
.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--oq-ivory) !important;
  color: var(--oq-bg) !important;
}

/* Generic bare .btn — surface border, muted text */
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-outline-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark) {
  font-family: var(--oq-font-body);
  transition: border-color var(--oq-dur-fast) var(--oq-ease),
              color var(--oq-dur-fast) var(--oq-ease),
              background var(--oq-dur-fast) var(--oq-ease);
}

/* Btn-gold shorthand used by billing/account pages */
.btn-gold {
  background: var(--oq-brass);
  border: 1px solid var(--oq-brass-light);
  color: var(--oq-bg);
  font-family: var(--oq-font-serif);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 8px 20px;
  border-radius: var(--oq-radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--oq-dur-fast) var(--oq-ease);
  text-decoration: none;
}
.btn-gold:hover { background: var(--oq-brass-light); color: var(--oq-bg); text-decoration: none; }

/* ============================================================
   SECTION 6 — BOOTSTRAP OVERRIDES: TABLES
   ============================================================ */

/* BS .table → ivory-on-surface, brass hairlines */
.table {
  color: var(--oq-ivory) !important;
  border-color: var(--oq-border) !important;
}

.table-sm { font-size: 12px; }

.table thead th {
  font-family: var(--oq-font-serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oq-brass-light) !important;
  border-color: var(--oq-border) !important;
  background: transparent !important;
}

.table tbody td,
.table tbody th {
  border-color: var(--oq-border) !important;
  color: var(--oq-text) !important;
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--oq-surface-hover) !important;
}

/* ============================================================
   SECTION 7 — BOOTSTRAP OVERRIDES: FORMS
   ============================================================ */

.form-control,
.form-select {
  background: var(--oq-surface-deep) !important;
  border: 1px solid var(--oq-border) !important;
  border-radius: var(--oq-radius-md) !important;
  color: var(--oq-ivory) !important;
  font-family: var(--oq-font-body);
  transition: border-color var(--oq-dur-fast) var(--oq-ease),
              box-shadow var(--oq-dur-fast) var(--oq-ease);
}

.form-control:focus,
.form-select:focus {
  background: var(--oq-surface-deep) !important;
  border-color: var(--oq-brass) !important;
  box-shadow: 0 0 0 2px var(--oq-brass-faint) !important;
  color: var(--oq-ivory) !important;
  outline: none;
}

.form-control::placeholder { color: var(--oq-text-dim) !important; }

.form-label {
  font-family: var(--oq-font-serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oq-text-muted) !important;
}

.form-check-input {
  background-color: var(--oq-surface-deep) !important;
  border-color: var(--oq-border) !important;
}

.form-check-input:checked {
  background-color: var(--oq-brass) !important;
  border-color: var(--oq-brass) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 2px var(--oq-brass-faint) !important;
}

.form-check-label {
  color: var(--oq-text-muted);
  font-size: 13px;
}

/* Switch track */
.form-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(239,230,210,0.4)'/%3e%3c/svg%3e") !important;
}
.form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%230d1512'/%3e%3c/svg%3e") !important;
}

/* Input group */
.input-group-text {
  background: var(--oq-surface-accent) !important;
  border-color: var(--oq-border) !important;
  color: var(--oq-text-muted) !important;
}

/* ============================================================
   SECTION 8 — BOOTSTRAP OVERRIDES: ALERTS
   ============================================================ */

.alert {
  border-radius: var(--oq-radius-md);
  font-size: 13px;
}

.alert-success {
  background: rgba(127, 179, 137, 0.10) !important;
  border-color: rgba(127, 179, 137, 0.22) !important;
  color: var(--oq-gain) !important;
}

.alert-danger {
  background: rgba(201, 125, 111, 0.10) !important;
  border-color: rgba(201, 125, 111, 0.22) !important;
  color: var(--oq-loss) !important;
}

.alert-warning {
  background: rgba(212, 180, 131, 0.10) !important;
  border-color: rgba(212, 180, 131, 0.22) !important;
  color: var(--oq-warn) !important;
}

.alert-info {
  background: rgba(138, 180, 168, 0.10) !important;
  border-color: rgba(138, 180, 168, 0.22) !important;
  color: var(--oq-info) !important;
}

.alert-sm { padding: 8px 14px; font-size: 12px; }

/* ============================================================
   SECTION 9 — BOOTSTRAP OVERRIDES: BADGES
   ============================================================ */

/* Default badge → seal pill style */
.badge {
  font-family: var(--oq-font-serif);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--oq-radius-pill);
}

.badge.bg-primary,
.badge.bg-primary:not([class*="bg-"]) {
  background: transparent !important;
  border: 1px solid var(--oq-brass) !important;
  color: var(--oq-brass-light) !important;
}

.badge.bg-danger  { background: rgba(201, 125, 111, 0.15) !important; color: var(--oq-loss) !important; border: 1px solid rgba(201, 125, 111, 0.3) !important; }
.badge.bg-warning { background: rgba(212, 180, 131, 0.15) !important; color: var(--oq-warn) !important; border: 1px solid rgba(212, 180, 131, 0.3) !important; }
.badge.bg-success { background: rgba(127, 179, 137, 0.15) !important; color: var(--oq-gain) !important; border: 1px solid rgba(127, 179, 137, 0.3) !important; }
.badge.bg-info    { background: rgba(138, 180, 168, 0.15) !important; color: var(--oq-info) !important; border: 1px solid rgba(138, 180, 168, 0.3) !important; }
.badge.bg-secondary { background: var(--oq-surface-accent) !important; color: var(--oq-text-muted) !important; border: 1px solid var(--oq-border) !important; }

/* ============================================================
   SECTION 10 — BOOTSTRAP OVERRIDES: MODALS
   ============================================================ */

.modal-content {
  background: var(--oq-surface) !important;
  border: 1px solid var(--oq-border-strong) !important;
  border-radius: var(--oq-radius-lg) !important;
  color: var(--oq-text) !important;
}

.modal-header {
  border-bottom: 1px solid var(--oq-border) !important;
  background: var(--oq-surface-accent) !important;
}

.modal-title {
  font-family: var(--oq-font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oq-ivory) !important;
}

.modal-footer {
  border-top: 1px solid var(--oq-border) !important;
  background: var(--oq-surface-deep) !important;
}

.modal-backdrop { --bs-backdrop-bg: rgba(0,0,0,0.75); }

.btn-close {
  filter: invert(1) opacity(0.6);
}
.btn-close:hover { filter: invert(1) opacity(1); }

/* ============================================================
   SECTION 11 — BOOTSTRAP OVERRIDES: NAV LINKS & DROPDOWNS
   ============================================================ */

.nav-link {
  color: var(--oq-text-muted) !important;
  transition: color var(--oq-dur-fast) var(--oq-ease);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--oq-brass-light) !important;
}

.nav-link.active {
  color: var(--oq-brass) !important;
  font-weight: 600;
}

.dropdown-menu {
  background: var(--oq-surface) !important;
  border: 1px solid var(--oq-border-strong) !important;
  border-radius: var(--oq-radius-md) !important;
}

.dropdown-item {
  color: var(--oq-text-muted) !important;
  font-size: 13px;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--oq-surface-hover) !important;
  color: var(--oq-ivory) !important;
}

.dropdown-divider { border-color: var(--oq-border) !important; }

/* ============================================================
   SECTION 12 — DASHBOARD WIDGETS: KPI STAT TILES
   ============================================================ */

.kpi-card {
  background: var(--oq-surface);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-lg);
  padding: var(--oq-space-5);
  transition: transform var(--oq-dur-fast) var(--oq-ease),
              border-color var(--oq-dur-fast) var(--oq-ease);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--oq-brass-dark);
}

.kpi-card .kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--oq-space-3);
}

.kpi-card .kpi-label {
  font-family: var(--oq-font-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oq-text-muted);
}

.kpi-card .kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--oq-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--oq-ivory);
  margin-bottom: var(--oq-space-1);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi-card .kpi-sub {
  font-size: 12px;
  color: var(--oq-text-muted);
  display: flex;
  align-items: center;
  gap: var(--oq-space-1);
}

.kpi-card .kpi-sub .trend-up   { color: var(--oq-gain); }
.kpi-card .kpi-sub .trend-down { color: var(--oq-loss); }
.kpi-card .kpi-sub .trend-neutral { color: var(--oq-warn); }

/* KPI icon colour variants */
.kpi-icon.gold   { background: rgba(176, 141, 87, 0.14); color: var(--oq-brass); }
.kpi-icon.green  { background: rgba(127, 179, 137, 0.12); color: var(--oq-gain); }
.kpi-icon.blue   { background: rgba(138, 180, 168, 0.12); color: var(--oq-info); }
.kpi-icon.red    { background: rgba(201, 125, 111, 0.12); color: var(--oq-loss); }
.kpi-icon.purple { background: rgba(176, 141, 87, 0.12); color: var(--oq-brass); }
.kpi-icon.orange { background: rgba(212, 180, 131, 0.12); color: var(--oq-warn); }

/* ============================================================
   SECTION 13 — DASHBOARD WIDGETS: DASH CARD (PANEL)
   ============================================================ */

.dash-card {
  background: var(--oq-surface);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-lg);
  overflow: hidden;
}

.dash-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--oq-border);
}

.dash-card .card-head h6 {
  font-family: var(--oq-font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--oq-ivory);
  margin: 0;
}

.dash-card .card-body { padding: 20px; }

/* ============================================================
   SECTION 14 — DASHBOARD WIDGETS: SEASONAL BANNER
   ============================================================ */

.seasonal-banner {
  display: flex;
  align-items: center;
  gap: var(--oq-space-3);
  padding: 12px 18px;
  border-radius: var(--oq-radius-md);
  font-size: 13px;
  font-weight: 500;
}

.seasonal-banner.strong {
  background: rgba(127, 179, 137, 0.06);
  border: 1px solid rgba(127, 179, 137, 0.18);
  color: var(--oq-gain);
}

.seasonal-banner.weak {
  background: rgba(201, 125, 111, 0.06);
  border: 1px solid rgba(201, 125, 111, 0.18);
  color: var(--oq-loss);
}

.seasonal-banner.neutral {
  background: rgba(212, 180, 131, 0.06);
  border: 1px solid rgba(212, 180, 131, 0.18);
  color: var(--oq-warn);
}

.seasonal-banner i { font-size: 20px; flex-shrink: 0; }
.seasonal-banner .seasonal-text strong { color: var(--oq-ivory); }

/* ============================================================
   SECTION 15 — DASHBOARD WIDGETS: FILTER TABS & TAB BARS
   ============================================================ */

.filter-tabs {
  display: flex;
  gap: var(--oq-space-2);
  flex-wrap: wrap;
}

.filter-tabs .tab-btn {
  padding: 5px 14px;
  border-radius: var(--oq-radius-md);
  font-family: var(--oq-font-body);
  font-size: 12px;
  font-weight: 500;
  background: var(--oq-surface-deep);
  color: var(--oq-text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--oq-dur-fast) var(--oq-ease),
              color var(--oq-dur-fast) var(--oq-ease),
              border-color var(--oq-dur-fast) var(--oq-ease);
}

.filter-tabs .tab-btn:hover {
  color: var(--oq-ivory);
  border-color: var(--oq-border);
}

.filter-tabs .tab-btn.active {
  background: var(--oq-brass-faint);
  color: var(--oq-brass-light);
  border-color: var(--oq-brass-dark);
}

/* Rankings filter bar */
.rankings-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--oq-space-5);
  padding: 8px 20px;
  border-bottom: 1px solid var(--oq-border);
  background: var(--oq-surface-deep);
  flex-wrap: wrap;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: var(--oq-space-2);
}

.filter-group-label {
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-group-gold .filter-group-label { color: var(--oq-brass); }
.filter-group-silver .filter-group-label { color: #C0C0C0; }

.filter-group .tab-btn {
  padding: 3px 10px;
  font-size: 11px;
}

.filter-group-gold   .tab-btn.active { background: var(--oq-brass-faint); color: var(--oq-brass-light); border-color: var(--oq-brass-dark); }
.filter-group-silver .tab-btn.active { background: rgba(192,192,192,.12); color: #C0C0C0; border-color: rgba(192,192,192,.3); }

/* ============================================================
   SECTION 16 — DATA PAGES: RANKINGS TABLE
   ============================================================ */

.table-responsive-custom {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
}

.rankings-table thead th {
  font-family: var(--oq-font-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oq-brass-light);
  padding: 11px 10px;
  border-bottom: 1px solid var(--oq-border);
  white-space: nowrap;
  text-align: left;
}

.rankings-table tbody td {
  font-size: 13px;
  padding: 11px 10px;
  border-bottom: 1px solid rgba(239, 230, 210, 0.04);
  vertical-align: middle;
  color: var(--oq-text);
}

.rankings-table tbody tr {
  transition: background var(--oq-dur-fast) var(--oq-ease);
}

.rankings-table tbody tr:hover,
tr[style*="cursor: pointer"]:hover,
tr[style*="cursor:pointer"]:hover {
  background: var(--oq-surface-hover) !important;
}

/* Row-click highlight override */
tr[style*="cursor: pointer"]:hover .ticker-badge,
tr[style*="cursor:pointer"]:hover .ticker-badge {
  color: var(--oq-brass-light);
}

/* Rank number chips */
.rank-num {
  width: 26px;
  height: 26px;
  border-radius: var(--oq-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-num.top-3  { background: var(--oq-brass-faint); color: var(--oq-brass-light); }
.rank-num.top-10 { background: var(--oq-surface-accent); color: var(--oq-text-muted); }

/* Ticker + company cells */
.ticker-badge {
  font-weight: 700;
  color: var(--oq-ivory);
  font-size: 13px;
}

.exchange-tag {
  font-family: var(--oq-font-body);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--oq-radius-sm);
  background: var(--oq-surface-deep);
  color: var(--oq-text-muted);
  margin-left: 5px;
}

.company-name-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--oq-text-muted);
  font-size: 12px;
}

/* Composite score pill */
.score-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--oq-radius-md);
  font-size: 13px;
  font-weight: 600;
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.score-pill.high   { background: rgba(127, 179, 137, 0.12); color: var(--oq-gain); }
.score-pill.medium { background: rgba(212, 180, 131, 0.12); color: var(--oq-warn); }
.score-pill.low    { background: rgba(201, 125, 111, 0.12); color: var(--oq-loss); }

/* Star rating */
.rating-stars {
  color: var(--oq-brass);
  font-size: 12px;
  letter-spacing: 1px;
}

/* Mini score bars in table cells */
.mini-bar {
  display: inline-block;
  width: 48px;
  height: 4px;
  background: var(--oq-surface-deep);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 5px;
}

.mini-bar .mini-fill {
  height: 100%;
  border-radius: 2px;
}

/* ============================================================
   SECTION 17 — DATA PAGES: ALERT TIER BADGES
   ============================================================ */

.alert-tier-badge {
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--oq-radius-pill);
  display: inline-flex;
  align-items: center;
}

/* T1 = solid brass seal */
.alert-tier-badge.tier-1 {
  background: var(--oq-brass);
  color: var(--oq-bg);
  border: 1px solid var(--oq-brass);
}

/* T2 = outline brass */
.alert-tier-badge.tier-2 {
  background: transparent;
  color: var(--oq-brass-light);
  border: 1px solid var(--oq-brass);
}

/* T3 = outline brass-dark */
.alert-tier-badge.tier-3 {
  background: transparent;
  color: var(--oq-text-muted);
  border: 1px solid var(--oq-brass-dark);
}

/* None */
.alert-tier-badge.tier-none {
  background: var(--oq-surface-deep);
  color: var(--oq-text-dim);
  border: 1px solid var(--oq-border);
}

/* Inline tier pill in filings feed */
.tier-sm {
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 1px 6px;
  border-radius: var(--oq-radius-sm);
}

.tier-sm.t1 { background: var(--oq-brass); color: var(--oq-bg); }
.tier-sm.t2 { background: transparent; color: var(--oq-brass-light); border: 1px solid var(--oq-brass); }
.tier-sm.t3 { background: transparent; color: var(--oq-text-muted); border: 1px solid var(--oq-brass-dark); }

/* ============================================================
   SECTION 18 — DATA PAGES: FILINGS FEED
   ============================================================ */

.filing-item {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--oq-border);
}

.filing-item:last-child { border-bottom: none; }

.filing-type-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--oq-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.filing-type-icon.drill       { background: rgba(127, 179, 137, 0.12); color: var(--oq-gain); }
.filing-type-icon.resource    { background: rgba(138, 180, 168, 0.12); color: var(--oq-info); }
.filing-type-icon.financing   { background: rgba(212, 180, 131, 0.12); color: var(--oq-warn); }
.filing-type-icon.acquisition { background: rgba(201, 125, 111, 0.12); color: var(--oq-loss); }
.filing-type-icon.production  { background: rgba(176, 141, 87, 0.12); color: var(--oq-brass); }
.filing-type-icon.permitting  { background: rgba(138, 180, 168, 0.12); color: var(--oq-info); }
.filing-type-icon.management  { background: rgba(176, 141, 87, 0.12); color: var(--oq-brass); }
.filing-type-icon.financial   { background: rgba(127, 179, 137, 0.10); color: var(--oq-gain); }

.filing-content { flex: 1; min-width: 0; }

.filing-content .filing-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--oq-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filing-content .filing-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
}

.filing-content .filing-meta .ticker-sm { font-weight: 700; color: var(--oq-brass-light); }
.filing-content .filing-meta .date-sm   { color: var(--oq-text-muted); }

/* ============================================================
   SECTION 19 — DATA PAGES: GEX PANELS
   ============================================================ */

.gex-card {
  background: var(--oq-surface-deep);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  padding: var(--oq-space-4);
  margin-bottom: var(--oq-space-3);
}

.gex-card:last-child { margin-bottom: 0; }

.gex-card .gex-ticker {
  font-family: var(--oq-font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oq-ivory);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: var(--oq-space-2);
}

.gex-card .gex-ticker .gex-signal-tag {
  font-family: var(--oq-font-body);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--oq-radius-pill);
}

/* GEX tab sections */
.gex-tab-content { display: none; }
.gex-tab-content.active { display: block; }

.gex-levels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--oq-space-2);
}

.gex-level-item { text-align: center; }

.gex-level-item .level-label {
  font-family: var(--oq-font-serif);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oq-text-muted);
  margin-bottom: 2px;
}

.gex-level-item .level-value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gex-level-item .level-value.put  { color: var(--oq-loss); }
.gex-level-item .level-value.flip { color: var(--oq-warn); }
.gex-level-item .level-value.call { color: var(--oq-gain); }

/* ============================================================
   SECTION 20 — DATA PAGES: SIGNAL LAYERS PANEL
   ============================================================ */

.signal-layer-row {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--oq-border);
  gap: var(--oq-space-3);
}

.signal-layer-row:last-child { border-bottom: none; }

.signal-layer-row .layer-num {
  width: 26px;
  height: 26px;
  border-radius: var(--oq-radius-sm);
  background: var(--oq-surface-deep);
  border: 1px solid var(--oq-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--oq-font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--oq-brass);
  flex-shrink: 0;
}

.signal-layer-row .layer-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--oq-text);
}

.signal-layer-row .layer-score {
  font-family: var(--oq-font-mono);
  font-size: 13px;
  font-weight: 600;
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.signal-layer-row .layer-bar {
  width: 110px;
  height: 5px;
  background: var(--oq-surface-deep);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.signal-layer-row .layer-bar .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--oq-ease);
}

/* ============================================================
   SECTION 21 — DATA PAGES: REGIME GAUGE
   ============================================================ */

.regime-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 10px;
}

.regime-gauge-value {
  font-family: var(--oq-font-display);
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.regime-gauge-value.bullish { color: var(--oq-gain); }
.regime-gauge-value.neutral { color: var(--oq-warn); }
.regime-gauge-value.bearish { color: var(--oq-loss); }

.regime-label {
  font-family: var(--oq-font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: var(--oq-radius-pill);
  margin-bottom: 16px;
}

.regime-label.bullish { background: rgba(127, 179, 137, 0.12); color: var(--oq-gain); }
.regime-label.neutral { background: rgba(212, 180, 131, 0.12); color: var(--oq-warn); }
.regime-label.bearish { background: rgba(201, 125, 111, 0.12); color: var(--oq-loss); }

/* Sub-signal grid */
.regime-sub-signals {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--oq-space-3);
  margin-top: var(--oq-space-2);
}

.sub-signal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--oq-surface-deep);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  font-size: 13px;
}

.sub-signal-item .label { color: var(--oq-text-muted); }
.sub-signal-item .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.sub-signal-item .value.positive    { color: var(--oq-gain); }
.sub-signal-item .value.negative    { color: var(--oq-loss); }
.sub-signal-item .value.neutral-val { color: var(--oq-warn); }

/* Regime current-value callout */
.regime-current-callout {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 12px;
  border-radius: var(--oq-radius-md);
  font-family: var(--oq-font-mono);
  font-size: 12px;
  font-weight: 700;
  z-index: 10;
  pointer-events: none;
}
.regime-current-callout.bullish { background: rgba(127,179,137,.12); color: var(--oq-gain); border: 1px solid rgba(127,179,137,.25); }
.regime-current-callout.neutral { background: rgba(212,180,131,.12); color: var(--oq-warn); border: 1px solid rgba(212,180,131,.25); }
.regime-current-callout.bearish { background: rgba(201,125,111,.12); color: var(--oq-loss); border: 1px solid rgba(201,125,111,.25); }

/* Range button row on regime chart */
.regime-range-btn {
  font-family: var(--oq-font-body);
  font-size: 11px;
  font-weight: 500;
  transition: border-color var(--oq-dur-fast), color var(--oq-dur-fast);
}
.regime-range-btn:hover { border-color: var(--oq-brass) !important; color: var(--oq-brass) !important; }
.regime-range-btn.active { border-color: var(--oq-brass) !important; background: var(--oq-brass-faint) !important; color: var(--oq-brass-light) !important; }

/* ============================================================
   SECTION 22 — DATA PAGES: COMPANY COMPARISON TOOL
   ============================================================ */

.compare-search-bar {
  display: flex;
  gap: var(--oq-space-3);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--oq-space-5);
}

.compare-search-bar .compare-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.compare-search-bar label {
  display: block;
  font-family: var(--oq-font-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oq-text-muted);
  margin-bottom: 4px;
}

.compare-search-bar input {
  width: 100%;
  padding: 10px 14px;
  background: var(--oq-surface-deep);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  color: var(--oq-ivory);
  font-size: 14px;
  font-family: var(--oq-font-body);
  transition: border-color var(--oq-dur-fast) var(--oq-ease);
}

.compare-search-bar input:focus {
  outline: none;
  border-color: var(--oq-brass);
  box-shadow: 0 0 0 2px var(--oq-brass-faint);
}

.compare-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--oq-surface);
  border: 1px solid var(--oq-border-strong);
  border-radius: 0 0 var(--oq-radius-md) var(--oq-radius-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
}

.compare-autocomplete.show { display: block; }

.compare-autocomplete .ac-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--oq-dur-fast);
}

.compare-autocomplete .ac-item:hover,
.compare-autocomplete .ac-item.active { background: var(--oq-surface-hover); }

.compare-autocomplete .ac-item .ac-ticker { font-weight: 700; color: var(--oq-brass-light); margin-right: 8px; }
.compare-autocomplete .ac-item .ac-name   { color: var(--oq-text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-autocomplete .ac-item .ac-exchange { font-size: 10px; padding: 1px 6px; background: var(--oq-surface-deep); border-radius: var(--oq-radius-sm); color: var(--oq-text-muted); flex-shrink: 0; }

#compare-btn {
  padding: 10px 28px;
  background: var(--oq-brass);
  color: var(--oq-bg);
  border: 1px solid var(--oq-brass-light);
  border-radius: var(--oq-radius-md);
  font-family: var(--oq-font-serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity var(--oq-dur-fast);
  white-space: nowrap;
}
#compare-btn:hover    { opacity: 0.85; }
#compare-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.compare-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-lg);
  overflow: hidden;
  background: var(--oq-surface);
}
.compare-grid.cols-2 { grid-template-columns: 180px 1fr 1fr; }
.compare-grid.cols-3 { grid-template-columns: 180px 1fr 1fr 1fr; }

.compare-header {
  padding: 16px;
  text-align: center;
  border-bottom: 2px solid var(--oq-border);
}
.compare-header.label-col {
  background: var(--oq-surface-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oq-text-muted);
}
.compare-header .ch-ticker { font-family: var(--oq-font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.06em; color: var(--oq-ivory); }
.compare-header .ch-name   { font-size: 12px; color: var(--oq-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-header .ch-meta   { margin-top: 6px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.compare-header .ch-meta .exchange-tag,
.compare-header .ch-meta .cat-tag {
  font-size: 10px; padding: 2px 8px; border-radius: var(--oq-radius-sm);
  background: var(--oq-surface-deep); color: var(--oq-text-muted);
}

.compare-section {
  grid-column: 1 / -1;
  padding: 7px 16px;
  background: var(--oq-surface-deep);
  border-top: 1px solid var(--oq-border);
  border-bottom: 1px solid var(--oq-border);
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oq-brass-light);
}

.compare-row    { display: contents; }
.compare-cell   { padding: 10px 16px; border-bottom: 1px solid var(--oq-border); font-size: 13px; display: flex; align-items: center; }
.compare-cell.label-cell  { background: var(--oq-surface-deep); color: var(--oq-text-muted); font-weight: 500; font-size: 12px; }
.compare-cell.value-cell  { justify-content: center; text-align: center; }
.compare-cell.compare-winner { background: var(--oq-brass-faint); box-shadow: inset 0 0 0 1px rgba(176,141,87,.25); }

.compare-score-bar { width: 100%; max-width: 120px; margin: 0 auto; }
.compare-score-bar .csb-track  { height: 5px; background: var(--oq-surface-deep); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.compare-score-bar .csb-fill   { height: 100%; border-radius: 3px; transition: width 0.4s var(--oq-ease); }
.compare-score-bar .csb-label  { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.compare-score-bar .csb-fill.high   { background: var(--oq-gain); }
.compare-score-bar .csb-fill.medium { background: var(--oq-warn); }
.compare-score-bar .csb-fill.low    { background: var(--oq-loss); }

.compare-value              { font-weight: 500; }
.compare-value.score-high   { color: var(--oq-gain); }
.compare-value.score-medium { color: var(--oq-warn); }
.compare-value.score-low    { color: var(--oq-loss); }
.compare-value.na           { color: var(--oq-text-muted); font-style: italic; }

#compare-radar-chart {
  margin-top: var(--oq-space-6);
  background: var(--oq-surface);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-lg);
  padding: var(--oq-space-5);
}
#compare-radar-chart .section-title { font-family: var(--oq-font-serif); font-size: 13px; font-weight: 600; color: var(--oq-ivory); margin-bottom: 16px; }

.compare-empty { text-align: center; padding: 60px 20px; color: var(--oq-text-muted); }
.compare-empty i { font-size: 48px; margin-bottom: 16px; display: block; color: var(--oq-border); }
.compare-empty p { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* ============================================================
   SECTION 23 — DATA PAGES: CYCLE STATE
   ============================================================ */

.cycle-tabs { display: flex; gap: var(--oq-space-2); flex-wrap: wrap; margin-bottom: 16px; }
.cycle-tab  {
  padding: 6px 14px;
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  cursor: pointer;
  background: none;
  color: var(--oq-text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--oq-dur-fast), color var(--oq-dur-fast), background var(--oq-dur-fast);
}
.cycle-tab.active { background: var(--oq-brass-faint); border-color: var(--oq-brass); color: var(--oq-brass-light); }
.cycle-tab:hover:not(.active) { border-color: var(--oq-border-strong); color: var(--oq-ivory); }

.cycle-panel        { display: none; }
.cycle-panel.active { display: block; }

.cycle-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--oq-space-3); margin-bottom: 16px; }
.cycle-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--oq-space-3); margin-bottom: 16px; }
.cycle-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--oq-space-4); margin-bottom: 20px; }

.cycle-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.cycle-kpi-row .cycle-kpi { padding: 16px 18px; }

/* Chart boxes */
.cycle-chart-box { position: relative; height: 320px; }
.cycle-chart-sm  { position: relative; height: 200px; }

.cycle-reading {
  padding: 12px 14px;
  background: var(--oq-brass-faint);
  border-left: 2px solid var(--oq-brass);
  border-radius: 0 var(--oq-radius-md) var(--oq-radius-md) 0;
  font-size: 13px;
  color: var(--oq-text-muted);
  line-height: 1.7;
  margin-top: 12px;
}
.cycle-reading strong { color: var(--oq-brass-light); }

/* Recommendations panel */
.rec-zone-badge {
  border: 2px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--oq-space-2);
}
.rec-zone-label { font-family: var(--oq-font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.rec-zone-score { font-size: 13px; color: var(--oq-text-muted); }
.rec-zone-score strong { font-size: 15px; }

.rec-section       { margin-top: 16px; }
.rec-section-title {
  font-family: var(--oq-font-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oq-brass);
  margin-bottom: 10px;
}
.rec-section-title i { margin-right: 5px; }

.rec-alloc-row {
  display: grid;
  grid-template-columns: 1fr 120px 48px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--oq-border);
}
.rec-alloc-row:last-child { border-bottom: none; }
.rec-alloc-label { font-size: 13px; color: var(--oq-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-alloc-bar-wrap { background: var(--oq-surface-deep); border-radius: var(--oq-radius-sm); height: 7px; overflow: hidden; }
.rec-alloc-bar { height: 100%; border-radius: var(--oq-radius-sm); transition: width 0.6s var(--oq-ease); }
.rec-alloc-pct { font-family: var(--oq-font-mono); font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.rec-list { list-style: none; padding: 0; margin: 0; }
.rec-list li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 13px;
  color: var(--oq-text);
  line-height: 1.6;
}
.rec-list li::before { content: "\2022"; position: absolute; left: 4px; color: var(--oq-brass); font-weight: bold; }
.rec-list-warn li::before { color: var(--oq-warn); }

.rec-section-warn { background: rgba(212,180,131,.06); border-radius: var(--oq-radius-md); padding: 12px 14px; }
.rec-avoid, .rec-rotation { font-size: 13px; color: var(--oq-text); padding: 8px 12px; background: var(--oq-surface-deep); border-radius: var(--oq-radius-md); line-height: 1.6; }
.rec-avoid i, .rec-rotation i { margin-right: 4px; }
.rec-avoid strong    { color: var(--oq-loss); }
.rec-rotation strong { color: var(--oq-brass-light); }

.rec-hist-section { margin-top: 6px; padding: 10px 14px; background: var(--oq-surface-deep); border-radius: var(--oq-radius-md); border: 1px solid var(--oq-border); }
.rec-hist-note    { font-size: 11px; color: var(--oq-text-dim); font-style: italic; margin-bottom: 8px; line-height: 1.4; }
.rec-hist-table   { width: 100%; border-collapse: collapse; }
.rec-hist-table td { padding: 3px 0; font-size: 12px; color: var(--oq-text-muted); border-bottom: 1px solid var(--oq-border); vertical-align: baseline; }
.rec-hist-table tr:last-child td { border-bottom: none; }
.rec-hist-tier    { white-space: nowrap; padding-right: 12px !important; color: var(--oq-text-muted); font-weight: 500; }
.rec-hist-range   { text-align: right; font-family: var(--oq-font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.rec-hist-tag     { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--oq-text-dim); font-style: italic; }

.rec-disclaimer { margin-top: 18px; padding: 10px 14px; background: var(--oq-surface-deep); border: 1px solid var(--oq-border); border-radius: var(--oq-radius-md); font-size: 11px; color: var(--oq-text-muted); line-height: 1.5; font-style: italic; }
.rec-disclaimer i { margin-right: 4px; color: var(--oq-warn); }

/* Cycle misc */
.cycle-mc         { background: var(--oq-surface-deep); border-radius: var(--oq-radius-md); padding: 12px 14px; }
.cycle-mc .lbl    { font-family: var(--oq-font-serif); font-size: 10px; color: var(--oq-text-muted); text-transform: uppercase; letter-spacing: 0.14em; }
.cycle-mc .val    { font-size: 22px; font-weight: 500; line-height: 1.2; margin-top: 3px; }
.cycle-loading    { text-align: center; padding: 60px; color: var(--oq-text-muted); }
.cycle-error      { text-align: center; padding: 60px; color: var(--oq-loss); }

/* Cycle bar viz */
.cycle-bar-row        { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--oq-border); }
.cycle-bar-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.cycle-bar-header     { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; gap: var(--oq-space-2); }
.cycle-bar-name       { font-size: 14px; font-weight: 600; color: var(--oq-text); }
.cycle-bar-name .cycle-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cycle-bar-pct        { font-family: var(--oq-font-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cycle-bar-phase      { font-family: var(--oq-font-serif); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 10px; border-radius: var(--oq-radius-pill); display: inline-block; }
.cycle-bar-track      { position: relative; height: 28px; background: var(--oq-surface-deep); border-radius: var(--oq-radius-md); overflow: visible; margin-bottom: 6px; }
.cycle-bar-segment    { position: absolute; top: 0; height: 100%; opacity: 0.3; }
.cycle-bar-segment:first-child { border-radius: var(--oq-radius-md) 0 0 var(--oq-radius-md); }
.cycle-bar-segment:last-child  { border-radius: 0 var(--oq-radius-md) var(--oq-radius-md) 0; }
.cycle-bar-fill       { position: absolute; top: 0; left: 0; height: 100%; border-radius: var(--oq-radius-md) 0 0 var(--oq-radius-md); background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.16)); z-index: 1; }
.cycle-bar-now        { position: absolute; top: -4px; width: 3px; height: 36px; background: var(--oq-ivory); border-radius: 2px; z-index: 3; transform: translateX(-1px); }
.cycle-bar-now::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--oq-ivory); }
.cycle-bar-peak       { position: absolute; top: 0; width: 2px; height: 28px; background: var(--oq-brass); z-index: 2; opacity: 0.8; }
.cycle-bar-peak::before { content: 'PEAK'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-family: var(--oq-font-serif); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: var(--oq-brass); white-space: nowrap; }
.cycle-bar-phases     { display: flex; font-size: 10px; color: var(--oq-text-dim); margin-bottom: 6px; }
.cycle-bar-phases span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.cycle-bar-detail     { display: flex; gap: 16px; font-size: 11px; color: var(--oq-text-muted); flex-wrap: wrap; }
.cycle-bar-detail strong { color: var(--oq-text); }

/* Composite display */
.cycle-composite-display { text-align: center; padding: 20px; }
.cycle-composite-score   { font-family: var(--oq-font-display); font-size: 64px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cycle-composite-label   { font-family: var(--oq-font-body); font-size: 14px; color: var(--oq-text-muted); margin-top: 4px; }
.cycle-composite-phase   { font-family: var(--oq-font-serif); font-size: 18px; font-weight: 600; margin-top: 8px; }

/* Convergence */
.cycle-convergence-wrap { position: relative; height: 360px; margin-bottom: 8px; }
.cycle-zone-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--oq-text-muted); padding: 8px 0; }
.cycle-zone-legend span { display: inline-flex; align-items: center; gap: 4px; }
.cycle-zone-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; }
.cycle-convergence-info { font-size: 12px; color: var(--oq-text-muted); padding: 8px 0; display: flex; gap: 20px; flex-wrap: wrap; }
.cycle-convergence-info .convergence-stat  { display: inline-flex; align-items: center; gap: 6px; }
.cycle-convergence-info .convergence-count { font-family: var(--oq-font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================
   SECTION 24 — ALERT SYSTEM BANNERS
   ============================================================ */

.alert-banner-critical {
  background: rgba(201, 125, 111, 0.14);
  border: 1px solid var(--oq-loss);
  color: var(--oq-loss);
  padding: 12px 20px;
  border-radius: var(--oq-radius-md);
  margin-bottom: var(--oq-space-3);
  font-size: 13px;
}

.alert-banner-warning {
  background: rgba(212, 180, 131, 0.12);
  border: 1px solid var(--oq-warn);
  color: var(--oq-warn);
  padding: 12px 20px;
  border-radius: var(--oq-radius-md);
  margin-bottom: var(--oq-space-3);
  font-size: 13px;
}

.alert-banner-info {
  background: rgba(138, 180, 168, 0.12);
  border: 1px solid var(--oq-info);
  color: var(--oq-info);
  padding: 12px 20px;
  border-radius: var(--oq-radius-md);
  margin-bottom: var(--oq-space-3);
  font-size: 13px;
}

.alert-banner-critical strong,
.alert-banner-warning strong,
.alert-banner-info strong { font-weight: 700; }

/* Alert log */
#alert-log-toggle { display: none; transition: opacity var(--oq-dur-fast); }
#alert-log-toggle:hover { opacity: 0.8; }
#alert-notification-log {
  background: var(--oq-surface);
  border: 1px solid var(--oq-border);
  border-radius: var(--oq-radius-md);
  padding: var(--oq-space-4);
}

/* ============================================================
   SECTION 25 — COMPANY DETAIL PAGE ELEMENTS
   ============================================================ */

/* Company detail header card pieces */
#cd-header-card .exchange-tag { font-size: 10px; }

/* Score tiles in company detail header */
.score-tile-label {
  font-family: var(--oq-font-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oq-text-muted);
}

/* Insider activity table wrapper */
#cd-insiders-body { font-size: 13px; color: var(--oq-text); }

/* Silver badge row */
#cd-silver-badges .badge { margin-right: 4px; }

/* Placeholder chart (COT page) */
.placeholder-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--oq-text-muted);
  font-size: 13px;
  font-style: italic;
  border: 1px dashed var(--oq-border);
  border-radius: var(--oq-radius-md);
}

/* COT 5-column layout */
.col-5ths { flex: 0 0 20%; max-width: 20%; }

/* COT tab content toggle */
.cot-tab-content        { display: none; }
.cot-tab-content.active { display: block; }

/* Insider coverage grid */
#insider-coverage-grid .dash-card { min-height: 80px; }

/* ============================================================
   SECTION 26 — TOOLTIP SYSTEM
   ============================================================ */

.nrl-tip  { display: inline-flex; align-items: center; cursor: help; }
.nrl-tip .nrl-q { font-size: 13px; color: var(--oq-text-muted); margin-left: 5px; opacity: 0.55; transition: opacity var(--oq-dur-fast); }
.nrl-tip:hover .nrl-q { opacity: 1; color: var(--oq-brass); }
.nrl-tip .nrl-pop { display: none !important; }

#oq-tooltip {
  position: fixed;
  background: var(--oq-surface);
  color: var(--oq-text);
  border: 1px solid var(--oq-border-strong);
  border-radius: var(--oq-radius-md);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  white-space: normal;
  width: 280px;
  max-width: calc(100vw - 24px);
  z-index: 999999;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 0;
  display: none;
  transition: opacity var(--oq-dur-fast);
}

/* ============================================================
   SECTION 27 — UTILITIES
   ============================================================ */

/* Semantic color helpers */
.text-gold   { color: var(--oq-brass) !important; }
.text-green  { color: var(--oq-gain) !important; }
.text-red    { color: var(--oq-loss) !important; }
.text-orange { color: var(--oq-warn) !important; }
.text-muted-custom { color: var(--oq-text-muted) !important; }

/* Gain / loss (also defined in deco.css but repeated for in-member usage) */
.oq-gain { color: var(--oq-gain); }
.oq-loss { color: var(--oq-loss); }

/* Scrollbar */
::-webkit-scrollbar         { width: 8px; height: 8px; }
::-webkit-scrollbar-track   { background: var(--oq-bg); }
::-webkit-scrollbar-thumb   { background: var(--oq-brass-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--oq-brass); }

/* ============================================================
   SECTION 28 — RESPONSIVE BREAKPOINTS
   ============================================================ */

@media (max-width: 1200px) {
  .rankings-table .hide-lg { display: none; }
  .col-5ths { flex: 0 0 50%; max-width: 50%; }
  .cycle-kpi-row  { grid-template-columns: repeat(3, 1fr); }
  .cycle-grid4    { grid-template-columns: repeat(2, 1fr); }
  .cycle-grid2    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
  }
  .sidebar-overlay.active { display: block; }

  .cycle-grid3 { grid-template-columns: repeat(2, 1fr); }
  .compare-grid.cols-3 { overflow-x: auto; }
}

@media (max-width: 768px) {
  .page-content { padding: var(--oq-space-4) 16px; }
  .top-header   { padding: 0 16px; }
  .top-header .header-left { gap: var(--oq-space-2); }
  .top-header .header-right { gap: var(--oq-space-2); }
  .top-header .header-left h5 { font-size: 13px; }

  .header-gsr-widget {
    font-size: 10px !important;
    padding: 3px 6px !important;
    margin-right: 4px !important;
    white-space: nowrap;
  }

  .freshness-badge { font-size: 10px; }
  .kpi-card .kpi-value { font-size: 22px; }

  .regime-sub-signals { grid-template-columns: 1fr; }
  .gex-levels { grid-template-columns: 1fr; gap: 6px; }

  .compare-search-bar { flex-direction: column; }
  .compare-grid.cols-2,
  .compare-grid.cols-3 { grid-template-columns: 120px 1fr 1fr; }
  .compare-cell { padding: 8px 10px; font-size: 12px; }
  .compare-header .ch-ticker { font-size: 13px; }

  .cycle-kpi-row  { grid-template-columns: repeat(2, 1fr); }
  .cycle-convergence-wrap { height: 280px; }
  .rec-zone-badge { flex-direction: column; align-items: flex-start; }
  .rec-alloc-row  { grid-template-columns: 1fr 80px 40px; }
}

@media (max-width: 576px) {
  .cycle-grid4, .cycle-grid3, .cycle-grid2 { grid-template-columns: 1fr; }
  .rec-hist-tier  { font-size: 11px; }
  .rec-hist-range { font-size: 10px; }
  .rec-alloc-label { font-size: 12px; }
}

@media (max-width: 480px) {
  .top-header .header-left h5 { display: none; }
  .top-header .header-right { gap: var(--oq-space-2); }
  .header-gsr-widget .ri-scales-3-line { display: none !important; }
  .header-gsr-widget .gsr-label        { display: none !important; }
  .freshness-badge { display: none; }
  .cycle-kpi-row { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION — MEMBER-AREA DECO FOOTER
   ============================================================ */
.oq-site-footer {
  border-top: 1px solid var(--oq-border);
  padding: var(--oq-space-6) var(--oq-space-5);
  margin-top: var(--oq-space-6);
}

.oq-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--oq-space-3);
  text-align: center;
}

.oq-footer-monogram img {
  opacity: 0.55;
  filter: brightness(1.1);
}

.oq-footer-divider {
  width: 180px;
  margin: 0 auto;
}

.oq-footer-wordmark {
  font-family: var(--oq-font-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oq-brass-light);
  margin: 0;
}

.oq-site-footer .oq-footer-links {
  display: flex;
  align-items: center;
  gap: var(--oq-space-2);
  font-size: 12px;
  color: var(--oq-text-muted);
}

.oq-site-footer .oq-footer-links a {
  color: var(--oq-text-muted);
  text-decoration: none;
  transition: color var(--oq-dur) var(--oq-ease);
}

.oq-site-footer .oq-footer-links a:hover { color: var(--oq-brass); }

.oq-footer-version {
  color: var(--oq-text-muted);
  font-size: 11px;
}

.oq-footer-note {
  font-size: 11px;
  color: var(--oq-text-muted);
  margin: 0;
  opacity: 0.7;
}

/* ---------- MEMBER DASHBOARD: QUICK LINK ROWS ---------- */
.oq-quicklink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  font-family: var(--oq-font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--oq-text-muted) !important;
  text-decoration: none !important;
  border: 1px solid transparent;
  border-radius: var(--oq-radius-sm);
  transition: color var(--oq-dur-fast) var(--oq-ease),
              border-color var(--oq-dur-fast) var(--oq-ease),
              background var(--oq-dur-fast) var(--oq-ease);
}
.oq-quicklink:hover,
.oq-quicklink:focus {
  color: var(--oq-brass-light) !important;
  border-color: var(--oq-border);
  background: var(--oq-brass-faint);
  text-decoration: none !important;
}
.oq-quicklink i {
  color: var(--oq-brass);
  font-size: 14px;
  flex-shrink: 0;
}
.oq-quicklink:last-child { margin-bottom: 0; }
