@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:            #F8FAFC;
  --white:         #FFFFFF;
  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
  --border:        #E2E8F0;
  
  --primary:       #4F46E5;
  --primary-light: #EEF2F6;
  --primary-hover: #4338CA;
  
  --green:         #059669;
  --green-bg:      #F0FDF4;
  --green-border:  #DCFCE7;
  
  --amber:         #D97706;
  --amber-bg:      #FFFBEB;
  --amber-border:  #FEF3C7;
  
  --red:           #DC2626;
  --red-bg:        #FEF2F2;
  --red-border:    #FEE2E2;

  --shadow-sm:     0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg:     0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     18px;
}

/* ── Base Styles ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
  overflow: hidden;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ── Custom Scrollbar ── */
.scroll-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.scroll-thin::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 999px;
}
.scroll-thin::-webkit-scrollbar-thumb:hover {
  background: #CBD5E1;
}
.scroll-thin::-webkit-scrollbar-track {
  background: transparent;
}

/* ── App Layout structure ── */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Navigation Topbar ── */
.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.logo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5px;
  width: 24px;
  height: 24px;
}
.logo-dot {
  background: #10B981;
  border-radius: 4px;
  transition: transform 0.2s ease;
}
.logo-dot:last-child {
  background: #34D399;
}
.logo:hover .logo-dot {
  transform: scale(1.1);
}
.logo-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.tab-bar {
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.tab-btn {
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tab-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.4);
}

.tbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.tbadge-red {
  background: var(--red);
  color: #FFFFFF;
}
.tbadge-green {
  background: var(--green);
  color: #FFFFFF;
}
.company-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 5px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
}
.company-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.company-details {
  display: flex;
  flex-direction: column;
}
.company-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.company-role {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ── Columns & Containers ── */
.left-col {
  position: relative;
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width 0.2s ease;
}
.left-col.collapsed {
  width: 40px;
  overflow: hidden;
}
.left-col.collapsed .sidebar-header {
  padding: 10px 0;
  justify-content: center;
  min-width: 40px;
}
.left-col.collapsed .sidebar-header-title { display: none; }
.left-col.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.left-col-inner {
  min-width: 240px;
}
.left-col.collapsed .left-col-inner {
  display: none;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  min-width: 240px;
}
.sidebar-header-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: #EEF2FF;
  color: var(--primary);
}
.sidebar-collapse-btn svg {
  transition: transform 0.2s ease;
}

.center-col {
  flex: 1;
  min-width: 320px;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.right-col {
  width: 360px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--border);
  transition: background 0.15s;
  position: relative;
  z-index: 2;
}
.resize-handle:hover,
.resize-handle.dragging {
  background: var(--primary);
}

.right-col-wide {
  width: 520px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
}
.right-col-wide.panel-transitioning {
  transition: width 0.2s ease;
}

/* ── Briefing Pin ── */
#briefing-pin { flex-shrink: 0; }
.briefing-pin-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 6px 20px;
  background: #F0F4FF;
  border-bottom: 1px solid #D6E0FF;
  cursor: pointer;
}
.briefing-pin-bar:hover { background: #E6EDFF; }
.briefing-pin-accent {
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.briefing-pin-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.briefing-pin-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}
.briefing-pin-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
/* ── Chat Column Styles ── */
.chat-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}
.agent-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.agent-avatar svg {
  width: 22px;
  height: 22px;
}
.agent-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.agent-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  position: relative;
}
.status-dot::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  border: 2px solid #10B981;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
.status-text {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.msg-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 10px 0;
}
.msg-date::before, .msg-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.msg-ai {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  animation: msgFade 0.3s ease-out;
}
@keyframes msgFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.msg-meta strong {
  font-weight: 600;
  color: var(--text-secondary);
}
.msg-bubble {
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 18px 22px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 700px;
}
.msg-bubble--briefing {
  border-color: #3B82F6;
}
.msg-bubble p {
  margin-bottom: 10px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}
.msg-bubble ul {
  margin: 10px 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: disc;
}
.msg-bubble li {
  font-size: 14px;
  line-height: 1.6;
}
.msg-bubble li[onclick] {
  transition: color 0.15s;
}
.msg-bubble li[onclick]:hover {
  color: var(--primary);
  text-decoration: underline;
}

.msg-bubble-banner {
  background: #ECFDF5;
  border-left: 3.5px solid #10B981;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #047857;
  margin-bottom: 12px;
  line-height: 1.4;
}

.msg-user {
  display: flex;
  justify-content: flex-end;
  animation: msgFade 0.3s ease-out;
}
.msg-user .msg-bubble {
  background: var(--primary);
  border: none;
  border-radius: var(--radius) var(--radius) 3px var(--radius);
  color: #FFFFFF;
  padding: 12px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

/* Chat text formats */
.hl-red { color: var(--red); font-weight: 600; }
.hl-amber { color: var(--amber); font-weight: 600; }
.hl-green { color: var(--green); font-weight: 600; }
.hl-blue { color: var(--primary); font-weight: 600; }
.hl-bold { color: var(--text-primary); font-weight: 700; }

/* Module block rows (daily briefing format) */
.module-blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}
.module-block-row {
  padding: 12px 14px 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.module-block-row--revenue  { border-left-color: #0891B2; }
.module-block-row--inventory{ border-left-color: #7C3AED; }
.module-block-row--margin   { border-left-color: #1D4ED8; }
.module-block-row--action   { border-left-color: #059669; background: var(--green-bg); border-color: var(--green-border); border-left-color: #059669; }

.module-block-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.module-block-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.module-block-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}
.mlbl-revenue   { color: #0E7490; background: #CFFAFE; }
.mlbl-inventory { color: #6D28D9; background: #EDE9FE; }
.mlbl-margin    { color: #1D4ED8; background: #DBEAFE; }
.mlbl-action    { color: #047857; background: #D1FAE5; }

/* Inline module tags inside bullet text */
.module-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: middle;
  line-height: 1.8;
}
.module-tag--revenue   { background: #CFFAFE; color: #0E7490; }
.module-tag--inventory { background: #EDE9FE; color: #6D28D9; }
.module-tag--margin    { background: #DBEAFE; color: #1D4ED8; }

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.chip-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.chip-btn svg {
  color: var(--text-muted);
}
.chip-btn:hover svg {
  color: var(--primary);
}

.chat-input-wrap {
  border-top: 1px solid var(--border);
  padding: 16px 28px;
  background: var(--white);
  flex-shrink: 0;
}
.chat-input-inner {
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}
.chat-input-inner:focus-within {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.chat-input-inner input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-primary);
}
.chat-input-inner input::placeholder {
  color: var(--text-muted);
}
.chat-input-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
}
.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Pinned & Detail Panels ── */
.panel-section {
  padding: 20px;
}
.panel-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.panel-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-card + .panel-card {
  margin-top: 12px;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.insight-card:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}
.insight-card + .insight-card {
  margin-top: 10px;
}
.insight-card.red {
  background: var(--red-bg);
  border-color: var(--red);
}
.insight-card.amber {
  background: var(--amber-bg);
  border-color: var(--amber);
}
.insight-card.green {
  background: var(--green-bg);
  border-color: var(--green);
}
.insight-card.blue {
  background: #F0F5FF;
  border-color: #3B82F6;
}
.insight-number {
  font-size: 22px;
  font-weight: 800;
  min-width: 68px;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  line-height: 1.1;
  white-space: nowrap;
}
.insight-card.red .insight-number { color: var(--red); }
.insight-card.amber .insight-number { color: var(--amber); }
.insight-card.green .insight-number { color: var(--green); }
.insight-card.blue .insight-number { color: #2563EB; }
.insight-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.insight-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ── KPI Insight Rows (Pinned Insights) ── */
.kpi-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
  margin: 0 -4px;
}
.kpi-row:hover { background: #F8FAFC; }
.kpi-row-last  { border-bottom: none; }
.kpi-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-badge-green { background: var(--green-bg);  color: var(--green);   }
.kpi-badge-blue  { background: #EFF6FF;           color: #2563EB;        }
.kpi-badge-amber { background: var(--amber-bg);  color: #D97706;        }
.kpi-badge-red   { background: var(--red-bg);    color: var(--red);     }
.kpi-metric-info {
  flex: 1;
  min-width: 0;
}
.kpi-metric-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}
.kpi-metric-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.kpi-trend-info {
  text-align: right;
  flex-shrink: 0;
}
.kpi-trend-val {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.kpi-trend-up      { color: var(--green); }
.kpi-trend-down    { color: var(--red);   }
.kpi-trend-neutral { color: var(--amber); }
.kpi-trend-ctx {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.mini-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s, padding-left 0.15s;
}
.mini-alert:last-of-type {
  border-bottom: none;
}
.mini-alert:hover {
  opacity: 0.8;
  padding-left: 4px;
}
.mini-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mini-alert-info {
  flex: 1;
  min-width: 0;
}
.mini-alert-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.mini-alert-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.25;
  margin-top: 2px;
}
.mini-alert-right {
  flex-shrink: 0;
  text-align: right;
}
.mini-alert-amt {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mini-alert-age {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.panel-btn-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
  transition: color 0.15s;
}
.panel-btn-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.impact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.impact-row:last-of-type {
  border-bottom: none;
}
.impact-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.impact-val {
  font-size: 14px;
  font-weight: 700;
}

/* Today's Stakes Card mockup-matching styles */
.stakes-card {
  border-radius: 20px !important;
  padding: 8px 24px !important;
}
.stakes-card .impact-row {
  padding: 16px 0;
  border-bottom: 1px solid #F1F5F9;
}
.stakes-card .impact-row:last-of-type {
  border-bottom: none;
}
.stakes-card .impact-label {
  font-size: 14.5px;
  font-weight: 500;
  color: #334155;
}
.stakes-card .impact-val {
  font-size: 15.5px;
  font-weight: 700;
}

/* ── Filter Sidebar ── */
.sidebar-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.sidebar-section:last-of-type {
  border-bottom: none;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}
.filter-item {
  border-bottom: 1px solid #F1F5F9;
}
.filter-item:last-child {
  border-bottom: none;
}
.filter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.filter-check-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}
.filter-label:hover .checkbox-custom {
  border-color: #94A3B8;
}
input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox-custom.indeterminate {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-custom.indeterminate::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  width: 9px;
  height: 2px;
  background: white;
  border-radius: 1px;
}
.filter-text {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.filter-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.cat-chevron {
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
}
.cat-chevron:hover { color: var(--text-secondary); background: #F1F5F9; }
.cat-chevron.open { transform: rotate(90deg); color: var(--primary); }
.sub-filter-list { margin: 0; border-top: 1px solid #F3F4F6; }
.sub-filter-item .filter-label { padding: 6px 0; }
.clear-filters-btn {
  margin: 16px 24px;
  text-align: left;
  font-size: 13px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.clear-filters-btn:hover {
  text-decoration: underline;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Alerts & Lists ── */
.list-header {
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.list-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-header-opportunity {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.list-header-opp-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.list-header-opp-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.list-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.list-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.list-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}
.filter-tabs {
  display: flex;
  gap: 2px;
}
.filter-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.filter-tab.active {
  background: var(--text-primary);
  color: var(--white);
}
.filter-tab:not(.active):hover {
  background: #F1F5F9;
  color: var(--text-primary);
}
.filter-tab-count {
  font-size: 10px;
  opacity: 0.7;
}
.tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tab-dot-red   { background: var(--red); }
.tab-dot-amber { background: var(--amber); }
.tab-dot-blue  { background: var(--primary); }

.list-scroll {
  flex: 1;
  overflow-y: auto;
}

.group-header {
  padding: 10px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.group-accent {
  width: 4px;
  height: 14px;
  border-radius: 2px;
}
.group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.group-count {
  font-size: 11px;
  color: var(--text-muted);
}

.list-row {
  border-bottom: 1px solid #F1F5F9;
  border-left: 3px solid transparent;
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  padding: 14px 24px;
  position: relative;
}
.list-row:hover {
  background: #F8FAFC;
}
.list-row.active {
  background: #EEF2F6;
  border-left-color: var(--primary);
}
.list-row.row-urgent {
  border-left-color: var(--red);
}
.list-row.row-watch {
  border-left-color: var(--amber);
}

.row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.row-id {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  width: 24px;
  flex-shrink: 0;
}
.row-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.row-score {
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.row-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-left: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row-subtitle-dot {
  color: var(--text-muted);
}
.row-amt {
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.row-amt.risk { color: var(--red); }
.row-amt.watch { color: var(--amber); }
.row-amt.upside { color: var(--green); }

.pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pill-reorder { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }
.pill-dont_reorder { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.pill-transfer { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.pill-config { background: #F3F4F6; color: #374151; border: 1px solid #E5E7EB; }
.pill-watch { background: #F3F4F6; color: #374151; border: 1px solid #E5E7EB; }

.badge-tag {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 5px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 600;
  background: #F1F5F9;
  color: var(--text-secondary);
}

.row-stats-grid {
  margin-left: 34px;
  margin-top: 10px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.row-stat-box {
  display: flex;
  flex-direction: column;
}
.row-stat-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.row-stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.row-stat-val.red {
  color: var(--red);
}

.row-score-bar {
  margin-left: 34px;
  height: 3px;
  background: #F1F5F9;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.row-score-progress {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
}

.row-bottom-info {
  margin-left: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}
.row-bottom-badges {
  display: flex;
  gap: 4px;
}

/* ── Decision Detail Panel ── */
.detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.detail-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-approve {
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-approve:hover {
  background: var(--primary-hover);
}
.btn-dismiss {
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-dismiss:hover {
  background: var(--bg);
}
.badge-status-outcome {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.outcome-approved {
  background: #ECFDF5;
  color: var(--green);
  border: 1px solid #A7F3D0;
}
.outcome-dismissed {
  background: #F3F4F6;
  color: var(--text-secondary);
  border: 1px solid #E5E7EB;
}
.btn-icon-link {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s;
}
.btn-icon-link:hover {
  background: var(--bg);
}
.detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.35;
}
.detail-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
}

.rec-box {
  padding: 20px 24px;
}
.rec-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.rec-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}
.rec-alert-card {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13px;
  line-height: 1.5;
}
.rec-alert-card.red {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}
.rec-alert-card.green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}
.rec-alert-card.amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: #B45309;
}
.rec-alert-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 10px;
}
.rec-alert-desc {
  opacity: 0.9;
}
.impact-banner-kpis {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid currentColor;
  opacity: 0.85;
  font-size: 12.5px;
}
.impact-banner-kpi {
  display: flex;
  align-items: center;
  gap: 4px;
}
.impact-banner-kpi strong {
  font-weight: 800;
  font-size: 13.5px;
}
.impact-banner-kpi strong.red   { color: var(--red); }
.impact-banner-kpi strong.amber { color: var(--amber); }
.impact-banner-kpi strong.green { color: var(--green); }
.impact-banner-sep {
  color: currentColor;
  opacity: 0.4;
  font-size: 14px;
}

.stats-grid-box {
  padding: 0 24px 20px 24px;
}
.stats-grid-cols3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats-grid-cols2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.detail-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.stat-box-inner {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 62px;
}
.stat-box-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}
.stat-box-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 5px;
  line-height: 1.1;
}
.stat-box-val.red { color: var(--red); }
.stat-box-val.green { color: var(--green); }
.stat-box-val.amber { color: var(--amber); }

/* ── Redesigned detail stat cards ── */
.detail-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.detail-stat-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-stat-icon-circle.green { background: var(--green-bg); color: var(--green); }
.detail-stat-icon-circle.red   { background: var(--red-bg);   color: var(--red);   }
.detail-stat-icon-circle.amber { background: var(--amber-bg); color: #B45309;      }
.detail-stat-icon-circle.blue  { background: #EEF2FF;         color: var(--primary); }
.detail-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 4px;
}
.detail-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.4px;
}
.detail-stat-value.green { color: var(--green); }
.detail-stat-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* ── Redesigned what-to-do / why section cards ── */
.detail-section-card {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.detail-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-section-icon.blue   { background: #EEF2FF;          color: var(--primary); }
.detail-section-icon.amber  { background: var(--amber-bg);  color: #B45309;        }
.detail-section-icon.purple { background: #F5F3FF;          color: #6D28D9;        }
.detail-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.detail-section-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CTA sublabel */
.detail-cta-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.detail-chart-section {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}
.chart-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.chart-container {
  height: 120px;
  width: 100%;
  margin-bottom: 16px;
  position: relative;
}
.chart-container:last-child {
  margin-bottom: 0;
}

/* Styled HTML / SVG ranges */
.range-bar-wrap {
  margin-top: 8px;
}
.range-track {
  height: 10px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  width: 100%;
}
.range-track-red { background: #FECACA; }
.range-track-amber { background: #FDE68A; }
.range-track-green { background: #A7F3D0; }
.range-pointer-row {
  position: relative;
  height: 16px;
  margin-top: -6px;
}
.range-pointer {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pointer-triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--red);
}
.pointer-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--red);
  margin-top: 2px;
  white-space: nowrap;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
}
.sku-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
}
.sku-table td {
  padding: 6px 0;
  border-bottom: 1px solid #F1F5F9;
}
.sku-table tr:last-child td {
  border-bottom: none;
}

.collapsible-section {
  border-top: 1px solid var(--border);
}
.collapsible-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--white);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.collapsible-header:hover {
  background: #F8FAFC;
}
.collapsible-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.collapsible-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}
.collapsible-count {
  font-size: 11px;
  color: var(--text-muted);
}
.collapsible-caret {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.collapsible-section.open .collapsible-caret {
  transform: rotate(180deg);
}
.collapsible-content {
  padding: 0 24px 20px 24px;
  display: none;
}
.collapsible-section.open .collapsible-content {
  display: block;
}

.supporting-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}
.supporting-dt {
  color: var(--text-muted);
}
.supporting-dd {
  color: var(--text-primary);
  font-weight: 500;
}

.alternatives-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.alternatives-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
}
.alternatives-table td {
  padding: 8px 0;
  border-top: 1px solid #F1F5F9;
  vertical-align: top;
}
.alt-option {
  font-weight: 500;
  padding-right: 12px;
}
.alt-option.chosen {
  color: var(--green);
  font-weight: 600;
}
.alt-reason {
  color: var(--text-secondary);
}

.history-timeline {
  list-style: none;
  position: relative;
  padding-left: 20px;
}
.history-timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--border);
}
.history-item {
  position: relative;
  padding-bottom: 12px;
}
.history-item:last-child {
  padding-bottom: 0;
}
.history-dot {
  position: absolute;
  left: -20px;
  top: 4.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--text-muted);
}
.history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.history-date {
  color: var(--text-muted);
  width: 44px;
}
.history-act {
  font-weight: 600;
  color: var(--text-primary);
}
.badge-outcome {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}
.badge-outcome.acted { background: #ECFDF5; color: var(--green); }
.badge-outcome.dismissed { background: #F1F5F9; color: var(--text-secondary); }
.badge-outcome.pending { background: #FFFBEB; color: var(--amber); }
.history-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-left: 52px;
}

.detail-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  background: var(--white);
}

/* ── Inbox Center ── */
.inbox-header-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}
.inbox-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.inbox-badge.urgent { background: #FEF2F2; color: #991B1B; border: 1px solid #FEE2E2; }
.inbox-badge.thisweek { background: #FFFBEB; color: #92400E; border: 1px solid #FEF3C7; }
.inbox-badge.done { background: #ECFDF5; color: #065F46; border: 1px solid #D1FAE5; }
.inbox-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.inbox-badge.urgent .inbox-badge-dot { background: var(--red); }
.inbox-badge.thisweek .inbox-badge-dot { background: var(--amber); }
.inbox-badge.done .inbox-badge-dot { background: var(--green); }

.sticky-section-title {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 24px;
  background: var(--white);
  transition: all 0.2s;
}
.action-card.checked {
  background: #F8FAFC;
  border-color: #E2E8F0;
  opacity: 0.8;
}
.action-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.action-check-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.action-check-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #CBD5E1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.action-check-btn:hover {
  border-color: #94A3B8;
}
.action-card.checked .action-check-btn {
  background: var(--green);
  border-color: var(--green);
}
.action-check-btn svg {
  display: none;
  width: 12px;
  height: 12px;
  color: var(--white);
}
.action-card.checked .action-check-btn svg {
  display: block;
}

.action-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.action-rank.urgent { background: var(--red); }
.action-rank.thisweek { background: var(--amber); }

.action-info-col {
  flex: 1;
  min-width: 0;
}
.action-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.action-card.checked .action-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.action-body {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 6px;
}
.action-tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.action-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2.5px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.action-tag.urgent { background: #FEE2E2; color: #991B1B; }
.action-tag.thisweek { background: #FEF3C7; color: #92400E; }
.action-tag.thismonth { background: #EFF6FF; color: #1D4ED8; }
.action-tag.alert { background: #FFFBEB; color: #B45309; border: 1px solid #FED7AA; }
.action-tag.briefing { background: #F1F5F9; color: var(--text-secondary); }
.action-time {
  font-size: 11.5px;
  color: var(--text-muted);
}
.action-deadline {
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}
.action-deadline.red { color: var(--red); }
.action-deadline.amber { color: var(--amber); }
.action-deadline.blue { color: #1D4ED8; }
.action-why-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-left: 4px;
}
.action-why-link:hover { text-decoration: underline; }

.action-impact-col {
  text-align: right;
  width: 90px;
  flex-shrink: 0;
}
.action-impact-amt {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
}
.action-card.checked .action-impact-amt {
  color: var(--text-muted);
  text-decoration: line-through;
}
.action-impact-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.completed-month-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
  border-bottom: none;
  cursor: pointer;
}
.completed-month-header:hover {
  background: #F8FAFC;
}
.completed-month-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.completed-month-title h3 {
  font-size: 14px;
  font-weight: 700;
}
.completed-count-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.completed-total-recovered {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin-right: 8px;
}
.completed-list {
  list-style: none;
  padding: 0 24px 20px 24px;
}
.completed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13.5px;
}
.completed-item:last-child {
  border-bottom: none;
}
.completed-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.completed-check-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D1FAE5;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.completed-item-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.completed-item-date {
  font-size: 11.5px;
  color: var(--text-muted);
}
.completed-item-amt {
  font-weight: 700;
  color: var(--green);
  width: 70px;
  text-align: right;
}

/* ── Dismissed Items Section (inbox) ── */
#dismissed-drill-section {
  margin: 12px 0 0 0;
}
.dismissed-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
}
.dismissed-items-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.dismissed-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #F1F5F9;
  opacity: 0.7;
}
.dismissed-item-row:last-child { border-bottom: none; }
.dismissed-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.dismissed-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
  flex-shrink: 0;
}
.dismissed-item-name {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dismissed-item-theme {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: #F1F5F9;
  border-radius: 4px;
  padding: 2px 6px;
}
.dismissed-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.dismissed-item-amt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.dismissed-item-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── Action Inbox Summary ── */
.inbox-summary-card {
  padding: 16px !important;
}
.inbox-summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.inbox-summary-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
}
.inbox-summary-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.inbox-summary-hero-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inbox-summary-hero-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.inbox-summary-hero-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}
.inbox-summary-hero-count {
  font-size: 38px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -2px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.inbox-summary-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.inbox-summary-module-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.inbox-summary-module-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.inbox-summary-module-name {
  font-size: 12px;
  color: var(--text-secondary);
  width: 82px;
  flex-shrink: 0;
}
.inbox-summary-module-bar {
  flex: 1;
  height: 6px;
  background: #F1F5F9;
  border-radius: 3px;
  overflow: hidden;
}
.inbox-summary-module-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 4px;
  transition: width 0.4s ease;
}
.inbox-summary-module-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 16px;
  text-align: right;
}
.inbox-summary-module-sep {
  display: none;
}
/* Module dot + fill colors */
.mod-revenue    { background: #60A5FA; }
.mod-cogs       { background: #FBBF24; }
.mod-inventory  { background: #A78BFA; }
.mod-gm         { background: #F472B6; }
.inbox-summary-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  align-items: start;
}
.inbox-summary-urgency-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.inbox-summary-urgency-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}
.inbox-summary-urgency-chip.urgent {
  background: var(--red-bg);
  color: #991B1B;
  border: 1px solid var(--red-border);
}
.inbox-summary-urgency-chip.thisweek {
  background: var(--amber-bg);
  color: #92400E;
  border: 1px solid var(--amber-border);
}
.urgency-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.urgency-dot.red   { background: var(--red);   }
.urgency-dot.amber { background: var(--amber); }
.inbox-summary-deadline-col {
  display: flex;
  flex-direction: column;
}
.inbox-summary-deadline-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
  line-height: 1.3;
}

/* ── Impact Tracker Right Column ── */
.tracker-hero {
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 20px;
  box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.2);
}
.tracker-hero-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.8px;
}
.tracker-hero-val {
  font-size: 34px;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.8px;
}
.tracker-hero-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

.tracker-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 20px;
}
.tracker-stat-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.tracker-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.tracker-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tracker-chart-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.tracker-best-action-box {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0 20px 16px 20px;
}
.best-action-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4338CA;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.best-action-desc {
  font-size: 12.5px;
  color: #3730A3;
  line-height: 1.5;
}
.best-action-desc strong {
  font-weight: 700;
}

/* ── Recommendations Page ── */

.rec-card {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  padding: 18px 24px;
  cursor: default;
  transition: background 0.12s;
  position: relative;
}
.rec-card:hover { background: #F8FAFC; }
.rec-card.today     { border-left-color: var(--red); }
.rec-card.thisweek  { border-left-color: var(--amber); }
.rec-card.thismonth { border-left-color: #2563EB; }

.rec-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rec-headline-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.rec-headline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
.rec-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rec-footer-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.rec-impact-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.rec-impact-badge.risk   { color: var(--green); }
.rec-impact-badge.saving { color: var(--green); }
.rec-impact-badge.gain   { color: var(--green); }
.rec-impact-arrow {
  font-size: 12px;
  line-height: 1;
}

.rec-why {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}
.rec-action-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.rec-store-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #F1F5F9;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.rec-owner-tag {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.rec-age {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* Urgency pills */
.urgency-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.urgency-pill.today    { background: var(--red-bg);   color: #991B1B; border: 1px solid var(--red-border); }
.urgency-pill.thisweek { background: var(--amber-bg); color: #92400E; border: 1px solid var(--amber-border); }
.urgency-pill.thismonth { background: #EFF6FF;        color: #1D4ED8; border: 1px solid #BFDBFE; }

/* Theme pills */
.pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.pill-restock    { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }
.pill-transfer   { background: var(--green-bg); color: #047857; border: 1px solid var(--green-border); }
.pill-pricing    { background: var(--amber-bg); color: #B45309; border: 1px solid var(--amber-border); }
.pill-liquidate  { background: var(--red-bg); color: #991B1B; border: 1px solid var(--red-border); }
.pill-bundling   { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.pill-investigate { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }

.section-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  margin-bottom: 10px;
}

/* Recommendations right panel */
.recs-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 20px;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.22);
}
.recs-hero-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}
.recs-hero-amount {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}
.recs-hero-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

.recs-panel-section {
  padding: 0 20px 16px 20px;
}
.recs-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.recs-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px;
}
.recs-breakdown-row:last-child { border-bottom: none; }
.recs-breakdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.recs-breakdown-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.recs-breakdown-amt {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}
.recs-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recs-dot.today     { background: var(--red); }
.recs-dot.thisweek  { background: var(--amber); }
.recs-dot.thismonth { background: #2563EB; }
.recs-dot.restock   { background: #4338CA; }
.recs-dot.transfer  { background: var(--green); }
.recs-dot.pricing   { background: var(--amber); }
.recs-dot.liquidate { background: var(--red); }
.recs-dot.bundling  { background: #6D28D9; }

/* ── Recommendations Detail Panel ── */

.rec-card.selected {
  background: #EEF2FF;
  border-left-color: var(--primary) !important;
}

.rec-detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.rec-detail-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.rec-detail-impact {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.rec-detail-impact.risk    { color: var(--red); }
.rec-detail-impact.saving  { color: var(--green); }
.rec-detail-impact.gain    { color: var(--green); }
.rec-detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 10px;
}
.rec-detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rec-detail-owner {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.rec-detail-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rec-detail-box-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-detail-why-box {
  background: #FFFBEB;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.rec-detail-why-box .rec-detail-box-label { color: #92400E; }
.rec-detail-why-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-primary);
}

.rec-detail-action-box {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.rec-detail-action-box .rec-detail-box-label { color: #3730A3; }
.rec-detail-action-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--primary);
}

.rec-detail-footer {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
}

.rec-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 40px;
}

/* ── Recommendations: CTA Section (Level 0 bottom) ── */
.detail-cta-section {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cta-primary-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.cta-primary-btn:hover { background: var(--primary-hover); }
.cta-outline-btn {
  width: 100%;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--white);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--primary);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.cta-outline-btn:hover { background: #EEF2FF; }
.cta-secondary-btn {
  width: 100%;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.cta-secondary-btn:hover { background: var(--bg); }
.cta-secondary-btn.actioned {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
  cursor: default;
}

/* ── Drill Header (Levels 1 & 2) ── */
.drill-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drill-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s;
}
.drill-back-btn:hover { background: var(--bg); }
.drill-header-meta { flex: 1; min-width: 0; }
.drill-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
}
.drill-header-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Drill Table (Level 1) ── */
.drill-table-wrap {
  padding: 16px 16px 20px;
}
.drill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.drill-table thead tr {
  border-bottom: 1.5px solid var(--border);
}
.drill-table th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 8px 10px;
}
.drill-item-row {
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.1s;
}
.drill-item-row:last-child { border-bottom: none; }
.drill-item-row:hover { background: #F8FAFC; }
.drill-item-row td { padding: 12px 8px; vertical-align: middle; }
.drill-clickable { cursor: pointer; }
.drill-clickable:hover { background: #EEF2FF !important; }
.drill-clickable td:first-child::after {
  content: ' →';
  color: var(--primary);
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.1s;
}
.drill-clickable:hover td:first-child::after { opacity: 1; }

/* Column alignment helpers */
.dt-l { text-align: left; }
.dt-m { text-align: left; }
.dt-r { text-align: right; }
.dt-c { text-align: center; }

/* Cell styles */
.drill-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drill-muted { color: var(--text-muted); font-size: 12px; }
.drill-red   { color: var(--red); font-weight: 600; }
.drill-amber { color: #B45309; font-weight: 600; }
.drill-green { color: var(--green); font-weight: 600; }
.drill-th-red   { color: var(--red) !important; }
.drill-th-amber { color: #B45309 !important; }
.drill-th-green { color: var(--green) !important; }
.drill-hero { color: var(--amber); font-size: 13px; }

/* ── Level 2: Store breakdown table ── */
.drill-store-table {
  width: 100%;
  border-collapse: collapse;
}
.drill-store-row { border-bottom: 1px solid #F3F4F6; }
.drill-store-row:last-child { border-bottom: none; }
.drill-store-name {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-primary);
}
.drill-store-val {
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* ── Level 2: Action section ── */
.drill-action-section {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

/* ── Actioned / Dismissed card states ── */
.rec-card.actioned  {}
.rec-card.approved {
  background: #F0FDF4;
  border-left-color: var(--green);
}
.rec-card.approved:hover { background: #DCFCE7; }
.rec-card.dismissed {
  background: #FAFAFA;
  border-left-color: #CBD5E1;
  opacity: 0.7;
}
.rec-card.dismissed:hover { opacity: 1; }

/* Status badges on approved/dismissed cards */
.rec-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}
.rec-status-approved {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}
.rec-status-dismissed {
  background: #F1F5F9;
  color: var(--text-secondary);
  border: 1px solid #E2E8F0;
}
.rec-actioned-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}
.rec-dismissed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: #F3F4F6;
  color: var(--text-muted);
  border: 1px solid #E5E7EB;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

/* ── Level 0: Compact What-to-Do + Why ── */
.rec-action-line {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.65;
}
.rec-why-section {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
}
.rec-why-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.rec-why-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Level 1: Hover tooltip for truncated product names ── */
.drill-tip {
  position: relative;
}
.drill-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #111827;
  color: #F9FAFB;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 260px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.drill-tip:hover::after { opacity: 1; }

/* ── Level 2: Redesigned item detail ── */
.l2-metrics-bar {
  display: flex;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
}
.l2-metric {
  flex: 1;
  text-align: center;
}
.l2-metric-divider {
  width: 1px;
  height: 38px;
  background: var(--border);
  flex-shrink: 0;
}
.l2-metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
}
.l2-metric-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.l2-metric-unit {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.l2-hero-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: middle;
}
.l2-section {
  padding: 16px 24px;
}
.l2-section + .l2-section { border-top: 1px solid var(--border); }
.l2-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.l2-store-list { display: flex; flex-direction: column; gap: 8px; }
.l2-store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--border);
}
.l2-store-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}
.l2-store-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}
.badge-oos {
  background: var(--red-bg);
  color: #991B1B;
  border: 1px solid var(--red-border);
}
.badge-instock {
  background: var(--green-bg);
  color: #065F46;
  border: 1px solid var(--green-border);
}
.l2-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.l2-store-summary {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.l2-store-summary.all-oos {
  background: var(--red-bg);
  color: #991B1B;
}
.l2-store-summary.some-stock {
  background: var(--green-bg);
  color: #065F46;
}
.l2-oos-val {
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}
.l2-actions-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.drill-top-note {
  padding: 10px 20px;
  font-size: 11.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
}

/* ── Level 1: Investigate card-style rows ── */
.drill-card-list { padding: 4px 0; }
.drill-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: background 0.1s;
}
.drill-card-row:last-child { border-bottom: none; }
.drill-card-row:hover { background: #EEF2FF; }
.drill-card-left { flex: 1; min-width: 0; }
.drill-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 5px;
}
.drill-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
.drill-card-rev {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: right;
}
.drill-card-rev.red    { color: var(--red); }
.drill-card-rev.green  { color: var(--green); }
.drill-card-rev.amber  { color: #B45309; }
.drill-card-right-col {
  text-align: right;
  flex-shrink: 0;
}
.drill-card-rev-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
}
.drill-card-rev-sub.red { color: var(--red); font-weight: 600; }
.stock-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.stock-tag.oos    { background: var(--red-bg); color: #991B1B; }
.stock-tag.low    { background: var(--amber-bg); color: #92400E; }
.stock-tag.excess { background: var(--amber-bg); color: #92400E; }
.drill-card-arrow {
  color: var(--primary);
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.1s;
  flex-shrink: 0;
}
.drill-card-row:hover .drill-card-arrow { opacity: 1; }
.drill-card-row.drill-item-done {
  opacity: 0.45;
  pointer-events: none;
}
.drill-card-row.drill-item-skipped {
  opacity: 0.3;
  pointer-events: none;
  text-decoration: line-through;
}
.drill-show-all-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #F3F4F6;
}
.drill-show-all-note {
  font-size: 12px;
  color: var(--text-muted);
}
.drill-show-all-btn {
  background: none;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}
.drill-show-all-btn:hover { text-decoration: underline; }
.drill-item-dismiss-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.drill-item-dismiss-btn:hover {
  border-color: #CBD5E1;
  color: var(--text-secondary);
  background: #F8FAFC;
}
.drill-item-done-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}
.drill-item-action-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.drill-item-approve-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.drill-item-approve-btn:hover { background: var(--primary-dark, #1D4ED8); }
.drill-card-row.hero-item {
  border-left: 3px solid #D97706;
  padding-left: 17px;
}
.cat-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F1F5F9;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}
.top-seller-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 10.5px;
  font-weight: 600;
}
.drill-card-vel {
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Level 2: Restock item detail ── */
.l2-order-box {
  margin: 0 20px 0;
  padding: 16px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 10px;
  margin: 16px 20px 0;
}
.l2-order-headline {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}
.l2-order-sub {
  font-size: 12.5px;
  color: #4338CA;
  line-height: 1.5;
}
.l2-risk-banner {
  margin: 12px 20px 0;
  padding: 13px 16px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: 10px;
}
.l2-risk-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 3px;
}
.l2-risk-sub {
  font-size: 11.5px;
  color: #991B1B;
  opacity: 0.85;
}
.l2-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.l2-stat-cell {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
}
.l2-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.l2-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toast-in 0.28s cubic-bezier(0.34,1.56,0.64,1) forwards;
  max-width: 340px;
  line-height: 1.4;
}
.toast-success { background: #059669; }
.toast-info    { background: var(--primary); }
.toast-neutral { background: #374151; }
.toast-hiding  { animation: toast-out 0.25s ease forwards; }
.toast-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.9;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
