/* ============================================================
   SUAM HARDWARE — Design System
   ============================================================ */

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

/* ── 1. CSS VARIABLES ──────────────────────────────────────── */
:root {
  --bg-shell:              #0B192C;
  --bg-canvas:             #FFFFFF;
  --bg-surface:            #F8FAFC;
  --brand-primary:         #FF6B00;
  --brand-primary-light:   rgba(255, 107, 0, 0.10);
  --brand-primary-mid:     rgba(255, 107, 0, 0.20);

  --text-primary-dark:     #0F172A;
  --text-secondary-dark:   #64748B;
  --text-primary-light:    #FFFFFF;
  --text-secondary-light:  #94A3B8;

  --radius-canvas:         40px;
  --radius-card:           20px;
  --radius-pill:           9999px;

  --shadow-soft:  0 10px 25px -5px rgba(11, 25, 44, 0.05);
  --shadow-hover: 0 20px 35px -5px rgba(11, 25, 44, 0.12);
  --shadow-card-border: 0 0 0 1px #E2E8F0;

  --sidebar-collapsed: 80px;
  --sidebar-expanded:  240px;
  --transition-main: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-primary-dark);
  -webkit-font-smoothing: antialiased;
}

/* ── 3. APP SHELL ──────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-shell);
}

/* ── 4. SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-collapsed);
  min-height: 100vh;
  background-color: var(--bg-shell);
  transition: width 300ms var(--transition-main);
  z-index: 50;
  flex-shrink: 0;
}

.sidebar.expanded { width: var(--sidebar-expanded); }

/* Brand logo area */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px; /* Fixed height to prevent vertical nav shifting */
  padding: 50px 12px 6px 12px; /* Shifted lower by increasing top padding and decreasing bottom padding */
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
  transition: padding 300ms var(--transition-main);
}

.sidebar.expanded .sidebar-brand {
  padding: 50px 24px 6px 24px;
}

.sidebar-brand .brand-collapsed-logo {
  width: 56px;
  height: 56px;
  opacity: 1;
  object-fit: contain;
  flex-shrink: 0;
  transition: opacity 200ms var(--transition-main), width 200ms var(--transition-main), height 200ms var(--transition-main);
}

.sidebar-brand .brand-logo {
  width: 0;
  height: 0;
  opacity: 0;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
  transition: opacity 200ms var(--transition-main), width 200ms var(--transition-main), height 200ms var(--transition-main);
}

.sidebar.expanded .brand-collapsed-logo {
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  display: none;
}

.sidebar.expanded .brand-logo {
  opacity: 1;
  width: 192px; /* Occupy more horizontal space */
  height: 56px;
}

/* Nav list */
.sidebar-nav {
  flex: 1;
  list-style: none;
  padding: 8px 0;
  position: relative;
}

/* ── 4a. CUTOUT NAVIGATION ITEM ────────────────────────────── */
.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  margin-left: 12px;
  height: 56px;
  text-decoration: none;
  color: var(--text-secondary-light);
  border-radius: 28px 0 0 28px;
  transition: color 250ms var(--transition-main),
              background-color 250ms var(--transition-main);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.nav-link .nav-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: color 250ms var(--transition-main);
}

.nav-link .nav-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 200ms var(--transition-main),
              transform 200ms var(--transition-main);
}

.sidebar.expanded .nav-link .nav-label {
  opacity: 1;
  transform: translateX(0);
}

/* ACTIVE STATE TEXT COLOR */
.nav-item.active .nav-link {
  color: var(--brand-primary);
  background-color: transparent;
}

.nav-item.active .nav-link .nav-icon { color: var(--brand-primary); }

/* ── 4b. SLIDING ACTIVE INDICATOR ──────────────────────────── */
.active-indicator {
  position: absolute;
  top: 0;
  left: 12px;
  right: 0;
  height: 56px;
  background-color: var(--bg-canvas);
  border-radius: 28px 0 0 28px;
  z-index: 1;
  transition: transform 300ms var(--transition-main);
  pointer-events: none;
}

/* Concave corner above */
.active-indicator::before {
  content: '';
  position: absolute;
  right: 0;
  bottom: 100%;
  width: 24px;
  height: 24px;
  background: var(--bg-canvas);
  -webkit-mask-image: radial-gradient(circle at 0% 0%, transparent 70%, black 71%);
  mask-image: radial-gradient(circle at 0% 0%, transparent 70%, black 71%);
}

/* Concave corner below */
.active-indicator::after {
  content: '';
  position: absolute;
  right: 0;
  top: 100%;
  width: 24px;
  height: 24px;
  background: var(--bg-canvas);
  -webkit-mask-image: radial-gradient(circle at 0% 100%, transparent 70%, black 71%);
  mask-image: radial-gradient(circle at 0% 100%, transparent 70%, black 71%);
}

/* Hover for inactive */
.nav-item:not(.active) .nav-link:hover {
  color: var(--text-primary-light);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Toggle button */
.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: background 200ms;
  color: var(--text-secondary-light);
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.15); }
.sidebar-toggle span { font-size: 1rem; transition: transform 300ms var(--transition-main); }
.sidebar.expanded .sidebar-toggle span { transform: rotate(180deg); }

/* ── 5. MAIN CANVAS ────────────────────────────────────────── */
.main-canvas {
  flex: 1;
  background-color: var(--bg-canvas);
  border-top-left-radius: var(--radius-canvas);
  border-bottom-left-radius: var(--radius-canvas);
  overflow-y: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: border-radius 300ms var(--transition-main);
}

/* Scrollbar styling */
.main-canvas::-webkit-scrollbar { width: 6px; }
.main-canvas::-webkit-scrollbar-track { background: transparent; }
.main-canvas::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 3px;
}

/* ── 6. TOP BAR ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #F1F5F9;
  position: sticky;
  top: 0;
  background: var(--bg-canvas);
  z-index: 40;
  border-top-left-radius: var(--radius-canvas);
}

.topbar-left h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary-dark);
  letter-spacing: -0.02em;
}

.topbar-left p {
  font-size: 0.8rem;
  color: var(--text-secondary-dark);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── 6.5 SUB-NAVIGATION ────────────────────────────────────── */
.subnav-container {
  padding: 0 32px;
  background: var(--bg-canvas);
  border-bottom: 1px solid #F1F5F9;
  position: sticky;
  top: 90px; /* Below topbar */
  z-index: 30;
}

.subnav-list {
  display: flex;
  list-style: none;
  gap: 8px;
  padding: 12px 0;
  margin: 0;
  overflow-x: auto;
  white-space: nowrap;
  position: relative; /* Container for absolute indicator */
}

.subnav-list::-webkit-scrollbar {
  display: none; /* Hide scrollbar for sleek look */
}
.subnav-list {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.subnav-link {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary-dark);
  text-decoration: none;
  background: transparent;
  transition: all 200ms var(--transition-main);
  border: 1px solid transparent;
  position: relative;
  z-index: 2; /* Sit above the sliding indicator */
}

.subnav-link:hover {
  color: var(--text-primary-dark);
}

.subnav-link.active {
  color: var(--brand-primary);
  /* The background and border are now handled by .subnav-indicator */
}

/* Sliding Indicator for Subnav */
.subnav-indicator {
  position: absolute;
  top: 12px; /* matches the padding-top of .subnav-list */
  left: 0;
  height: 33px; /* approximate height of the pill */
  border-radius: 20px;
  background: rgba(249, 115, 22, 0.1); /* Subtle orange background */
  border: 1px solid rgba(249, 115, 22, 0.2);
  z-index: 1;
  pointer-events: none;
  transition: transform 300ms var(--transition-main), width 300ms var(--transition-main);
}

/* ── 7. CONTENT AREA ───────────────────────────────────────── */
.content-area {
  padding: 28px 32px;
  flex: 1;
}

/* ── 8. CARD GRID ──────────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 20px;
}

.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 1400px) { .grid-6, .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1200px) { .grid-6, .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .grid-6, .grid-5, .grid-4, .grid-3, .grid-2, .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; } }

/* ── 9. WIDGET CARDS ───────────────────────────────────────── */
.card {
  background: var(--bg-canvas);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-soft), var(--shadow-card-border);
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1),
              box-shadow 300ms cubic-bezier(0.2, 0, 0, 1),
              border-color 300ms ease;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent; /* Prepare for border glow */
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.6), transparent);
  transform: skewX(-20deg);
  transition: none;
  pointer-events: none;
  z-index: 2;
}

@keyframes cardShine {
  100% { left: 200%; }
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08), var(--shadow-card-border);
  border-color: rgba(249, 115, 22, 0.2); /* Subtle brand border glow */
}

.card:hover::after {
  animation: cardShine 1.2s ease-in-out;
}

.card-surface { background: var(--bg-surface); }

/* Inverted card */
.card-inverted {
  background: var(--bg-shell);
  color: var(--text-primary-light);
  box-shadow: var(--shadow-hover);
  border: 1px solid rgba(255,255,255,0.05);
}

.card-inverted:hover {
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4), var(--shadow-card-border);
  border-color: rgba(255,255,255,0.15);
}

.card-inverted::after {
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
}

.card-inverted .card-label { color: var(--text-secondary-light); }
.card-inverted .card-value { color: var(--text-primary-light); }

/* Card inner elements */
.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary-dark);
  margin-bottom: 12px;
}

.card-value {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-primary-dark);
}

.card-subvalue {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary-dark);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary-dark);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary-dark);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), 
              background-color 300ms;
}

.card:hover .card-icon {
  transform: scale(1.15) rotate(6deg);
}

.card-icon.orange {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.card-icon.navy {
  background: rgba(11, 25, 44, 0.08);
  color: var(--bg-shell);
}

.card-icon.white {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Change badge */
.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-top: 10px;
}

.change-badge.positive {
  background: rgba(34, 197, 94, 0.10);
  color: #16a34a;
}

.change-badge.negative {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
}

.card-inverted .change-badge.positive {
  background: rgba(34, 197, 94, 0.18);
}

/* ── 9.5 KPI HERO CARDS ────────────────────────────────────── */
.kpi-hero-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 20px;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 300ms ease,
              box-shadow 300ms ease,
              background-color 300ms ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.kpi-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), #FFA751);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity 300ms ease, transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kpi-hero-card:hover {
  transform: translateY(-6px) scale(1.025);
  border-color: rgba(255, 107, 0, 0.4);
  box-shadow: 0 16px 36px -8px rgba(255, 107, 0, 0.22), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.kpi-hero-card:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.kpi-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #F1F5F9;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 300ms ease,
              color 300ms ease,
              box-shadow 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-icon {
  background: rgba(255, 107, 0, 0.12);
  color: var(--brand-primary);
  transform: scale(1.15) rotate(6deg);
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.18);
}

.kpi-hero-icon.green { background: rgba(22, 163, 74, 0.10); color: #16a34a; }
.kpi-hero-card:hover .kpi-hero-icon.green { background: rgba(22, 163, 74, 0.20); color: #16a34a; box-shadow: 0 6px 16px rgba(22, 163, 74, 0.2); }

.kpi-hero-icon.red { background: rgba(220, 38, 38, 0.10); color: #dc2626; }
.kpi-hero-card:hover .kpi-hero-icon.red { background: rgba(220, 38, 38, 0.20); color: #dc2626; box-shadow: 0 6px 16px rgba(220, 38, 38, 0.2); }

.kpi-hero-icon.blue { background: rgba(37, 99, 235, 0.10); color: #2563eb; }
.kpi-hero-card:hover .kpi-hero-icon.blue { background: rgba(37, 99, 235, 0.20); color: #2563eb; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2); }

.kpi-hero-icon.orange { background: rgba(255, 107, 0, 0.10); color: var(--brand-primary); }
.kpi-hero-card:hover .kpi-hero-icon.orange { background: rgba(255, 107, 0, 0.20); color: var(--brand-primary); box-shadow: 0 6px 16px rgba(255, 107, 0, 0.2); }

.kpi-hero-icon.purple { background: rgba(139, 92, 246, 0.10); color: #8B5CF6; }
.kpi-hero-card:hover .kpi-hero-icon.purple { background: rgba(139, 92, 246, 0.20); color: #8B5CF6; box-shadow: 0 6px 16px rgba(139, 92, 246, 0.2); }

.kpi-hero-label {
  margin-bottom: 4px;
  color: #475569;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-label {
  color: #0F172A;
}

.kpi-hero-value {
  font-size: 1.45rem;
  color: #0F172A;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color 300ms ease, transform 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-value {
  color: var(--brand-primary);
}

.kpi-hero-desc {
  margin-top: 4px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  transition: color 300ms ease;
}

.kpi-hero-arrow {
  font-size: 0.95rem;
  color: #0F172A;
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1), color 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-arrow {
  color: var(--brand-primary);
  transform: translateY(-2px) scale(1.2);
}

.kpi-hero-change {
  font-weight: 700;
  font-size: 0.78rem;
  color: #0F172A;
  transition: color 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-change {
  color: var(--brand-primary);
}

.kpi-hero-subtext {
  font-size: 0.7rem;
  color: #64748B;
  font-weight: 500;
  margin-left: 2px;
  transition: color 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-subtext {
  color: #334155;
}

.kpi-hero-badge {
  font-weight: 600;
  font-size: 0.72rem;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 20px;
  color: #0F172A;
  transition: background-color 300ms ease, color 300ms ease;
}

.kpi-hero-card:hover .kpi-hero-badge {
  background: rgba(255, 107, 0, 0.12);
  color: var(--brand-primary);
}

/* ── 10. BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 200ms var(--transition-main);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #e05e00;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255,107,0,0.35);
}

.btn-secondary {
  background: var(--bg-shell);
  color: #fff;
}
.btn-secondary:hover { background: #162840; }

.btn-ghost {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}
.btn-ghost:hover { background: var(--brand-primary-mid); }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-secondary-dark);
  border: 1px solid #E2E8F0;
}
.btn-icon:hover { background: #E2E8F0; color: var(--text-primary-dark); }

/* ── 11. SEARCH BAR ────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  transition: border-color 200ms, box-shadow 200ms;
}

.search-bar:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary-dark);
  font-family: inherit;
  width: 180px;
}

.search-bar input::placeholder { color: var(--text-secondary-dark); }
.search-bar span { color: var(--text-secondary-dark); font-size: 1rem; }

/* ── 12. AVATAR ────────────────────────────────────────────── */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), #ff9a3c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(255,107,0,0.3);
}

/* ── 13. NOTIFICATION DOT ──────────────────────────────────── */
.notif-btn {
  position: relative;
}
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  border: 2px solid var(--bg-canvas);
}

/* ── 14. SECTION HEADER ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary-dark);
}

/* ── 15. PROGRESS BAR ──────────────────────────────────────── */
.progress-track {
  height: 6px;
  background: #E2E8F0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
  transition: width 800ms var(--transition-main);
}

/* ── 16. ACTIVITY LIST ─────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.inactive { background: #CBD5E1; }

/* ── 17. STAT SPARKLINE PLACEHOLDER ───────────────────────── */
.sparkline-placeholder {
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(90deg,
    rgba(255,107,0,0.15) 0%,
    rgba(255,107,0,0.25) 50%,
    rgba(255,107,0,0.10) 100%
  );
  position: relative;
  overflow: hidden;
}

.sparkline-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

/* ── 18. CHART PLACEHOLDER ─────────────────────────────────── */
.chart-placeholder {
  border-radius: 12px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-secondary-dark);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 220px;
  border: 2px dashed #E2E8F0;
}

.chart-placeholder span { font-size: 2rem; opacity: 0.4; }

/* ── 19. DIVIDER ───────────────────────────────────────────── */
.divider { height: 1px; background: #F1F5F9; margin: 24px 0; }
.gap-section { margin-bottom: 28px; }

/* ── 20. ANIMATIONS ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeSlideUp 400ms var(--transition-main) both;
}

/* ── 21. PREMIUM DATA TABLES ───────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  background: white;
}
.suam-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}
.suam-table th {
  padding: 16px 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary-dark);
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  font-weight: 700;
  white-space: nowrap;
}
.suam-table td {
  padding: 18px 20px;
  font-size: 0.85rem;
  border-bottom: 1px solid #F1F5F9;
  transition: background-color 200ms ease;
  vertical-align: middle;
}
.suam-table tbody tr:hover td {
  background-color: #F8FAFC;
}
.suam-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── 22. PREMIUM BADGES ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Specific Badge Colors */
.badge-green { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-green .badge-dot { background: #10B981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }

.badge-blue { background: rgba(59, 130, 246, 0.1); color: #2563EB; }
.badge-blue .badge-dot { background: #3B82F6; box-shadow: 0 0 6px rgba(59,130,246,0.5); }

.badge-orange { background: rgba(249, 115, 22, 0.1); color: #EA580C; }
.badge-orange .badge-dot { background: #F97316; box-shadow: 0 0 6px rgba(249,115,22,0.5); }

.badge-red { background: rgba(239, 68, 68, 0.1); color: #DC2626; }
.badge-red .badge-dot { background: #EF4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

.badge-gray { background: rgba(100, 116, 139, 0.1); color: #475569; }
.badge-gray .badge-dot { background: #64748B; }
/* Staggered card entrance */
.card-grid .card:nth-child(1) { animation-delay: 0ms;  }
.card-grid .card:nth-child(2) { animation-delay: 50ms; }
.card-grid .card:nth-child(3) { animation-delay: 100ms;}
.card-grid .card:nth-child(4) { animation-delay: 150ms;}
.card-grid .card:nth-child(5) { animation-delay: 200ms;}
.card-grid .card:nth-child(6) { animation-delay: 250ms;}

/* ── 21. ORANGE ACCENT LINE ────────────────────────────────── */
.accent-bar {
  width: 32px;
  height: 3px;
  background: var(--brand-primary);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

/* ── 22. UTILITY ───────────────────────────────────────────── */
.text-orange  { color: var(--brand-primary); }
.text-muted   { color: var(--text-secondary-dark); }
.text-light   { color: var(--text-secondary-light); }
.text-white   { color: #fff; }
.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* ── 23. PAGE LOADER ───────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 44, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 300ms ease;
  visibility: hidden;
}

.page-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: translateY(20px);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-loader.show .loader-content {
  transform: translateY(0);
}

/* Elegant Orange Circular Loader */
.loader-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 107, 0, 0.15);
  border-left-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.2);
}

.loader-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 4px rgba(11, 25, 44, 0.4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── AI Prose — Markdown-rendered AI responses ──────────────────────────── */
.ai-prose {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.5;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.ai-prose p { margin: 0 0 8px 0; font-size: 0.8rem; color: #334155; line-height: 1.5; }
.ai-prose p:last-child { margin-bottom: 0; }
.ai-prose ul, .ai-prose ol { padding-left: 18px; margin: 0 0 8px 0; }
.ai-prose li { margin-bottom: 4px; font-size: 0.8rem; color: #334155; line-height: 1.5; }
.ai-prose strong { font-weight: 700; color: #0F172A; }
.ai-prose em { font-style: italic; color: #475569; }
.ai-prose h1 { font-size: 0.92rem; font-weight: 800; margin: 12px 0 6px; color: #0F172A;
               border-bottom: 1px solid #F1F5F9; padding-bottom: 3px; }
.ai-prose h2 { font-size: 0.88rem; font-weight: 800; margin: 10px 0 5px; color: #0F172A;
               border-bottom: 1px solid #F1F5F9; padding-bottom: 3px; }
.ai-prose h3 { font-size: 0.84rem; font-weight: 800; margin: 8px 0 4px; color: #1E293B; }
.ai-prose h4 { font-size: 0.80rem; font-weight: 700; margin: 6px 0 3px; color: #334155; }
.ai-prose code { font-family: 'Courier New', monospace; background: #F1F5F9;
                 padding: 1px 5px; border-radius: 4px; font-size: 0.76rem; color: #0F172A; }
.ai-prose pre  { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 8px;
                 padding: 10px 12px; overflow-x: auto; margin-bottom: 8px; font-size: 0.78rem; }
.ai-prose pre code { background: none; padding: 0; }
.ai-prose blockquote { border-left: 3px solid #6366F1; margin: 0 0 8px 0;
                        padding: 5px 10px; background: #F8FAFC; border-radius: 0 6px 6px 0;
                        color: #475569; font-style: italic; font-size: 0.78rem; }
.ai-prose del { color: #94A3B8; }
.ai-prose hr  { border: none; border-top: 1px solid #E2E8F0; margin: 10px 0; }

/* ── Reorder Analysis KPI Grid ──────────────────────────────────────────── */
.reorder-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.reorder-kpi-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.reorder-kpi-label {
  font-size: 0.63rem;
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.reorder-kpi-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0F172A;
}
.stockout-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #991B1B;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Sync Diagnosis Structured Cards ────────────────────────────────────── */
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.severity-critical { background: #FEE2E2; color: #991B1B; }
.severity-high     { background: #FEF3C7; color: #92400E; }
.severity-medium   { background: #E0E7FF; color: #3730A3; }
.severity-low      { background: #D1FAE5; color: #065F46; }

/* ── Tool-Use Badge Chips (Token Usage Card) ────────────────────────────── */
.tool-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #EEF2FF;
  color: #4338CA;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  margin: 2px 2px 2px 0;
  font-family: 'Inter', sans-serif;
}

/* ── 23. AI PROSE & COPILOT RESPONSIVE DATA TABLES ───────────────── */
.ai-prose {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.84rem;
  color: #1E293B;
  line-height: 1.65;
}

.ai-prose p { margin: 0 0 10px 0; line-height: 1.6; }
.ai-prose p:last-child { margin-bottom: 0; }

.ai-prose h1, .ai-prose h2, .ai-prose h3, .ai-prose h4 {
  color: #0F172A;
  font-weight: 800;
  margin: 14px 0 8px 0;
  letter-spacing: -0.01em;
}
.ai-prose h1 { font-size: 1.05rem; }
.ai-prose h2 { font-size: 0.98rem; }
.ai-prose h3 { font-size: 0.90rem; }

.ai-prose ul, .ai-prose ol { margin: 8px 0 12px 0; padding-left: 20px; }
.ai-prose li { margin-bottom: 4px; color: #334155; }
.ai-prose strong { color: #0F172A; font-weight: 700; }

.ai-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  font-size: 0.78rem;
  background: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(11,25,44,0.04);
}
.ai-prose th {
  background: linear-gradient(135deg, #0B192C, #1E293B);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 2px solid #FF6B00;
  text-align: left;
  white-space: nowrap;
}
.ai-prose td {
  padding: 9px 14px;
  color: #334155;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  white-space: nowrap;
}
.ai-prose tbody tr:nth-child(even) td { background-color: #F8FAFC; }
.ai-prose tbody tr:hover td { background-color: #FFF7ED; }
.ai-prose tbody tr:last-child td { border-bottom: none; }
.ai-prose code {
  background: #F1F5F9;
  color: #EA580C;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.82em;
  border: 1px solid #E2E8F0;
}

