@font-face {
  font-family: "Outfit";
  src: url("/asset/fonts/Outfit.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/asset/fonts/Outfit-ExtraBold.ttf") format("truetype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
/* ===== style.css ===== */
/* ==========================================================================
   FPS Assistance - Premium Design System & Modern CSS
   ========================================================================== */

:root {
  /* Color Palette - Light production default */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-hover: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.14);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Accent Colors */
  --brand-teal: #087272;
  --brand-teal-dark: #065f5f;
  --brand-teal-light: #0b8a8a;
  --brand-teal-glow: rgba(8, 114, 114, 0.28);
  --accent-blue: var(--brand-teal);
  --accent-blue-glow: var(--brand-teal-glow);
  --accent-green: var(--brand-teal);
  --accent-green-glow: var(--brand-teal-glow);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-red: #ef4444;

  /* Typography */
  --font-heading: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--brand-teal-glow);
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.14);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(8, 114, 114, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-panel:hover {
  border-color: var(--border-highlight);
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.88);
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}

.app-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 14px; box-shadow: 0 5px 14px var(--brand-teal-glow); }

.logo-icon {
  font-size: 1.25rem;
}

.badge-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-green);
  text-transform: uppercase;
}

.nav-title {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #bfeeee 10%, var(--brand-teal-light) 55%, var(--brand-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .nav-title {
  background: linear-gradient(135deg, var(--brand-teal-dark) 20%, var(--brand-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-meta { display: flex; align-items: center; gap: 0.9rem; color: var(--text-secondary); font-size: 0.74rem; }
.header-meta span { display: flex; flex-direction: column; gap: 0.12rem; white-space: nowrap; }
.header-meta small { color: var(--text-muted); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.07em; }
.header-meta b { color: var(--text-primary); font-weight: 600; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  background: rgba(8, 114, 114, 0.12);
  border: 1px solid rgba(8, 114, 114, 0.28);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-green);
}
.live-pill b { font-size: 0.7rem; letter-spacing: 0.08em; color: #78d7d7; }

.pulsing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse-ring 2s infinite ease-out;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(8, 114, 114, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(8, 114, 114, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(8, 114, 114, 0); }
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.auth-btn { padding: 0.5rem 0.85rem; border: 1px solid var(--border-highlight); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.auth-btn:hover { border-color: var(--brand-teal); color: #78d7d7; }
.auth-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(5, 12, 24, 0.76); backdrop-filter: blur(6px); }
.auth-overlay[hidden] { display: none !important; }
.login-card { width: min(100%, 390px); padding: 1.75rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid rgba(8, 114, 114, 0.45); box-shadow: 0 20px 60px var(--brand-teal-glow); display: flex; flex-direction: column; gap: 0.65rem; }
.login-brand { display: flex; align-items: center; gap: 0.85rem; }
.login-mark { width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto; }
.login-brand .nav-title { margin: 0; background: none; color: #087272; -webkit-text-fill-color: #087272; }
.login-card h2 { margin: 0.25rem 0 0; font-size: 1.3rem; color: var(--text-primary); }
.brand-name { color: var(--brand-teal); }
.login-card p { margin: 0 0 0.6rem; color: var(--text-secondary); font-size: 0.86rem; }
.login-card label { color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; }
.login-card input { padding: 0.7rem; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); font: inherit; }
.login-card .primary-btn { margin-top: 0.5rem; justify-content: center; background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-light)); box-shadow: 0 5px 16px var(--brand-teal-glow); }
.login-card .primary-btn:hover { background: linear-gradient(135deg, var(--brand-teal-dark), var(--brand-teal)); }
.auth-secondary-btn { padding: 0.65rem 0.8rem; border: 1px solid var(--border-highlight); border-radius: 8px; background: transparent; color: var(--brand-teal-light); cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.03em; }
.auth-secondary-btn:hover { border-color: var(--brand-teal); background: rgba(8, 114, 114, 0.1); }
.login-error { min-height: 1.1rem; margin: 0 !important; color: #fda4af !important; }
.field-help { margin-top: 0.35rem; display: block; color: var(--text-muted); font-size: 0.7rem; }
.onboarding-card { width: min(100%, 560px); max-height: min(92vh, 720px); overflow-y: auto; padding: 1.6rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid rgba(8, 114, 114, 0.45); box-shadow: 0 20px 60px var(--brand-teal-glow); }
.onboarding-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.onboarding-header h2 { margin: 0.25rem 0; font-size: 1.35rem; }
.onboarding-header p, .onboarding-help { color: var(--text-secondary); font-size: 0.84rem; }
.onboarding-step { display: none; gap: 0.75rem; }
.onboarding-step.active { display: grid; }
.onboarding-step label { color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; display: grid; gap: 0.35rem; }
.onboarding-readonly { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 1rem; padding: 0.9rem; border-radius: var(--radius-sm); background: var(--bg-secondary); }
.onboarding-readonly span { color: var(--text-muted); font-size: 0.7rem; }
.onboarding-readonly strong { font-size: 0.9rem; }
.verify-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; display: flex !important; gap: 0.5rem !important; }
.verify-check input { accent-color: var(--brand-teal); }
.onboarding-plans { display: grid; gap: 0.55rem; }
.onboarding-plan { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-secondary); cursor: pointer; }
.onboarding-plan:has(input:checked) { border-color: var(--brand-teal); box-shadow: 0 0 0 1px var(--brand-teal); }
.onboarding-plan input { accent-color: var(--brand-teal); }
.onboarding-plan-copy { display: grid; flex: 1; }
.onboarding-plan-copy small { color: var(--text-secondary); }
.onboarding-summary { display: grid; gap: 0.65rem; padding: 1rem; border-radius: var(--radius-md); background: rgba(8, 114, 114, 0.12); border: 1px solid rgba(8, 114, 114, 0.28); }
.onboarding-summary strong { font-size: 1.15rem; }
.onboarding-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
@media (max-width: 560px) { .onboarding-card { padding: 1.15rem; } .onboarding-readonly { grid-template-columns: 1fr; } }

/* Main Layout */
.main-layout {
  max-width: 1540px;
  margin: 1.5rem auto;
  padding: 0 1.25rem;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Super-admin workspace */
.admin-dashboard { max-width: 1380px; width: 100%; margin: 1.5rem auto; padding: 0 1.25rem; }
.admin-shell .dashboard-sidebar { border-top: 3px solid var(--brand-teal); }
.admin-avatar { cursor: default; margin-bottom: 0.85rem; }
.admin-shell .sidebar-nav .tab-btn.active { background: rgba(8, 114, 114, 0.16); color: #78d7d7; }
.admin-hero { padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-left: 4px solid var(--brand-teal); }
.admin-eyebrow { color: var(--brand-teal-light); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
.admin-hero h2 { font-family: var(--font-heading); font-size: 1.7rem; margin: 0.15rem 0; }
.admin-hero p { color: var(--text-secondary); }
.admin-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.admin-kpi { padding: 1.1rem 1.25rem; border-top: 3px solid var(--brand-teal); }
.admin-kpi span { display: block; color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-kpi strong { font-family: var(--font-heading); font-size: 2rem; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(300px, 1.1fr); gap: 1rem; margin-bottom: 1rem; }
.admin-panel { padding: 1.25rem; }
.admin-panel h3 { font-family: var(--font-heading); font-size: 1.15rem; }
.admin-panel-note { margin: 0.25rem 0 1rem; color: var(--text-secondary); font-size: 0.82rem; }
.admin-panel label { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.65rem 0; color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; }
.admin-panel input { padding: 0.68rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); font: inherit; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.plan-list { display: grid; gap: 0.65rem; }
.plan-card { padding: 0.8rem; background: var(--bg-secondary); border: 1px solid var(--border-color); border-left: 3px solid var(--brand-teal); border-radius: var(--radius-sm); display: flex; justify-content: space-between; gap: 1rem; }
.plan-card strong { font-family: var(--font-heading); }
.plan-card small { color: var(--text-secondary); }
.admin-table-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.admin-table-heading .search-input { max-width: 290px; padding-left: 0.85rem; }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-actions select { padding: 0.3rem; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); }
@media (max-width: 760px) { .admin-kpis, .admin-grid { grid-template-columns: 1fr; } .admin-hero, .admin-table-heading { align-items: stretch; flex-direction: column; } .admin-table-heading .search-input { max-width: none; } }

.dashboard-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
}

.dashboard-workspace { min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }

.dashboard-sidebar {
  position: sticky;
  top: 1rem;
  overflow: hidden;
  padding: 0.8rem;
}

.fps-profile { padding: 0.8rem; border-bottom: 1px solid var(--border-color); }
.profile-avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--brand-teal-light), var(--brand-teal-dark)); color: #fff; font-size: 1.3rem; font-weight: 800; margin-bottom: 0.85rem; cursor: pointer; background-size: cover; background-position: center; border: 2px solid rgba(120, 215, 215, 0.45); }
.profile-avatar:hover { filter: brightness(1.12); }
.profile-avatar.has-photo span { display: none; }
.profile-photo-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.profile-eyebrow, .sidebar-nav-label { margin: 0; color: var(--text-muted); font-size: 0.68rem; letter-spacing: 0.09em; font-weight: 700; }
.fps-profile h2 { font-size: 1rem; margin: 0.35rem 0; font-family: var(--font-heading); }
.profile-fps { display: inline-block; font-family: monospace; color: #93c5fd; font-size: 0.78rem; }
.profile-details { margin: 1rem 0; display: grid; gap: 0.55rem; }
.profile-details div { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; }
.profile-details dt { color: var(--text-muted); }
.profile-details dd { margin: 0; color: var(--text-primary); font-weight: 600; text-align: right; }
.sidebar-share { width: 100%; padding: 0.55rem; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer; font: inherit; font-size: 0.78rem; }
.sidebar-nav { padding: 0.8rem 0 0.2rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav-label { padding: 0 0.8rem 0.4rem; }
.sidebar-nav .tab-btn { width: 100%; border-radius: 8px; border: 0; padding: 0.7rem 0.75rem; text-align: left; }
.sidebar-nav .tab-btn span:nth-child(2) { flex: 1; }
.sidebar-nav .tab-btn.active { border: 0; background: rgba(59, 130, 246, 0.16); }
.sidebar-nav .tab-btn.active::after { display: none; }

/* Control Card */
.control-card {
  padding: 1.5rem;
}

/* An FPS dealer is permanently scoped to the shop in their registration. */
.fps-user-session .control-card { display: block; }
.fps-user-session .control-card .section-title-wrap,
.fps-user-session .control-card .form-grid > :not(.form-action-wrap) { display: none; }
.fps-user-session .control-card .form-grid {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  display: flex;
  transform: translateY(-50%);
}
.fps-user-session .control-card {
  position: relative;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.fps-user-session .control-card .control-header {
  margin-bottom: 0;
  padding-right: 13rem;
  padding-bottom: 0;
  border-bottom: 0;
}

@media (max-width: 760px) {
  .fps-user-session .control-card .control-header {
    padding-right: 0;
  }

  .fps-user-session .control-card .form-grid {
    position: static;
    justify-content: center;
    margin-top: 0.7rem;
    transform: none;
  }
}

.control-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.period-selector {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(8, 114, 114, 0.35);
  border-radius: var(--radius-md);
  background: rgba(8, 114, 114, 0.08);
}

.period-selector .form-control { min-width: 145px; }
.period-selector > .form-group { position: relative; z-index: 1; }

.period-progress-ring {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 3px solid rgba(8, 114, 114, 0.18);
  border-top-color: var(--brand-teal);
  border-right-color: var(--brand-teal-light);
  border-radius: 50%;
  margin-left: 0.15rem;
}

.period-progress-ring[hidden] { display: none; }

.period-selector.is-loading {
  position: relative;
  border-color: rgba(8, 114, 114, 0.45);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-icon {
  font-size: 1.6rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.preset-pills-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.preset-btn.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  color: #93c5fd;
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

.preset-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.preset-dot.green { background-color: var(--accent-green); }
.preset-dot.blue { background-color: var(--accent-blue); }

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 1rem;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px var(--brand-teal-glow);
}

.form-row-mini {
  display: flex;
  gap: 0.5rem;
}

.form-action-wrap {
  display: flex;
  align-items: flex-end;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-light));
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.68rem 1.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px var(--brand-teal-glow);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--brand-teal-light), var(--brand-teal));
  box-shadow: 0 6px 20px rgba(8, 114, 114, 0.45);
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shop Banner */
.shop-banner {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-left: 4px solid var(--accent-blue);
}

.shop-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.3rem;
}

.shop-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.shop-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shop-banner-meta {
  display: flex;
  gap: 1.5rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.card-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-card.card-green::before { background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light)); }
.kpi-card.card-amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi-card.card-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.kpi-card.card-red::before { background: linear-gradient(90deg, #dc2626, #f87171); }

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg);
}

.kpi-card[data-report-target] {
  cursor: pointer;
}

.kpi-card[data-report-target]:focus-visible {
  outline: 3px solid var(--brand-teal-light);
  outline-offset: 3px;
}

.kpi-icon-wrap {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.kpi-content {
  flex: 1;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.2rem 0;
}

.kpi-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.alert-text {
  color: var(--accent-amber);
  font-weight: 600;
}

.kpi-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 999px;
  margin: 0.4rem 0;
  overflow: hidden;
}

.kpi-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tabs Navigation */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab-btn.active {
  color: var(--brand-teal-light);
  background: var(--bg-card);
  border-color: var(--border-color);
  border-bottom-color: var(--bg-card);
  position: relative;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-teal);
}

.tab-count-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-green {
  background: rgba(8, 114, 114, 0.2);
  color: #78d7d7;
  border: 1px solid rgba(8, 114, 114, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tab-pulse-badge {
  padding: 0.15rem 0.45rem;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tab Content */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-content.active {
  display: flex;
}

/* The ledger has its own commodity cards, so hide the dashboard KPI cards there. */
.ledger-report-active .kpi-grid {
  display: none;
}

.telegram-manual-active .control-card {
  display: none;
}

.telegram-manual-active .kpi-grid {
  display: none;
}

.registered-cards-active .control-card {
  display: none;
}

.registered-cards-active .kpi-grid {
  display: none;
}

.registered-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.registered-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  border-top: 3px solid var(--brand-teal);
}

.registered-summary-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.registered-summary-card strong {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1rem;
}

.registered-summary-count {
  color: var(--brand-teal-light);
  font-size: 1.35rem;
  font-weight: 800;
}

.kpi-card.card-red .kpi-caption.alert-text {
  color: var(--accent-red);
}

.detail-modal[hidden] {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.language-toggle {
  min-width: 4.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: 0.45rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.hindi-language {
  font-family: "Noto Sans Devanagari", "Nirmala UI", var(--font-body);
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 15, 24, 0.72);
}

.detail-modal-card {
  width: min(100%, 960px);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.registered-card-transactions-card {
  width: min(100%, 900px);
}

.detail-modal-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-card);
}

.detail-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
  margin-left: auto;
}

.detail-modal-header h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}

.detail-modal-eyebrow,
.detail-period-eyebrow,
.detail-section-heading span {
  display: block;
  color: var(--brand-teal-light);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.detail-modal-eyebrow {
  margin-bottom: 0.2rem;
}

.registered-card-modal-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.registered-card-modal-identity .card-detail-heading-main {
  flex: 1;
}

.registered-card-modal-identity .card-detail-heading-main h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.registered-card-modal-identity .card-detail-heading-main span {
  display: block;
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 0.72rem;
}

.detail-modal-body {
  display: flex;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: #101a31;
}

.card-detail-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.1rem 0 0.2rem;
}

.card-detail-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  place-items: center;
  border: 1px solid var(--brand-teal);
  border-radius: 0.85rem;
  background: rgba(0, 183, 169, 0.14);
  color: var(--brand-teal-light);
  font-size: 1.35rem;
  font-weight: 800;
}

.card-detail-heading-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
}

.card-detail-heading-main strong {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.card-detail-heading-main span,
.card-detail-panel p,
.card-detail-members-heading > span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.card-detail-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.card-detail-panel {
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(97, 141, 202, 0.28);
  border-radius: 1rem;
  background: rgba(3, 10, 29, 0.7);
}

.card-detail-panel h3,
.card-detail-members-heading h3 {
  margin: 0 0 0.85rem;
  color: var(--brand-teal-light);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.card-detail-panel h3 span {
  font-weight: 500;
}

.card-detail-name {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.card-detail-panel p {
  margin: 0.35rem 0;
}

.card-detail-panel b {
  color: var(--text-primary);
}

.card-detail-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.7rem;
}

/* Card Profile WhatsApp Row & Actions */
.card-detail-whatsapp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 0.55rem 0.75rem;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: 0.65rem;
}

.card-detail-whatsapp-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-whatsapp-wrapper {
  display: inline-flex;
  align-items: center;
}

.card-whatsapp-view {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.card-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.16);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #25d366;
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.card-whatsapp-link:hover {
  background: rgba(37, 211, 102, 0.28);
  border-color: #25d366;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.35);
}

.card-icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-icon-action-btn:hover {
  background: rgba(0, 183, 169, 0.2);
  border-color: var(--brand-teal-light);
  color: #00f0ff;
}

.card-icon-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #f87171;
}

.card-whatsapp-empty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.card-whatsapp-empty-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.card-whatsapp-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px dashed rgba(37, 211, 102, 0.45);
  color: #25d366;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-whatsapp-add-btn:hover {
  background: rgba(37, 211, 102, 0.24);
  border-style: solid;
}

.card-whatsapp-edit-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-whatsapp-input {
  width: 135px;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--brand-teal);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

.card-whatsapp-save-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: #25d366;
  border: none;
  color: #051a0e;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.card-whatsapp-save-btn:hover {
  background: #1eb956;
}

.card-whatsapp-cancel-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
}

.card-whatsapp-cancel-btn:hover {
  color: var(--text-primary);
}

.card-detail-members {
  margin-top: 0.4rem;
}

.card-detail-members-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.card-detail-members-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(97, 141, 202, 0.28);
  border-radius: 0.95rem;
}

.card-detail-members-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: rgba(3, 10, 29, 0.78);
}

.card-detail-members-table th,
.card-detail-members-table td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid rgba(97, 141, 202, 0.18);
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-align: left;
}

.card-detail-members-table th {
  color: #9baac4;
  font-weight: 700;
}

.card-detail-members-table td strong {
  color: var(--text-primary);
}

.card-detail-kyc {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(202, 125, 0, 0.28);
  color: #f0b44c;
  font-size: 0.7rem;
}

.card-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.registered-card-transactions-card {
  max-width: 820px;
  width: 95%;
}

/* Month Navigation Control Bar */
.txn-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(8, 114, 114, 0.16), rgba(12, 20, 39, 0.85));
  border: 1px solid rgba(0, 183, 169, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 0.85rem;
}

.txn-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 183, 169, 0.38);
  background: rgba(0, 183, 169, 0.12);
  color: var(--brand-teal-light);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.txn-nav-btn:hover:not(:disabled) {
  background: rgba(0, 183, 169, 0.26);
  border-color: var(--brand-teal-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 183, 169, 0.25);
}

.txn-nav-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.txn-nav-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.txn-nav-btn .txn-arrow-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.txn-nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  min-width: 0;
}

.txn-nav-month-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.txn-nav-month-hi {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

.txn-nav-indicators {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.txn-badge-current {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.35);
  color: #00e676;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.txn-jump-current-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 183, 169, 0.1);
  border: 1px dashed rgba(0, 183, 169, 0.5);
  color: var(--brand-teal-light);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.txn-jump-current-btn:hover {
  background: rgba(0, 183, 169, 0.22);
  border-style: solid;
  color: #fff;
}

/* Flash Card (Tile) Design */
.txn-flash-card {
  position: relative;
  padding: 1.35rem 1.45rem;
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(14, 23, 44, 0.95), rgba(7, 13, 26, 0.98));
  border: 1px solid rgba(0, 183, 169, 0.32);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: txnCardAppear 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.txn-flash-card.is-completed {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.txn-flash-card.is-pending {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.txn-flash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.txn-flash-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.txn-flash-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-teal-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.txn-flash-period-name {
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.txn-entitled-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

.txn-entitled-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.txn-entitled-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.txn-entitled-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(0, 183, 169, 0.12);
  border: 1px solid rgba(0, 183, 169, 0.3);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.txn-entitled-chip strong {
  color: #00f0ff;
  font-weight: 800;
}

.txn-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.txn-status-badge.completed {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.txn-status-badge.pending {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.txn-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Metric Tiles Grid */
.txn-metric-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}

.txn-metric-tiles.txn-metric-tiles-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1.1rem;
  margin-bottom: 0.5rem;
}

.txn-metric-tile {
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(97, 141, 202, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.txn-metric-tile:hover {
  border-color: rgba(0, 183, 169, 0.4);
  transform: translateY(-1px);
}

.txn-metric-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.txn-metric-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.txn-metric-value.highlight {
  color: #00f0ff;
}

.txn-metric-value.success {
  color: #34d399;
}

/* Section Title */
.txn-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-teal-light);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.txn-section-title span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Commodities Grid */
.txn-commodities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
}

.txn-comm-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.95rem;
  border-radius: 0.85rem;
  background: rgba(8, 114, 114, 0.08);
  border: 1px solid rgba(0, 183, 169, 0.22);
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.txn-comm-card:hover {
  border-color: rgba(0, 183, 169, 0.45);
  background: rgba(8, 114, 114, 0.15);
}

.txn-comm-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.txn-comm-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.txn-comm-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.txn-comm-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-comm-meta {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.txn-comm-qty {
  padding: 0.25rem 0.55rem;
  border-radius: 0.4rem;
  background: rgba(0, 183, 169, 0.15);
  border: 1px solid rgba(0, 183, 169, 0.3);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Info Strip for Metadata */
.txn-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.txn-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.txn-meta-pill strong {
  color: var(--text-primary);
}

/* Pending Box */
.txn-pending-box {
  padding: 1.2rem 1.35rem;
  border-radius: 0.95rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.32);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.txn-pending-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fbbf24;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

.txn-pending-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Loading State */
.txn-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem;
  gap: 1rem;
  color: var(--text-secondary);
}

.txn-loading-spinner {
  width: 2.2rem;
  height: 2.2rem;
  border: 3px solid rgba(0, 183, 169, 0.2);
  border-top-color: var(--brand-teal-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Footer Actions */
.txn-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.85rem;
}

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

.detail-period-selector {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.detail-period-selector > div {
  flex: 1;
}

.detail-period-selector > label {
  margin-left: 0.35rem;
}

.detail-period-selector strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.detail-period-selector label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.detail-period-selector .form-control {
  min-width: 125px;
  padding: 0.45rem 0.6rem;
}

.detail-loading,
.detail-error {
  margin: 0;
  color: var(--text-secondary);
}

.detail-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 5rem;
  justify-content: center;
}

.detail-loading::before {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--brand-teal-light);
  border-radius: 50%;
  content: "";
  animation: detail-spin 0.8s linear infinite;
}

@keyframes detail-spin {
  to { transform: rotate(360deg); }
}

.detail-error {
  color: #fda4af;
}

.detail-data-section {
  padding: 0.9rem;
  border-left: 3px solid var(--brand-teal-light);
  background: rgba(8, 114, 114, 0.08);
}

.detail-period-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-top: 0.25rem;
}

.monthly-snapshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(8, 114, 114, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(8, 114, 114, 0.1);
}

.monthly-snapshot-header > div:first-child {
  min-width: 0;
}

.monthly-snapshot-header > div:first-child strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.monthly-snapshot-header .detail-period-selector {
  margin: 0;
  padding: 0;
  background: transparent;
}

.monthly-snapshot-header .detail-period-selector label {
  font-size: 0.67rem;
}

.monthly-snapshot-header .detail-period-selector .form-control {
  min-width: 0;
  width: 5.7rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.76rem;
}

.detail-data-section h3,
.detail-data-section p {
  margin: 0;
}

.detail-data-section p {
  margin-top: 0.5rem;
}

.detail-commodity-section {
  padding: 0.75rem 0.9rem;
}

.detail-commodity-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.55rem;
}

.detail-commodity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
}

.detail-commodity-row:last-child {
  border-bottom: 0;
}

.detail-commodity-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

.detail-commodity-row span {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-commodity-row span b {
  margin: 0 0.3rem;
  color: var(--brand-teal-light);
}

.detail-commodity-row em {
  margin-left: 0.35rem;
  color: var(--accent-green);
  font-size: 0.72rem;
  font-style: normal;
}

.detail-empty,
.detail-transaction-meta {
  color: var(--text-secondary);
}

.detail-empty {
  margin: 0 !important;
  font-size: 0.82rem;
}

.detail-transaction-meta {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-grid span {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.future-detail-section {
  padding: 0.9rem;
  border-left: 3px solid var(--brand-teal);
  background: rgba(8, 114, 114, 0.08);
}

.future-detail-section h3,
.future-detail-section p {
  margin: 0;
}

.detail-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(8, 114, 114, 0.3);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(8, 114, 114, 0.2), rgba(8, 114, 114, 0.05));
}

.detail-profile-avatar {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  flex: 0 0 3rem;
  border-radius: 50%;
  background: var(--brand-teal);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.detail-profile-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-profile-main strong {
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-profile-main span {
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 0.78rem;
}

.detail-card-type {
  max-width: 42%;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(8, 114, 114, 0.25);
  color: var(--brand-teal-light);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
}

.registered-detail-btn {
  min-width: 5.5rem;
  justify-content: center;
}

.detail-all-months-btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

.detail-all-months-section {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.detail-history-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) repeat(3, minmax(7rem, 1fr));
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.detail-history-row strong {
  color: var(--text-primary);
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.detail-section-heading strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.detail-metric-grid > div {
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  text-align: center;
}

.detail-metric-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.detail-metric-grid strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.detail-status-success {
  color: var(--accent-green) !important;
}

.detail-status-muted {
  color: var(--text-muted) !important;
}

@media (max-width: 600px) {
  .detail-modal {
    padding: 0.5rem;
    align-items: end;
  }

  .detail-modal-card {
    max-height: 94vh;
    padding: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .detail-modal-body {
    padding: 1rem;
  }

  .card-detail-panels {
    grid-template-columns: 1fr;
  }

  .card-detail-inline {
    grid-template-columns: 1fr;
  }

  .card-detail-members-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .registered-card-history-heading {
    align-items: flex-start;
    flex-direction: column;
  }


  .detail-period-selector {
    flex-wrap: wrap;
  }

  .detail-period-selector > div {
    flex-basis: 100%;
  }

  .detail-period-selector > label {
    margin-left: 0;
  }

  .detail-period-selector .form-control {
    flex: 1;
    min-width: 0;
  }

  .monthly-snapshot-header {
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-snapshot-header .detail-period-selector {
    justify-content: flex-end;
  }

  .monthly-snapshot-header .detail-period-selector > label {
    margin-left: 0;
  }

  .detail-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-profile {
    align-items: flex-start;
  }

  .detail-card-type {
    max-width: 38%;
  }
}

.future-detail-section p {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

/* Operator exception reports */
.report-intro {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-intro h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.report-intro p { margin: 0; color: var(--text-secondary); font-size: 0.86rem; max-width: 760px; }
.report-stat-group { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.report-summary-pill, .portability-tag, .variance-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.report-summary-pill { background: rgba(8, 114, 114, 0.16); color: #78d7d7; border: 1px solid rgba(8, 114, 114, 0.3); }
.report-summary-alert { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.variance-short { color: #fbbf24; font-weight: 700; }
.variance-excess { color: #fb7185; font-weight: 700; }
.variance-status.short { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.variance-status.excess { background: rgba(244, 63, 94, 0.18); color: #fda4af; }
.portability-tag.self { background: rgba(8, 114, 114, 0.18); color: #78d7d7; }
.portability-tag.other { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
.report-empty { padding: 2.5rem; text-align: center; color: var(--text-secondary); }
.registration-status { font-weight: 700; }
.registration-status.complete { color: var(--accent-green); }
.registration-status.pending { color: var(--accent-amber); }

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

/* Table Toolbar */
.table-toolbar {
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

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

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px var(--brand-teal-glow);
}

.toolbar-filters {
  display: flex;
  gap: 0.5rem;
}

.filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  outline: none;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.export-icon {
  width: 1.25rem;
  height: 1.35rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.action-btn:hover {
  background: var(--brand-teal-dark);
  transform: translateY(-1px);
}

.action-btn.secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.action-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn-sm:hover {
  background: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

.stat-pill-group {
  display: flex;
  gap: 0.5rem;
}

.stat-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
}

.stat-pill.highlight {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

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

.rc-cell {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: #93c5fd;
}

.scheme-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.scheme-PHH { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.scheme-AAY { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.3); }
.scheme-APL { background: rgba(107, 114, 128, 0.2); color: #e5e7eb; border: 1px solid rgba(107, 114, 128, 0.3); }
.scheme-SAAY { background: rgba(236, 72, 153, 0.2); color: #fbcfe8; border: 1px solid rgba(236, 72, 153, 0.3); }
.scheme-SPHH { background: rgba(8, 114, 114, 0.2); color: #9be0e0; border: 1px solid rgba(8, 114, 114, 0.3); }

.entitlement-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
}

.chip b {
  color: var(--accent-green);
}

.table-action-btn {
  padding: 0.3rem 0.65rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-action-btn:hover {
  background: var(--brand-teal);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.loading-state {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-muted);
}

.pulse-loader {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.8rem;
  border: 3px solid rgba(8, 114, 114, 0.2);
  border-top-color: var(--brand-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.page-btn-group {
  display: flex;
  gap: 0.35rem;
}

.page-btn {
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

.page-btn.active {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Commodity Ledger Cards */
.ledger-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

.comm-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-md);
}

.comm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comm-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.comm-pct-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 114, 114, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(8, 114, 114, 0.3);
}

.comm-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.comm-stat {
  display: flex;
  flex-direction: column;
}

.comm-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.comm-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
}

.comm-stat-val.balance {
  color: var(--accent-amber);
}

.table-header-title {
  padding: 1rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

/* Bot Assistant Simulator Layout */
.bot-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .header-meta { display: none; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; }
  .fps-profile { display: grid; grid-template-columns: auto 1fr; column-gap: 0.8rem; }
  .profile-avatar { grid-row: span 2; margin: 0; }
  .profile-details, .sidebar-share { grid-column: 1 / -1; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding-top: 0.8rem; }
  .sidebar-nav-label { display: none; }
  .sidebar-nav .tab-btn { width: auto; min-width: max-content; }
  .bot-layout {
    grid-template-columns: 1fr;
  }
}

.bot-info-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bot-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.status-text.online {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-green);
}

.bot-intro-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.quick-commands-box h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.command-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cmd-chip {
  padding: 0.4rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cmd-chip:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-purple);
  color: #c4b5fd;
  transform: translateY(-1px);
}

.telegram-integration-card {
  margin-top: auto;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-highlight);
  border-radius: var(--radius-md);
}

.telegram-integration-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #93c5fd;
}

.telegram-integration-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.setup-steps {
  padding-left: 1.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.setup-steps pre {
  margin-top: 0.3rem;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow-x: auto;
}

.setup-steps code {
  color: var(--accent-green);
  font-family: monospace;
}

/* Chat Simulator Widget */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 0.85rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chat-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(8, 114, 114, 0.6);
}

.chat-bot-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}

.chat-bot-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.clear-chat-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.clear-chat-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  max-width: 85%;
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
}

.msg-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.bot-message .msg-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.user-message .msg-bubble {
  background: linear-gradient(135deg, var(--brand-teal), var(--brand-teal-dark));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg-author {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 0.25rem;
}

.user-message .msg-author {
  color: rgba(255, 255, 255, 0.8);
}

.msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.35rem;
}

.user-message .msg-time {
  color: rgba(255, 255, 255, 0.7);
}

.chat-input-bar {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.65rem;
}

.chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.chat-input:focus {
  border-color: var(--brand-teal);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-teal);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--brand-teal-dark);
  transform: scale(1.05);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

.toast.show {
  display: block;
}

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

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #78d7d7;
  font-family: var(--font-heading);
  font-weight: 800;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
}

.footer-sub {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-sub a { color: #78d7d7; text-decoration: none; font-weight: 600; }
.footer-sub a:hover { text-decoration: underline; }

/* Print Styles */
@media print {
  .navbar, .control-card, .tab-nav, .table-toolbar, .footer, .pagination-bar, #tabCompleted, #tabLedger, #tabBot, .history-timeline-wrap, .historical-banner {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .glass-panel {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    background: none !important;
  }
  .data-table th, .data-table td {
    color: #000000 !important;
    border-color: #cccccc !important;
  }
}

/* ==========================================================================
   Historical 2025+ Sync Timeline & Abstract Styles
   ========================================================================== */

.history-timeline-wrap {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
}

.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.history-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.history-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.history-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.history-pill.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 0 12px var(--accent-blue-glow);
}

.history-pill .pill-period {
  font-weight: 600;
}

.history-pill .pill-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-secondary);
}

.history-pill.active .pill-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Historical Mode Banner & Schemes Table */
.historical-banner {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent-purple);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.04));
}

.hist-banner-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.hist-pill-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hist-pill {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #c4b5fd;
}

.hist-badge-verified {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 114, 114, 0.15);
  color: #78d7d7;
  border: 1px solid rgba(8, 114, 114, 0.3);
}

.hist-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.schemes-table-wrap {
  overflow-x: auto;
}

.schemes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.schemes-table th, .schemes-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.schemes-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.scheme-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.scheme-tag.nfsa {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.scheme-tag.state {
  background: rgba(8, 114, 114, 0.15);
  color: #78d7d7;
  border: 1px solid rgba(8, 114, 114, 0.3);
}

/* Phone layout: keep controls readable and prevent desktop-width content from
   forcing the page wider than the viewport. */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 14px;
  }

  .navbar {
    padding: 0.65rem 0.75rem;
  }

  .nav-container {
    align-items: flex-start;
    gap: 0.6rem;
  }

  .nav-brand {
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.55rem;
  }

  .logo-badge,
  .app-logo {
    width: 40px;
    height: 40px;
  }

  .nav-title {
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .nav-subtitle {
    max-width: 30ch;
    overflow: hidden;
    font-size: 0.65rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-actions {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .live-pill {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
  }

  .header-meta {
    display: none;
  }

  .auth-btn {
    padding: 0.42rem 0.6rem;
    font-size: 0.7rem;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .language-toggle {
    min-width: 3.5rem;
    padding: 0.38rem 0.45rem;
    font-size: 0.7rem;
  }

  .main-layout,
  .admin-dashboard {
    width: 100%;
    margin: 0.75rem auto;
    padding: 0 0.75rem;
    gap: 0.85rem;
  }

  .dashboard-shell,
  .dashboard-workspace {
    gap: 0.85rem;
  }

  .dashboard-sidebar {
    padding: 0.5rem;
    border-radius: var(--radius-md);
  }

  .fps-profile {
    padding: 0.55rem;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fps-profile h2 {
    overflow: hidden;
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0.7rem 0 0;
  }

  .profile-details div {
    display: block;
    font-size: 0.7rem;
  }

  .profile-details dd {
    overflow: hidden;
    margin-top: 0.1rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-nav {
    margin: 0 -0.5rem;
    padding: 0.55rem 0.5rem 0.15rem;
    scrollbar-width: thin;
  }

  .sidebar-nav .tab-btn {
    min-height: 2.7rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
  }

  .control-card,
  .bot-info-panel {
    padding: 1rem;
  }

  .control-header {
    align-items: stretch;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
  }

  .section-title-wrap {
    align-items: flex-start;
  }

  .section-icon {
    font-size: 1.35rem;
  }

  .section-title {
    font-size: 1rem;
  }

  .section-desc {
    font-size: 0.75rem;
  }

  .period-selector {
    width: 100%;
    align-items: stretch;
    padding: 0.5rem;
  }

  .period-selector .form-group {
    min-width: 0;
    flex: 1;
  }

  .period-selector .form-control {
    width: 100%;
    min-width: 0;
  }

  .period-progress-ring {
    align-self: flex-end;
    margin-bottom: 0.55rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .form-action-wrap,
  .form-action-wrap .primary-btn {
    width: 100%;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .kpi-card {
    min-width: 0;
    padding: 0.85rem;
    gap: 0.65rem;
    border-radius: var(--radius-md);
  }

  .kpi-icon-wrap {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 1.25rem;
  }

  .kpi-label {
    font-size: 0.65rem;
    line-height: 1.25;
  }

  .kpi-value {
    font-size: 1.45rem;
  }

  .kpi-caption {
    display: block;
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .table-toolbar,
  .report-intro {
    align-items: stretch;
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .search-input-wrap {
    width: 100%;
    min-width: 0;
  }

  .stat-pill-group,
  .toolbar-actions,
  .toolbar-filters,
  .report-stat-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-actions > .action-btn {
    flex: 1 1 10rem;
    justify-content: center;
  }

  .table-responsive {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 680px;
    font-size: 0.78rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.7rem;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .page-btn-group {
    flex-wrap: wrap;
  }

  .ledger-cards-grid,
  .registered-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .bot-layout {
    gap: 0.85rem;
  }

  .chat-container {
    height: min(70vh, 520px);
  }

  .chat-messages {
    padding: 0.85rem;
  }

  .message {
    max-width: 92%;
  }

  .chat-input-bar {
    padding: 0.6rem;
  }

  .chat-input {
    min-width: 0;
    padding: 0.6rem 0.85rem;
  }

  .admin-hero {
    padding: 1rem;
  }

  .admin-hero h2 {
    font-size: 1.35rem;
  }

  .admin-panel {
    padding: 1rem;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-table-heading {
    align-items: stretch;
  }

  .admin-table-heading .search-input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-container {
    align-items: center;
  }

  .nav-subtitle,
  .live-pill {
    display: none;
  }

  .nav-actions {
    flex-wrap: nowrap;
  }

  .auth-btn {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .main-layout,
  .admin-dashboard {
    padding: 0 0.55rem;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .profile-details div {
    display: flex;
    justify-content: space-between;
  }

  .profile-details dd {
    margin-top: 0;
    text-align: right;
  }

  .kpi-grid,
  .ledger-cards-grid,
  .registered-summary-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    align-items: center;
  }

  .period-selector {
    gap: 0.4rem;
  }

  .period-progress-ring {
    display: none;
  }

  .detail-modal {
    padding: 0;
  }

  .detail-modal-card {
    width: 100%;
    max-height: 96vh;
    border-right: 0;
    border-left: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .monthly-snapshot-header .detail-period-selector {
    justify-content: stretch;
  }

  .monthly-snapshot-header .detail-period-selector .form-control {
    width: 100%;
  }

  .detail-profile {
    flex-wrap: wrap;
  }

  .detail-card-type {
    max-width: none;
    margin-left: 3.8rem;
  }

  .footer {
    padding: 1rem 0.75rem;
  }
}

/* ========================================================================== 
   Material Design 3 Refresh — 2026-09-19
   This layer intentionally overrides the legacy glassmorphism skin while
   preserving all existing DOM IDs and JavaScript behavior.
   ========================================================================== */

body.md3 {
  --md-primary: #2f6b56;
  --md-on-primary: #ffffff;
  --md-primary-container: #b8f0d3;
  --md-on-primary-container: #0b3828;
  --md-secondary: #50635a;
  --md-secondary-container: #d3e8dd;
  --md-on-secondary-container: #21352c;
  --md-tertiary: #3d6470;
  --md-tertiary-container: #c1e9f7;
  --md-error: #ba1a1a;
  --md-error-container: #ffdad6;
  --md-warning: #8a5a00;
  --md-warning-container: #ffdea6;
  --md-surface: #f8faf7;
  --md-surface-container-lowest: #ffffff;
  --md-surface-container-low: #f2f5f1;
  --md-surface-container: #ecefeb;
  --md-surface-container-high: #e6e9e5;
  --md-surface-container-highest: #e0e3df;
  --md-on-surface: #191c1a;
  --md-on-surface-variant: #414945;
  --md-outline: #717974;
  --md-outline-variant: #c1c9c3;
  --md-shadow: rgba(0, 0, 0, .14);
  --md-scrim: rgba(0, 0, 0, .42);
  --md-radius-xs: 8px;
  --md-radius-sm: 12px;
  --md-radius-md: 16px;
  --md-radius-lg: 24px;
  --md-radius-xl: 28px;
  --md-elevation-1: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --md-elevation-2: 0 2px 6px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.08);
  --md-elevation-3: 0 6px 16px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.08);

  --bg-primary: var(--md-surface);
  --bg-secondary: var(--md-surface-container-low);
  --bg-card: var(--md-surface-container-lowest);
  --bg-card-hover: var(--md-surface-container-low);
  --border-color: var(--md-outline-variant);
  --border-highlight: var(--md-outline);
  --text-primary: var(--md-on-surface);
  --text-secondary: var(--md-on-surface-variant);
  --text-muted: #6f7973;
  --brand-teal: var(--md-primary);
  --brand-teal-dark: #245440;
  --brand-teal-light: #427d67;
  --brand-teal-glow: rgba(47,107,86,.16);
  --accent-blue: #3f6378;
  --accent-green: var(--md-primary);
  --accent-amber: var(--md-warning);
  --accent-purple: #68548a;
  --accent-red: var(--md-error);
  --radius-sm: var(--md-radius-xs);
  --radius-md: var(--md-radius-sm);
  --radius-lg: var(--md-radius-md);
  --radius-xl: var(--md-radius-lg);
  --shadow-sm: var(--md-elevation-1);
  --shadow-md: var(--md-elevation-1);
  --shadow-lg: var(--md-elevation-3);
  --shadow-glow: none;

  background: var(--md-surface);
  background-image: none;
  color: var(--md-on-surface);
  font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", system-ui, sans-serif;
  letter-spacing: -0.005em;
}



/* Surface system */
body.md3 .glass-panel {
  background: var(--md-surface-container-lowest);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.md3 .glass-panel:hover { border-color: var(--md-outline-variant); }

/* Top app bar */
body.md3 .navbar {
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 10px 22px;
  min-height: 72px;
  background: color-mix(in srgb, var(--md-surface-container-lowest) 94%, transparent);
  border-bottom: 1px solid var(--md-outline-variant);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.md3.light-theme .navbar { background: rgba(255,255,255,.94); }

body.md3 .nav-container { max-width: 1600px; }
body.md3 .logo-badge { width: 44px; height: 44px; }
body.md3 .app-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: none;
}
body.md3 .nav-brand { gap: 12px; }
body.md3 .nav-title {
  color: var(--md-on-surface);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
body.md3.light-theme .nav-title {
  color: var(--md-on-surface);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: currentColor;
}
body.md3 .nav-subtitle { font-size: .72rem; color: var(--md-on-surface-variant); }
body.md3 .nav-actions { gap: 8px; }
body.md3 .header-meta { font-size: .72rem; }
body.md3 .header-meta small { letter-spacing: .055em; }
body.md3 .live-pill {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 18px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
body.md3 .live-pill b { color: inherit; opacity: .82; }
body.md3 .pulsing-dot { background: var(--md-primary); animation: none; }
body.md3 .auth-btn,
body.md3 .language-toggle,
body.md3 .icon-btn {
  min-height: 40px;
  border-radius: 20px;
  border: 1px solid var(--md-outline-variant);
  background: transparent;
  color: var(--md-on-surface-variant);
  box-shadow: none;
  font-weight: 650;
}
body.md3 .auth-btn:hover,
body.md3 .language-toggle:hover,
body.md3 .icon-btn:hover {
  background: var(--md-surface-container);
  border-color: var(--md-outline-variant);
  color: var(--md-on-surface);
  transform: none;
}
body.md3 .icon-btn { width: 40px; padding: 0; display: grid; place-items: center; }

/* App shell */
body.md3 .main-layout,
body.md3 .admin-dashboard {
  max-width: 1640px;
  margin: 18px auto 32px;
  padding: 0 22px;
}
body.md3 .dashboard-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
}
body.md3 .dashboard-workspace { gap: 18px; }

/* Navigation drawer */
body.md3 .dashboard-sidebar {
  top: 90px;
  padding: 10px;
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-low);
  border: 0;
  box-shadow: none;
  max-height: calc(100vh - 110px);
  overflow: auto;
}
body.md3 .fps-profile {
  padding: 14px 12px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
}
body.md3 .profile-avatar {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  box-shadow: none;
}
body.md3 .profile-eyebrow,
body.md3 .sidebar-nav-label {
  color: var(--md-on-surface-variant);
  font-size: .65rem;
  letter-spacing: .08em;
  font-weight: 800;
}
body.md3 .fps-profile h2 {
  margin: 4px 0 2px;
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 750;
}
body.md3 .profile-fps {
  color: var(--md-primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .75rem;
}
body.md3 .profile-details { margin: 14px 0 0; gap: 7px; }
body.md3 .profile-details div { font-size: .74rem; }
body.md3 .profile-details dt { color: var(--md-on-surface-variant); }
body.md3 .sidebar-nav { gap: 4px; padding: 12px 0 4px; }
body.md3 .sidebar-nav-label { padding: 8px 12px 5px; }
body.md3 .sidebar-nav-label-secondary { margin-top: 5px; }
body.md3 .sidebar-nav .tab-btn {
  min-height: 44px;
  padding: 7px 12px;
  border-radius: 22px;
  color: var(--md-on-surface-variant);
  gap: 10px;
  font-weight: 620;
  transition: background .16s ease, color .16s ease;
}
body.md3 .sidebar-nav .tab-btn:hover {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
  transform: none;
}
body.md3 .sidebar-nav .tab-btn.active {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-weight: 760;
}
body.md3 .tab-icon {
  width: 24px;
  font-size: 1rem;
  display: inline-grid;
  place-items: center;
  filter: saturate(.75);
}
body.md3 .tab-count-badge {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  border: 0;
  background: var(--md-surface-container-highest);
  color: var(--md-on-surface-variant);
  font-size: .68rem;
  font-weight: 800;
}
body.md3 .badge-amber { background: var(--md-warning-container); color: #4a3000; }

body.md3 .badge-green { background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .badge-blue { background: var(--md-tertiary-container); color: #163844; }


/* True overview workspace */
body.md3 .overview-content.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
body.md3 .overview-heading,
body.md3 .workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 4px 2px;
}
body.md3 .overview-heading h2,
body.md3 .workspace-heading h2 {
  margin: 2px 0 3px;
  color: var(--md-on-surface);
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}
body.md3 .overview-heading p:not(.overview-eyebrow),
body.md3 .workspace-heading p:not(.workspace-eyebrow) {
  max-width: 760px;
  color: var(--md-on-surface-variant);
  font-size: .85rem;
}
body.md3 .overview-eyebrow,
body.md3 .workspace-eyebrow {
  color: var(--md-primary);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .1em;
}
body.md3 .overview-status,
body.md3 .workspace-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  font-size: .74rem;
  font-weight: 750;
  white-space: nowrap;
}
body.md3 .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--md-primary); }

/* Context / period surface */
body.md3 .control-card {
  padding: 18px 20px;
  border: 0;
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-low);
}
body.md3 .control-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--md-outline-variant);
}
body.md3 .section-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--md-secondary-container);
  font-size: 1.15rem;
}
body.md3 .section-title { font-family: var(--font-body); font-size: 1rem; font-weight: 760; }
body.md3 .section-desc { color: var(--md-on-surface-variant); }
body.md3 .period-selector {
  padding: 7px;
  gap: 7px;
  border: 0;
  border-radius: 18px;
  background: var(--md-surface-container-high);
}
body.md3 .period-progress-ring {
  border-color: var(--md-outline-variant);
  border-top-color: var(--md-primary);
  border-right-color: var(--md-primary);
}

/* Inputs and buttons */
body.md3 .form-group label,
body.md3 .admin-panel label,
body.md3 .login-card label,
body.md3 .onboarding-step label {
  color: var(--md-on-surface-variant);
  font-size: .73rem;
  font-weight: 720;
}
body.md3 .form-control,
body.md3 .search-input,
body.md3 .chat-input,
body.md3 .admin-panel input,
body.md3 .login-card input,
body.md3 .onboarding-step input,
body.md3 .onboarding-step select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--md-outline);
  border-radius: 12px;
  outline: 0;
  background: var(--md-surface-container-lowest);
  color: var(--md-on-surface);
  box-shadow: none;
  font: inherit;
}
body.md3 .form-control:hover,
body.md3 .search-input:hover,
body.md3 .chat-input:hover,
body.md3 .admin-panel input:hover,
body.md3 .login-card input:hover { border-color: var(--md-on-surface); }
body.md3 .form-control:focus,
body.md3 .search-input:focus,
body.md3 .chat-input:focus,
body.md3 .admin-panel input:focus,
body.md3 .login-card input:focus {
  border: 2px solid var(--md-primary);
  box-shadow: none;
}
body.md3 .form-control:disabled {
  opacity: .68;
  background: var(--md-surface-container);
}
body.md3 .field-help { color: var(--md-on-surface-variant); }
body.md3 .primary-btn {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 22px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: none;
  font-weight: 760;
  letter-spacing: .005em;
}
body.md3 .primary-btn:hover {
  background: color-mix(in srgb, var(--md-primary) 90%, var(--md-on-primary));
  box-shadow: var(--md-elevation-1);
  transform: none;
}
body.md3 .action-btn,
body.md3 .auth-secondary-btn,
body.md3 .clear-chat-btn {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--md-outline);
  border-radius: 20px;
  background: transparent;
  color: var(--md-primary);
  box-shadow: none;
  font-weight: 720;
}
body.md3 .action-btn:hover,
body.md3 .auth-secondary-btn:hover,
body.md3 .clear-chat-btn:hover {
  background: color-mix(in srgb, var(--md-primary) 10%, transparent);
  border-color: var(--md-outline);
  transform: none;
}
body.md3 .export-icon { width: 18px; height: 18px; }

/* Overview KPI cards — tonal, restrained, task-oriented */
body.md3 .kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
body.md3 .kpi-card {
  position: relative;
  min-height: 150px;
  padding: 18px;
  gap: 14px;
  border: 0;
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-low);
  box-shadow: none;
  overflow: hidden;
}
body.md3 .kpi-card:nth-child(1),
body.md3 .kpi-card:nth-child(2) { grid-column: span 3; }
body.md3 .kpi-card:nth-child(3),
body.md3 .kpi-card:nth-child(4),
body.md3 .kpi-card:nth-child(5) { grid-column: span 2; }
body.md3 .kpi-card::before { display: none; }
body.md3 .kpi-card:hover {
  transform: none;
  background: var(--md-surface-container);
  box-shadow: var(--md-elevation-1);
}
body.md3 .kpi-icon-wrap {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  font-size: 1.05rem;
  box-shadow: none;
}
body.md3 .card-green .kpi-icon-wrap { background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .card-amber .kpi-icon-wrap { background: var(--md-warning-container); color: #5d3c00; }
body.md3 .card-red .kpi-icon-wrap { background: var(--md-error-container); color: var(--md-error); }
body.md3 .card-purple .kpi-icon-wrap { background: #eee3ff; color: #503477; }


body.md3 .kpi-label {
  color: var(--md-on-surface-variant);
  font-size: .73rem;
  font-weight: 760;
  text-transform: none;
  letter-spacing: 0;
}
body.md3 .kpi-value {
  margin: 3px 0 1px;
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--md-on-surface);
}
body.md3 .kpi-caption { color: var(--md-on-surface-variant); font-size: .72rem; }
body.md3 .kpi-caption.alert-text { color: var(--md-error); }
body.md3 .kpi-progress-wrap {
  height: 6px;
  border-radius: 3px;
  background: var(--md-surface-container-highest);
}
body.md3 .kpi-progress-bar { background: var(--md-primary); border-radius: 3px; }

/* Reports */
body.md3 .tab-content { padding: 0; }
body.md3 .tab-content.active:not(.overview-content) {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.md3 .workspace-heading { padding: 5px 4px 3px; }
body.md3 .workspace-heading h2 { font-size: 1.55rem; }
body.md3 .table-toolbar,
body.md3 .report-intro {
  padding: 12px 14px;
  border: 0;
  border-radius: var(--md-radius-md);
  background: var(--md-surface-container-low);
  box-shadow: none;
}
body.md3 .table-toolbar { gap: 10px; }
body.md3 .search-input-wrap { min-width: min(440px, 100%); }
body.md3 .search-input {
  width: 100%;
  padding-left: 42px;
  border: 0;
  border-radius: 24px;
  background: var(--md-surface-container-high);
}
body.md3 .search-input:focus { border: 0; outline: 2px solid var(--md-primary); outline-offset: -2px; }
body.md3 .search-icon { left: 15px; color: var(--md-on-surface-variant); }
body.md3 .stat-pill,
body.md3 .report-summary-pill {
  border: 0;
  border-radius: 14px;
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  box-shadow: none;
}
body.md3 .stat-pill.highlight,
body.md3 .report-summary-alert { background: var(--md-warning-container); color: #5d3c00; }

body.md3 .report-intro h3 { color: var(--md-on-surface); }
body.md3 .report-intro p { color: var(--md-on-surface-variant); }

/* Material data table */
body.md3 .table-responsive {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-lowest);
  box-shadow: none;
  overflow: auto;
}
body.md3 .data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--md-on-surface);
}
body.md3 .data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 14px;
  border-bottom: 1px solid var(--md-outline-variant);
  background: var(--md-surface-container-low);
  color: var(--md-on-surface-variant);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
body.md3 .data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--md-outline-variant);
  background: transparent;
  color: var(--md-on-surface);
  font-size: .78rem;
  vertical-align: middle;
}
body.md3 .data-table tbody tr { transition: background .12s ease; }
body.md3 .data-table tbody tr:hover { background: var(--md-surface-container-low); transform: none; }
body.md3 .data-table tbody tr:last-child td { border-bottom: 0; }
body.md3 .pagination-bar { padding: 4px 2px 0; }
body.md3 .page-btn,
body.md3 .pagination-bar button {
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--md-on-surface-variant);
}
body.md3 .page-btn.active,
body.md3 .pagination-bar button.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }

/* Ledger, assistant, admin panels */
body.md3 .ledger-card,
body.md3 .bot-info-panel,
body.md3 .chat-container,
body.md3 .admin-panel,
body.md3 .admin-kpi,
body.md3 .admin-hero,
body.md3 .plan-card,
body.md3 .registered-summary-card {
  border-color: var(--md-outline-variant);
  background: var(--md-surface-container-lowest);
  box-shadow: none;
}
body.md3 .admin-shell .dashboard-sidebar { border-top: 0; }
body.md3 .admin-shell .sidebar-nav .tab-btn.active {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}
body.md3 .admin-hero { border-left: 0; border-radius: var(--md-radius-lg); background: var(--md-primary-container); }
body.md3 .admin-hero h2,
body.md3 .admin-hero p { color: var(--md-on-primary-container); }
body.md3 .admin-eyebrow { color: var(--md-on-primary-container); opacity: .72; }
body.md3 .admin-kpi { border-top: 0; border-radius: var(--md-radius-lg); background: var(--md-surface-container-low); }
body.md3 .plan-card { border-left: 0; border-radius: var(--md-radius-md); background: var(--md-surface-container-low); }

/* Dialogs and authentication */
body.md3 .detail-modal,
body.md3 .auth-overlay {
  background: var(--md-scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
body.md3 .detail-modal-card,
body.md3 .login-card,
body.md3 .onboarding-card {
  border: 0;
  border-radius: var(--md-radius-xl);
  background: var(--md-surface-container-high);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
body.md3 .login-card { width: min(100%, 420px); padding: 28px; gap: 10px; }
body.md3 .login-brand { margin-bottom: 8px; }
body.md3 .login-mark { border-radius: 18px; box-shadow: none; }
body.md3 .login-card h2 { font-size: 1.55rem; }
body.md3 .login-card .primary-btn {
  margin-top: 8px;
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: none;
}
body.md3 .login-card .primary-btn:hover { background: var(--md-primary); }
body.md3 .detail-modal-header {
  border-bottom-color: var(--md-outline-variant);
  background: var(--md-surface-container-high);
}
body.md3 .detail-modal-eyebrow { color: var(--md-primary); }
body.md3 .onboarding-readonly,
body.md3 .onboarding-summary,
body.md3 .onboarding-plan {
  border-color: var(--md-outline-variant);
  background: var(--md-surface-container-low);
  box-shadow: none;
}
body.md3 .onboarding-plan:has(input:checked) {
  border-color: var(--md-primary);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  box-shadow: none;
}

/* Toast & footer */
body.md3 .toast {
  border: 0;
  border-radius: 8px;
  background: #2f312f;
  color: #f2f2f2;
  box-shadow: var(--md-elevation-3);
}
body.md3 .footer {
  margin-top: auto;
  border-top: 1px solid var(--md-outline-variant);
  background: transparent;
}
body.md3 .footer-container { max-width: 1600px; }

/* FPS users: period becomes a compact context row, not a large selector card. */
body.md3.fps-user-session .control-card {
  min-height: 74px;
  padding: 10px 14px;
  background: var(--md-surface-container-low);
}
body.md3.fps-user-session .control-card .form-grid {
  right: 14px;
}
body.md3.fps-user-session .control-card .control-header { padding-right: 190px; }
body.md3.fps-user-session .period-selector { background: transparent; padding: 0; }

/* Responsive Material navigation */
@media (max-width: 1180px) {
  body.md3 .kpi-card:nth-child(n) { grid-column: span 4; }
  body.md3 .kpi-card:nth-child(1),
  body.md3 .kpi-card:nth-child(2) { grid-column: span 6; }
}

@media (max-width: 980px) {
  body.md3 .nav-subtitle,
  body.md3 .header-meta,
  body.md3 .live-pill { display: none; }
  body.md3 .dashboard-shell { grid-template-columns: 1fr; }
  body.md3 .dashboard-sidebar {
    position: static;
    max-height: none;
    padding: 8px;
    border-radius: var(--md-radius-md);
  }
  body.md3 .fps-profile {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 8px 10px 10px;
  }
  body.md3 .profile-avatar { grid-row: 1 / span 3; margin: 0; }
  body.md3 .profile-eyebrow,
  body.md3 .profile-details { display: none; }
  body.md3 .fps-profile h2 { margin: 0; }
  body.md3 .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 2px 2px;
    scrollbar-width: none;
  }
  body.md3 .sidebar-nav::-webkit-scrollbar { display: none; }
  body.md3 .sidebar-nav-label { display: none; }
  body.md3 .sidebar-nav .tab-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 44px;
    padding: 8px 13px;
  }
  body.md3 .sidebar-nav .tab-btn span:nth-child(2) { flex: initial; }
  body.md3 .tab-count-badge { display: none; }
}

@media (max-width: 760px) {
  body.md3 .navbar { padding: 8px 12px; min-height: 64px; }
  body.md3 .nav-actions { gap: 5px; }
  body.md3 .auth-btn { padding: 0 12px; }
  body.md3 .main-layout,
  body.md3 .admin-dashboard { margin-top: 10px; padding: 0 10px; }
  body.md3 .dashboard-workspace { gap: 14px; }
  body.md3 .overview-heading,
  body.md3 .workspace-heading { align-items: flex-start; flex-direction: column; gap: 9px; padding-inline: 2px; }
  body.md3 .overview-status { align-self: flex-start; }
  body.md3 .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.md3 .kpi-card:nth-child(n) { grid-column: span 1; min-height: 132px; }
  body.md3 .kpi-card:nth-child(1) { grid-column: span 2; }
  body.md3 .kpi-value { font-size: 1.65rem; }
  body.md3 .control-card { padding: 14px; }
  body.md3 .control-header { align-items: stretch; flex-direction: column; }
  body.md3 .period-selector { width: 100%; align-items: flex-end; }
  body.md3 .period-selector .form-group { flex: 1; }
  body.md3 .period-selector .form-control { width: 100%; min-width: 0; }
  body.md3.fps-user-session .control-card { min-height: 0; }
  body.md3.fps-user-session .control-card .control-header { padding-right: 0; }
  body.md3.fps-user-session .control-card .form-grid { position: static; margin-top: 8px; transform: none; }
  body.md3 .table-toolbar,
  body.md3 .report-intro { align-items: stretch; flex-direction: column; }
  body.md3 .search-input-wrap { min-width: 0; width: 100%; }
  body.md3 .toolbar-actions { width: 100%; }
  body.md3 .toolbar-actions .action-btn { flex: 1; justify-content: center; }
  body.md3 .data-table th,
  body.md3 .data-table td { padding: 11px 12px; }
}

@media (max-width: 520px) {
  body.md3 .nav-brand .nav-title { font-size: 1.05rem; }
  body.md3 .nav-brand .nav-subtitle { display: none; }
  body.md3 .logo-badge,
  body.md3 .app-logo { width: 38px; height: 38px; }
  body.md3 .language-toggle { display: none; }
  body.md3 .kpi-grid { grid-template-columns: 1fr; }
  body.md3 .kpi-card:nth-child(n) { grid-column: 1; }
  body.md3 .kpi-card { min-height: 118px; padding: 15px; }
  body.md3 .sidebar-nav .tab-btn span:nth-child(2) { display: none; }
  body.md3 .sidebar-nav .tab-btn.active span:nth-child(2) { display: inline; }
  body.md3 .sidebar-nav .tab-btn.active { padding-inline: 14px; }
  body.md3 .period-selector { flex-wrap: wrap; }
  body.md3 .period-progress-ring { align-self: center; }
  body.md3 .login-card,
  body.md3 .onboarding-card { border-radius: 24px; padding: 22px 18px; }
}

/* Material treatment for dynamically rendered beneficiary and transaction UI */
body.md3 .registered-summary-grid { gap: 10px; }
body.md3 .registered-summary-card {
  padding: 14px 16px;
  border: 0;
  border-radius: var(--md-radius-md);
  background: var(--md-surface-container-low);
  box-shadow: none;
}
body.md3 .registered-summary-label { color: var(--md-on-surface-variant); }
body.md3 .registered-summary-count { color: var(--md-primary); }
body.md3 .rc-cell { color: var(--md-primary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
body.md3 .scheme-tag,
body.md3 .chip,
body.md3 .portability-tag,
body.md3 .variance-status,
body.md3 .registration-status {
  border: 0;
  border-radius: 999px;
  box-shadow: none;
}
body.md3 .scheme-PHH { background: var(--md-tertiary-container); color: #163844; }
body.md3 .scheme-AAY { background: var(--md-warning-container); color: #5d3c00; }
body.md3 .scheme-APL { background: var(--md-surface-container-highest); color: var(--md-on-surface-variant); }
body.md3 .scheme-SAAY { background: #f7d9eb; color: #6f3051; }
body.md3 .scheme-SPHH { background: var(--md-primary-container); color: var(--md-on-primary-container); }



body.md3 .chip { padding: 4px 8px; background: var(--md-surface-container); color: var(--md-on-surface-variant); }
body.md3 .chip b { color: var(--md-primary); }
body.md3 .table-action-btn,
body.md3 .action-btn-sm,
body.md3 .card-icon-action-btn,
body.md3 .card-whatsapp-add-btn,
body.md3 .card-whatsapp-save-btn,
body.md3 .card-whatsapp-cancel-btn {
  border: 1px solid var(--md-outline);
  border-radius: 18px;
  background: transparent;
  color: var(--md-primary);
  box-shadow: none;
}
body.md3 .table-action-btn:hover,
body.md3 .action-btn-sm:hover,
body.md3 .card-icon-action-btn:hover,
body.md3 .card-whatsapp-add-btn:hover,
body.md3 .card-whatsapp-save-btn:hover,
body.md3 .card-whatsapp-cancel-btn:hover {
  border-color: var(--md-outline);
  background: color-mix(in srgb, var(--md-primary) 10%, transparent);
  color: var(--md-primary);
  box-shadow: none;
  transform: none;
}
body.md3 .card-icon-action-btn.danger:hover { background: var(--md-error-container); color: var(--md-error); border-color: transparent; }

body.md3 .detail-modal-body { background: var(--md-surface-container-low); }
body.md3 .card-detail-mark {
  border: 0;
  border-radius: 14px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
body.md3 .card-detail-panel,
body.md3 .card-detail-members-table-wrap,
body.md3 .detail-data-section,
body.md3 .monthly-snapshot-header,
body.md3 .detail-history-row,
body.md3 .detail-metric-grid > div {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  background: var(--md-surface-container-lowest);
  box-shadow: none;
}
body.md3 .card-detail-panel h3,
body.md3 .card-detail-members-heading h3,
body.md3 .detail-section-heading span { color: var(--md-primary); }
body.md3 .card-detail-whatsapp {
  border: 0;
  border-radius: var(--md-radius-md);
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
body.md3 .card-whatsapp-link {
  border: 0;
  background: color-mix(in srgb, var(--md-primary) 14%, transparent);
  color: var(--md-primary);
  box-shadow: none;
}
body.md3 .card-whatsapp-link:hover { background: color-mix(in srgb, var(--md-primary) 20%, transparent); box-shadow: none; }
body.md3 .card-whatsapp-input { border-color: var(--md-outline); background: var(--md-surface-container-lowest); color: var(--md-on-surface); }
body.md3 .card-detail-members-table th { background: var(--md-surface-container-low); color: var(--md-on-surface-variant); }
body.md3 .card-detail-members-table td { border-color: var(--md-outline-variant); }

body.md3 .txn-month-nav {
  border: 0;
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container);
  box-shadow: none;
}
body.md3 .txn-nav-btn,
body.md3 .txn-jump-current-btn {
  border: 1px solid var(--md-outline);
  border-radius: 20px;
  background: transparent;
  color: var(--md-primary);
  box-shadow: none;
}
body.md3 .txn-nav-btn:hover:not(:disabled),
body.md3 .txn-jump-current-btn:hover { background: color-mix(in srgb, var(--md-primary) 10%, transparent); box-shadow: none; transform: none; }
body.md3 .txn-badge-current { border: 0; background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .txn-flash-card {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-lowest);
  box-shadow: none;
}
body.md3 .txn-flash-card.is-completed { border-color: color-mix(in srgb, var(--md-primary) 45%, var(--md-outline-variant)); }
body.md3 .txn-flash-card.is-pending { border-color: color-mix(in srgb, var(--md-warning) 45%, var(--md-outline-variant)); }
body.md3 .txn-flash-eyebrow,
body.md3 .txn-section-title { color: var(--md-primary); }
body.md3 .txn-entitled-strip,
body.md3 .txn-metric-tile,
body.md3 .txn-comm-card,
body.md3 .txn-meta-pill,
body.md3 .txn-pending-box {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-md);
  background: var(--md-surface-container-low);
  box-shadow: none;
}
body.md3 .txn-metric-tile:hover,
body.md3 .txn-comm-card:hover { transform: none; background: var(--md-surface-container); box-shadow: none; }
body.md3 .txn-entitled-chip { border: 0; border-radius: 999px; background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .txn-status-badge.completed { border: 0; background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .txn-status-badge.pending { border: 0; background: var(--md-warning-container); color: #5d3c00; }

body.md3 .txn-pending-box { background: var(--md-warning-container); color: #5d3c00; }

body.md3 .txn-footer-actions { border-color: var(--md-outline-variant); }
body.md3 .txn-loading-spinner,
body.md3 .detail-loading::before { border-color: var(--md-outline-variant); border-top-color: var(--md-primary); }

body.md3 .comm-card {
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius-lg);
  background: var(--md-surface-container-lowest);
  box-shadow: none;
}
body.md3 .comm-card:hover { transform: none; box-shadow: var(--md-elevation-1); }
body.md3 .comm-pct-badge { border: 0; border-radius: 999px; background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .comm-stat { border-color: var(--md-outline-variant); background: var(--md-surface-container-low); }
body.md3 .variance-status.short { background: var(--md-warning-container); color: #5d3c00; }
body.md3 .variance-status.excess { background: var(--md-error-container); color: var(--md-error); }
body.md3 .portability-tag.self { background: var(--md-primary-container); color: var(--md-on-primary-container); }
body.md3 .portability-tag.other { background: #eee3ff; color: #503477; }


/* Keep focus visible and accessible across the refreshed UI. */
body.md3 button:focus-visible,
body.md3 a:focus-visible,
body.md3 input:focus-visible,
body.md3 select:focus-visible,
body.md3 [role="button"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--md-primary) 42%, transparent);
  outline-offset: 2px;
}

@font-face {
  font-family: "Noto Sans Devanagari";
  src: url("/asset/fonts/NotoSansDevanagari.ttf") format("truetype");
  font-display: swap;
}

/* ===== mockup.css ===== */
/* FPS Assistant — image-matched UI layer (Overview, Registered Cards, Assistant Simulator) */
:root {
  --ui-bg: #f6f9fd;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f7faff;
  --ui-line: #dce5f0;
  --ui-line-strong: #cbd7e5;
  --ui-text: #0f1f3a;
  --ui-muted: #697993;
  --ui-blue: #2563eb;
  --ui-blue-soft: #eaf2ff;
  --ui-green: #11965a;
  --ui-green-soft: #e9f8f0;
  --ui-amber: #e38b13;
  --ui-amber-soft: #fff5e5;
  --ui-red: #d93d4a;
  --ui-red-soft: #fff0f2;
  --ui-purple: #7154d9;
  --ui-purple-soft: #f2efff;
  --ui-shadow: 0 10px 30px rgba(31, 55, 86, .07);
  --ui-radius: 15px;
}

body.md3 {
  margin: 0;
  min-height: 100vh;
  background: var(--ui-bg) !important;
  color: var(--ui-text) !important;
  font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", system-ui, sans-serif !important;
}
body.md3 * { box-sizing: border-box; }
body.md3 button, body.md3 input, body.md3 select { font: inherit; }
.material-symbols-rounded {
  font-family: "Material Symbols Rounded" !important;
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* Top app bar */
body.md3 .exact-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 72px;
  background: rgba(255,255,255,.98) !important;
  border-bottom: 1px solid var(--ui-line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
}
body.md3 .exact-topbar .nav-container {
  height: 72px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 300px minmax(340px, 620px) 1fr;
  align-items: center;
  gap: 28px;
}
body.md3 .exact-topbar .nav-brand { display:flex; align-items:center; gap:12px; min-width:0; }
body.md3 .exact-topbar .logo-badge {
  width: 42px; height:42px; border-radius:12px; display:grid; place-items:center;
  background:#edf7f1; box-shadow:none; overflow:hidden; flex:0 0 auto;
}
body.md3 .exact-topbar .app-logo { width:34px; height:34px; object-fit:contain; }
body.md3 .exact-topbar .nav-title { margin:0; font:700 20px/1.15 "Outfit",sans-serif; color:var(--ui-text); }
body.md3 .exact-topbar .nav-subtitle { margin:3px 0 0; font-size:10.5px; color:var(--ui-muted); white-space:nowrap; }
body.md3 .global-search {
  height:44px; display:flex; align-items:center; gap:10px; padding:0 14px;
  background:#f5f8fc; border:1px solid #e1e8f2; border-radius:11px; color:#607089;
}
body.md3 .global-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--ui-text); font-size:13px; }
body.md3 .global-search input::placeholder { color:#8795a9; }
body.md3 .global-search kbd { border:1px solid #d7dfeb; background:#fff; border-radius:6px; padding:3px 7px; font-size:10px; color:#607089; }
body.md3 .exact-topbar .nav-actions { display:flex; justify-content:flex-end; align-items:center; gap:9px; min-width:0; }
body.md3 .portal-compact { display:flex; align-items:center; gap:8px; margin-right:4px; }
body.md3 .portal-compact .pulsing-dot { width:8px; height:8px; background:#0d9c55; border-radius:50%; box-shadow:0 0 0 4px #e6f7ed; }
body.md3 .portal-compact div { display:flex; flex-direction:column; line-height:1.15; }
body.md3 .portal-compact strong { color:#137a49; font-size:11px; }
body.md3 .portal-compact span { color:#8692a3; font-size:8.5px; }
body.md3 .top-icon-btn {
  width:38px; height:38px; border:0; background:transparent; border-radius:10px; color:#263650; display:grid; place-items:center; cursor:pointer; position:relative;
}
body.md3 .top-icon-btn:hover { background:#f1f5fa; }
body.md3 .notification-dot { position:absolute; top:3px; right:2px; min-width:16px; height:16px; padding:0 4px; border-radius:10px; background:#dc3443; color:white; font-size:9px; display:grid; place-items:center; border:2px solid white; }
body.md3 .top-language { height:36px; min-width:64px; padding:0 11px; border:1px solid var(--ui-line); border-radius:9px; background:white; color:#273650; font-weight:700; font-size:11px; }
body.md3 .top-user { display:flex; align-items:center; gap:9px; margin-left:3px; min-width:168px; }
body.md3 .top-avatar { width:38px !important; height:38px !important; min-width:38px; border-radius:50% !important; border:0 !important; background:#dceafd !important; color:#0d59b9 !important; font-weight:800; display:grid !important; place-items:center; background-size:cover !important; background-position:center !important; }
body.md3 .top-user-copy { display:flex; flex-direction:column; min-width:0; }
body.md3 .top-user-copy strong { font-size:11.5px; color:#15233a; max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.md3 .top-user-copy span { font-size:9px; color:#718098; }
body.md3 .top-chevron { font-size:18px; color:#6b7890; }
body.md3 .top-auth { padding:7px 10px !important; min-height:0 !important; border-radius:8px !important; font-size:10px !important; }
body.md3 .profile-photo-input { display:none !important; }

/* Main shell */
body.md3 .main-layout { width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; }
body.md3 .dashboard-shell { width:100%; max-width:none !important; min-height:calc(100vh - 72px); display:grid !important; grid-template-columns:220px minmax(0,1fr); gap:0 !important; align-items:stretch; }
body.md3 .dashboard-workspace { min-width:0; padding:26px 26px 42px; }
body.md3 .tab-content { display:none; }
body.md3 .tab-content.active { display:block; }

/* Sidebar */
body.md3 .exact-sidebar {
  position:sticky !important; top:72px; align-self:start; height:calc(100vh - 72px);
  padding:18px 11px 15px !important; border:0 !important; border-right:1px solid var(--ui-line) !important;
  border-radius:0 !important; background:#fff !important; box-shadow:none !important; backdrop-filter:none !important;
  display:flex; flex-direction:column; overflow-y:auto;
}
body.md3 .exact-sidebar .sidebar-nav { display:flex; flex-direction:column; gap:4px; }
body.md3 .exact-sidebar .tab-btn {
  width:100%; min-height:44px; display:flex; align-items:center; gap:12px; border:0; background:transparent; color:#465671;
  border-radius:10px; padding:0 12px; text-align:left; cursor:pointer; font-size:12px; font-weight:600; transition:.16s ease;
}
body.md3 .exact-sidebar .tab-btn:hover { background:#f5f8fc; color:#172947; }
body.md3 .exact-sidebar .tab-btn.active { background:#e9f2fc !important; color:#0b6a69 !important; box-shadow:none !important; }
body.md3 .exact-sidebar .tab-btn.active::before { content:""; width:3px; height:22px; border-radius:4px; background:#0c8b78; margin-left:-8px; }
body.md3 .exact-sidebar .tab-icon { width:23px; min-width:23px; font-size:21px; color:currentColor; }
body.md3 .exact-sidebar .tab-count-badge { margin-left:auto; min-width:21px; height:20px; padding:0 5px; border-radius:10px; font-size:9px; display:grid; place-items:center; color:#63728a; background:#eef3f8 !important; }
body.md3 .sidebar-spacer { flex:1; min-height:24px; }
body.md3 .sidebar-help-card { display:flex; gap:10px; align-items:flex-start; padding:13px 12px; border-radius:11px; background:#f1f6fb; color:#165370; }
body.md3 .sidebar-help-card > .material-symbols-rounded { font-size:23px; }
body.md3 .sidebar-help-card div { display:flex; flex-direction:column; gap:2px; }
body.md3 .sidebar-help-card strong { font-size:11px; }
body.md3 .sidebar-help-card span { font-size:9px; color:#6b7b91; line-height:1.35; }
body.md3 .sidebar-context { display:grid; gap:8px; margin-top:13px; padding:12px; border-top:1px solid #edf1f6; }
body.md3 .sidebar-context > span { display:flex; flex-direction:column; gap:1px; }
body.md3 .sidebar-context small { color:#8a96a8; font-size:8.5px; text-transform:uppercase; letter-spacing:.05em; }
body.md3 .sidebar-context b { color:#4a5a72; font-size:10px; font-weight:600; }

/* Overview */
body.md3 .exact-overview { max-width:1500px; margin:0 auto; }
body.md3 .overview-topline { display:flex; justify-content:space-between; gap:28px; align-items:flex-start; margin:0 0 22px; }
body.md3 .overview-title-copy h2 { margin:0; font:800 28px/1.1 "Outfit",sans-serif; color:#0c1d38; letter-spacing:-.02em; }
body.md3 .overview-title-copy h3 { margin:7px 0 4px; font-size:21px; color:#1c2b44; font-weight:700; }
body.md3 .overview-title-copy p { margin:0; color:#728198; font-size:12px; }
body.md3 .overview-selectors { display:grid; grid-template-columns: minmax(240px,1.2fr) minmax(220px,1fr); gap:14px; min-width:560px; }
body.md3 .selector-card { min-height:68px; border:1px solid var(--ui-line); border-radius:12px; background:#fff; padding:11px 13px; display:flex; gap:11px; align-items:center; box-shadow:0 2px 8px rgba(32,59,89,.025); }
body.md3 .selector-card > .material-symbols-rounded { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:#f1f5fb; color:#223655; }
body.md3 .selector-copy { flex:1; display:flex; flex-direction:column; min-width:0; }
body.md3 .selector-copy small { font-size:9px; color:#687894; margin-bottom:1px; }
body.md3 .selector-card .form-control { width:100%; min-height:24px !important; height:24px !important; padding:0 20px 0 0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; color:#18263e !important; font-weight:700 !important; font-size:11.5px !important; }
body.md3 .selector-card .field-help { display:none; }
body.md3 .period-inline { display:grid; grid-template-columns:1fr 72px; gap:6px; }
body.md3 .period-progress-ring { width:18px; height:18px; margin-left:auto; }
body.md3 .overview-hidden-controls { display:none !important; }

body.md3 .exact-kpis { display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px !important; margin:0 0 16px !important; }
body.md3 .exact-kpis .kpi-card {
  position:relative; min-height:176px !important; border:1px solid transparent !important; border-radius:13px !important; padding:17px 15px !important;
  box-shadow:none !important; display:block !important; overflow:hidden; cursor:pointer; transform:none !important;
}
body.md3 .exact-kpis .card-blue { background:linear-gradient(145deg,#eff7ff,#f7fbff) !important; border-color:#d7e9fc !important; }
body.md3 .exact-kpis .card-green { background:linear-gradient(145deg,#edf9f3,#f7fcf9) !important; border-color:#d7eddf !important; }
body.md3 .exact-kpis .card-amber { background:linear-gradient(145deg,#fff7ea,#fffbf4) !important; border-color:#fae2be !important; }
body.md3 .exact-kpis .card-red { background:linear-gradient(145deg,#fff1f2,#fff8f8) !important; border-color:#f3d4d8 !important; }
body.md3 .exact-kpis .card-purple { background:linear-gradient(145deg,#f3f0ff,#faf9ff) !important; border-color:#e1dbfb !important; }
body.md3 .exact-kpis .kpi-icon-wrap { width:46px !important; height:46px !important; border-radius:50% !important; display:grid !important; place-items:center !important; margin-bottom:12px; background:#dcecff !important; color:#1b68d9 !important; font-size:0 !important; }
body.md3 .exact-kpis .card-green .kpi-icon-wrap { background:#d8f2e4 !important; color:#0d9255 !important; }
body.md3 .exact-kpis .card-amber .kpi-icon-wrap { background:#ffebc9 !important; color:#df8612 !important; }
body.md3 .exact-kpis .card-red .kpi-icon-wrap { background:#ffdce0 !important; color:#d53343 !important; }
body.md3 .exact-kpis .card-purple .kpi-icon-wrap { background:#e5defd !important; color:#6548cf !important; }
body.md3 .exact-kpis .kpi-content { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
body.md3 .exact-kpis .kpi-value { order:0; margin:0; font:800 27px/1 "Outfit",sans-serif; color:#10233f; }
body.md3 .exact-kpis .kpi-label { order:1; color:#1d2d48; font-size:11px; font-weight:700; }
body.md3 .exact-kpis .kpi-hindi { order:2; color:#53637c; font-size:9.5px; font-weight:600; }
body.md3 .exact-kpis .kpi-caption { order:4; color:#6d7d94; font-size:8.8px; margin-top:8px; }
body.md3 .exact-kpis .kpi-progress-wrap { order:3; width:100%; height:5px; background:#d9e5df; border-radius:8px; margin-top:8px; overflow:hidden; }
body.md3 .exact-kpis .kpi-progress-bar { height:100%; border-radius:8px; background:#16a461; }
body.md3 .kpi-trend { position:absolute; right:13px; top:15px; min-width:30px; height:24px; padding:0 7px; border-radius:13px; display:grid; place-items:center; background:rgba(255,255,255,.65); font-size:10px; color:#3d7c54; font-weight:800; }

body.md3 .overview-main-grid { display:grid; grid-template-columns:minmax(0,1.28fr) minmax(0,.9fr) minmax(255px,.77fr); gap:14px; align-items:stretch; }
body.md3 .overview-card { background:#fff; border:1px solid var(--ui-line); border-radius:13px; box-shadow:0 3px 12px rgba(32,57,82,.025); }
body.md3 .progress-panel, body.md3 .activity-panel { min-height:445px; padding:18px; }
body.md3 .panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
body.md3 .panel-heading h3 { margin:0; font-size:14px; color:#14243e; }
body.md3 .panel-heading > div > span { display:block; margin-top:2px; color:#718098; font-size:9.5px; }
body.md3 .text-link { border:0; background:transparent; color:#0e67d9; font-size:9.5px; font-weight:700; display:flex; gap:5px; align-items:center; cursor:pointer; }
body.md3 .text-link .material-symbols-rounded { font-size:15px; }
body.md3 .progress-hero { min-height:165px; display:flex; align-items:center; gap:24px; padding:5px 6px 14px; }
body.md3 .donut { --progress:0; width:132px; height:132px; flex:0 0 132px; border-radius:50%; background:conic-gradient(#16a461 calc(var(--progress)*1%), #e7edf2 0); display:grid; place-items:center; position:relative; }
body.md3 .donut::after { content:""; width:96px; height:96px; border-radius:50%; background:#fff; position:absolute; }
body.md3 .donut > div { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; }
body.md3 .donut strong { font:800 20px/1 "Outfit"; color:#14243d; }
body.md3 .donut span { margin-top:5px; font-size:9px; color:#7a8799; }
body.md3 .progress-copy { display:flex; flex-direction:column; gap:7px; }
body.md3 .progress-copy strong { color:#128d50; font-size:13px; }
body.md3 .progress-copy span { color:#5c6d85; font-size:10px; line-height:1.6; max-width:180px; }
body.md3 .mini-section-heading { display:flex; align-items:center; justify-content:space-between; border-top:1px solid #edf1f6; padding-top:13px; margin-bottom:11px; }
body.md3 .mini-section-heading strong { font-size:10.5px; }
body.md3 .mini-section-heading span { font-size:8.5px; color:#8190a5; }
body.md3 .commodity-mini-chart { display:grid; gap:10px; }
body.md3 .commodity-bar-item { display:grid; gap:4px; }
body.md3 .commodity-bar-values { display:flex; justify-content:space-between; font-size:9px; }
body.md3 .commodity-bar-values strong { color:#36455e; }
body.md3 .commodity-bar-values span { color:#8290a3; }
body.md3 .commodity-track { height:9px; border-radius:7px; background:#edf2f6; overflow:hidden; position:relative; }
body.md3 .commodity-distributed { display:block; height:100%; background:#20a966; border-radius:7px; }
body.md3 .commodity-balance { display:none; }
body.md3 .empty-mini, body.md3 .activity-empty { min-height:100px; display:grid; place-items:center; color:#8692a4; font-size:10px; text-align:center; }

body.md3 .activity-list { display:flex; flex-direction:column; }
body.md3 .activity-row { display:grid; grid-template-columns:34px 1fr auto; gap:10px; align-items:start; padding:12px 0; border-bottom:1px solid #edf1f5; }
body.md3 .activity-row:last-child { border-bottom:0; }
body.md3 .activity-icon { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:#dff4e8; color:#16975b; }
body.md3 .activity-icon.warning { background:#fff0d8; color:#d98312; }
body.md3 .activity-icon .material-symbols-rounded { font-size:17px; }
body.md3 .activity-row > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
body.md3 .activity-row strong { font-size:10px; color:#1d2d47; }
body.md3 .activity-row span { font-size:9px; color:#56667e; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.md3 .activity-row small { font-size:8px; color:#8793a5; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.md3 .activity-row time { font-size:8px; color:#8391a3; white-space:nowrap; }
body.md3 .overview-side-stack { display:grid; grid-template-rows:minmax(0,1fr) auto; gap:14px; }
body.md3 .attention-panel, body.md3 .quick-panel { padding:16px; }
body.md3 .attention-row { width:100%; border:1px solid #e7edf4; background:#fff; border-radius:10px; margin-top:8px; padding:10px; display:grid; grid-template-columns:34px 1fr 18px; gap:8px; align-items:center; text-align:left; cursor:pointer; color:#243550; }
body.md3 .attention-row:hover { background:#f9fbfe; }
body.md3 .attention-icon { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; }
body.md3 .attention-icon.amber { color:#d77e10; background:#fff0d8; }
body.md3 .attention-icon.red { color:#cc3544; background:#fee4e7; }
body.md3 .attention-icon.blue { color:#2f69c9; background:#e6f0ff; }
body.md3 .attention-icon .material-symbols-rounded { font-size:17px; }
body.md3 .attention-row > span:nth-child(2) { display:flex; flex-direction:column; gap:2px; }
body.md3 .attention-row strong { font-size:9.5px; }
body.md3 .attention-row small { font-size:7.8px; color:#8491a4; }
body.md3 .attention-row > .material-symbols-rounded { font-size:17px; color:#61708a; }
body.md3 .quick-action-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
body.md3 .quick-action-grid button { min-height:74px; border:1px solid #dce8f5; border-radius:10px; background:#eff7ff; color:#1d4f91; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:10px 11px; text-align:left; cursor:pointer; }
body.md3 .quick-action-grid button:nth-child(1), body.md3 .quick-action-grid button:nth-child(4) { background:#edf9f2; border-color:#d9eee2; color:#1e7f54; }
body.md3 .quick-action-grid button:nth-child(3) { background:#f5f1ff; border-color:#e7ddff; color:#6440c4; }
body.md3 .quick-action-grid .material-symbols-rounded { font-size:20px; margin-bottom:4px; }
body.md3 .quick-action-grid b { font-size:9px; }
body.md3 .quick-action-grid small { font-size:7.5px; color:#758398; margin-top:2px; }
body.md3 .historical-banner { margin-top:14px; border:1px solid var(--ui-line); background:#fff; border-radius:12px; padding:14px; }

/* Registered Cards */
body.md3 .exact-registered { max-width:1400px; margin:0 auto; }
body.md3 .registered-head-row { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin:2px 0 22px; }
body.md3 .registered-head-row h2 { margin:0; font:800 29px/1.1 "Outfit"; color:#0d1e39; }
body.md3 .registered-head-row p { margin:7px 0 0; color:#718098; font-size:11px; }
body.md3 .registered-head-row p span { margin:0 5px; color:#c0c8d3; }
body.md3 .registered-total { min-width:220px; display:flex; align-items:center; gap:12px; border-left:1px solid var(--ui-line); padding-left:25px; }
body.md3 .registered-total > .material-symbols-rounded { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; color:#3374df; background:#eaf2ff; }
body.md3 .registered-total div { display:flex; flex-direction:column; }
body.md3 .registered-total small { font-size:9px; color:#718099; }
body.md3 .registered-total strong { font:800 25px/1.15 "Outfit"; color:#145fc0; }
body.md3 .registered-toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:10px; }
body.md3 .registered-search { width:min(540px,60%); height:42px; display:flex; align-items:center; gap:9px; padding:0 13px; border:1px solid var(--ui-line-strong); border-radius:10px; background:#fff; color:#738198; }
body.md3 .registered-search .material-symbols-rounded { font-size:20px; }
body.md3 .registered-search input { flex:1; width:100%; border:0 !important; outline:0 !important; background:transparent !important; box-shadow:none !important; padding:0 !important; color:#1a2942 !important; font-size:11px !important; }
body.md3 .export-actions { display:flex; align-items:center; gap:7px; }
body.md3 .export-actions > span { display:block; width:100%; font-size:8.5px; color:#6e7d93; margin-right:2px; }
body.md3 .export-actions .action-btn { height:38px; min-width:86px; border-radius:8px !important; border:0 !important; padding:0 11px !important; display:flex; align-items:center; justify-content:center; gap:6px; font-size:9.5px !important; font-weight:700; }
body.md3 .excel-btn { background:#dff5e7 !important; color:#147b48 !important; }
body.md3 .pdf-btn { background:#ffe8e8 !important; color:#c2313d !important; }
body.md3 .registered-filter-row { display:flex; gap:8px; align-items:center; margin:6px 0 13px; }
body.md3 .filter-chip { min-width:52px; height:32px; border:1px solid var(--ui-line); background:#fff; color:#50607a; border-radius:18px; padding:0 13px; font-size:9.5px; font-weight:700; cursor:pointer; }
body.md3 .filter-chip.active { background:#3478ea; border-color:#3478ea; color:#fff; }
body.md3 .registered-table-card { border:1px solid var(--ui-line); border-radius:11px !important; background:#fff !important; box-shadow:none !important; overflow:auto !important; }
body.md3 .exact-registered .data-table { width:100%; border-collapse:collapse; min-width:920px; }
body.md3 .exact-registered .data-table thead th { background:#f4f7fb !important; color:#34445e !important; font-size:9px !important; font-weight:700 !important; padding:11px 12px !important; border-bottom:1px solid #dde5ee !important; text-align:left !important; }
body.md3 .exact-registered .data-table tbody td { padding:11px 12px !important; border-bottom:1px solid #e6ecf2 !important; color:#42516a !important; font-size:9.5px !important; vertical-align:middle !important; }
body.md3 .exact-registered .data-table tbody tr:hover { background:#f7fbff; }
body.md3 .exact-registered .data-table td strong { display:block; color:#20304b; font-size:9.5px; }
body.md3 .exact-registered .data-table td small { display:block; color:#8793a4; font-size:8px; margin-top:1px; }
body.md3 .rc-cell { color:#304767 !important; font-weight:600; white-space:nowrap; }
body.md3 .scheme-pill { display:inline-flex; align-items:center; justify-content:center; min-width:43px; min-height:23px; padding:0 9px; border-radius:12px; font-size:8.5px; font-weight:800; }
body.md3 .scheme-aay { background:#ffe1e2; color:#b6333d; }
body.md3 .scheme-phh { background:#dfeeff; color:#2766bd; }
body.md3 .scheme-other { background:#eee8ff; color:#654ac1; }
body.md3 .table-status { display:inline-flex; align-items:center; min-height:23px; padding:0 10px; border-radius:12px; font-size:8px; font-weight:700; }
body.md3 .table-status.success { background:#dbf5e5; color:#18824f; }
body.md3 .table-status.pending { background:#fff0d7; color:#b96f11; }
body.md3 .table-status.active { background:#e3f6e9; color:#1e7e4e; }
body.md3 .row-chevron { width:28px; height:28px; display:grid; place-items:center; border:0; border-radius:7px; background:transparent; color:#2367c6; cursor:pointer; }
body.md3 .row-chevron:hover { background:#eaf2ff; }
body.md3 .row-chevron .material-symbols-rounded { font-size:18px; }
body.md3 .exact-registered .pagination-bar { margin-top:14px; min-height:38px; display:flex; justify-content:space-between; align-items:center; color:#607089; font-size:9px; }
body.md3 .page-btn-group { display:flex; gap:6px; }
body.md3 .page-btn { min-width:31px !important; height:31px !important; border:1px solid var(--ui-line) !important; border-radius:7px !important; background:#fff !important; color:#53637b !important; font-size:9px !important; }
body.md3 .page-btn.active { background:#e8f1ff !important; color:#2366c9 !important; border-color:#81aef5 !important; }

/* Card-details right drawer */
body.md3 .detail-modal#registeredCardModal { position:fixed !important; inset:72px 0 0 0 !important; z-index:120 !important; background:rgba(15,31,58,.14) !important; display:flex !important; justify-content:flex-end !important; align-items:stretch !important; padding:0 !important; }
body.md3 .detail-modal#registeredCardModal[hidden] { display:none !important; }
body.md3 #registeredCardModal .detail-modal-card { width:min(390px,92vw) !important; max-width:none !important; height:100% !important; max-height:none !important; border-radius:0 !important; border:0 !important; border-left:1px solid var(--ui-line) !important; background:#fff !important; box-shadow:-12px 0 35px rgba(30,49,74,.12) !important; display:flex; flex-direction:column; overflow:hidden; }
body.md3 #registeredCardModal .detail-modal-header { min-height:80px; padding:17px 18px 14px !important; border-bottom:1px solid var(--ui-line); background:#fff !important; align-items:flex-start !important; }
body.md3 #registeredCardModal .detail-modal-eyebrow { display:none; }
body.md3 .drawer-title-line { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; width:100%; }
body.md3 .drawer-kicker { display:block; font-size:12px; font-weight:800; color:#15243c; margin-bottom:8px; }
body.md3 .drawer-title-line h2 { margin:0 !important; font-size:13px !important; color:#263651 !important; }
body.md3 .drawer-status { padding:5px 10px; border-radius:14px; font-size:8.5px; font-weight:800; }
body.md3 .drawer-status.distributed, body.md3 .drawer-status.active { background:#dff5e6; color:#137d49; }
body.md3 .drawer-status.pending { background:#fff0da; color:#b77111; }
body.md3 #registeredCardModal .detail-modal-close { width:30px !important; height:30px !important; border-radius:50% !important; background:transparent !important; color:#44536b !important; margin-left:6px; }
body.md3 #registeredCardModal .detail-modal-body { padding:0 18px 24px !important; overflow:auto; flex:1; }
body.md3 .drawer-block { padding:16px 0; border-bottom:1px solid #e8edf3; }
body.md3 .drawer-label, body.md3 .drawer-block small { color:#7a8799; font-size:8.5px; }
body.md3 .family-head-block h3 { margin:5px 0 2px; font-size:14px; color:#16263f; }
body.md3 .family-head-block > span:last-of-type { color:#5d6d84; font-size:10px; }
body.md3 .drawer-metrics { display:grid; grid-template-columns:1fr 1fr; margin-top:15px; }
body.md3 .drawer-metrics > div { display:flex; flex-direction:column; gap:5px; }
body.md3 .drawer-metrics > div + div { border-left:1px solid #e4e9ef; padding-left:18px; }
body.md3 .drawer-metrics > div > strong:not(.scheme-pill) { font-size:12px; color:#1e2e48; }
body.md3 .drawer-section-title { font-size:10px; font-weight:800; color:#23344f; margin-bottom:10px; }
body.md3 .drawer-member-list { list-style:none; margin:0; padding:0; display:grid; gap:7px; }
body.md3 .drawer-member-list li { display:grid; grid-template-columns:20px 1fr auto; gap:5px; align-items:center; font-size:9px; }
body.md3 .drawer-member-list li > span { color:#78869a; }
body.md3 .drawer-member-list li > strong { color:#273750; font-size:9px; }
body.md3 .drawer-member-list li > small { color:#66748a; font-size:8px; white-space:nowrap; }
body.md3 .drawer-contact-row { display:grid; grid-template-columns:26px 1fr; gap:8px; margin-bottom:14px; }
body.md3 .drawer-contact-row:last-child { margin-bottom:0; }
body.md3 .drawer-contact-row > .material-symbols-rounded { font-size:19px; color:#52627a; }
body.md3 .drawer-contact-row > div { display:flex; flex-direction:column; gap:3px; }
body.md3 .drawer-contact-row strong { color:#263650; font-size:9.5px; }
body.md3 .drawer-contact-row span:not(.material-symbols-rounded) { color:#7c899b; font-size:8.2px; line-height:1.4; }
body.md3 .card-whatsapp-wrapper { margin-top:2px; }
body.md3 .card-whatsapp-view { display:flex; align-items:center; gap:6px; }
body.md3 .card-whatsapp-link { color:#1169c5 !important; text-decoration:none; font-weight:700; font-size:10px; }
body.md3 .card-icon-action-btn { width:24px !important; height:24px !important; border-radius:6px !important; }
body.md3 .card-whatsapp-edit-box { display:flex; gap:5px; flex-wrap:wrap; }
body.md3 .card-whatsapp-input { width:150px; height:31px; border:1px solid var(--ui-line); border-radius:7px; padding:0 8px; }
body.md3 .card-whatsapp-save-btn, body.md3 .card-whatsapp-cancel-btn { height:31px; border:0; border-radius:7px; padding:0 9px; }
body.md3 .drawer-actions { display:grid; gap:8px; padding-top:16px; }
body.md3 .drawer-actions button { height:38px; border:1px solid var(--ui-line); border-radius:8px; background:#fff; color:#29405f; display:flex; align-items:center; gap:8px; padding:0 11px; font-size:9.5px; font-weight:700; cursor:pointer; }
body.md3 .drawer-actions button:hover { background:#f6f9fd; }
body.md3 .drawer-actions .material-symbols-rounded { font-size:18px; }

/* Assistant simulator */
body.md3 .exact-bot { max-width:1400px; margin:0 auto; }
body.md3 .bot-page-heading { display:flex; justify-content:space-between; align-items:flex-start; margin:2px 0 18px; gap:20px; }
body.md3 .bot-page-heading h2 { margin:0; font:800 29px/1.1 "Outfit"; color:#10213d; }
body.md3 .bot-page-heading p { margin:6px 0 0; color:#687891; font-size:11px; }
body.md3 .simulation-badge { min-width:170px; display:flex; gap:9px; padding:10px 12px; border-radius:10px; background:#e9f3ff; color:#2364c5; }
body.md3 .simulation-badge > .material-symbols-rounded { font-size:20px; }
body.md3 .simulation-badge div { display:flex; flex-direction:column; gap:2px; }
body.md3 .simulation-badge strong { font-size:9.5px; }
body.md3 .simulation-badge span { font-size:7.5px; }
body.md3 .bot-exact-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(290px,.8fr); gap:14px; min-height:690px; }
body.md3 .exact-chat { background:#fff !important; border:1px solid var(--ui-line) !important; border-radius:13px !important; box-shadow:none !important; display:flex; flex-direction:column; min-height:690px; overflow:hidden; }
body.md3 .exact-chat-header { min-height:62px; padding:12px 16px !important; border-bottom:1px solid #edf1f5; background:#fff !important; display:flex; justify-content:space-between; align-items:center; }
body.md3 .chat-header-info { display:flex; gap:9px; align-items:center; }
body.md3 .assistant-avatar, body.md3 .msg-avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:#dff5e8; color:#158b52; flex:0 0 auto; }
body.md3 .assistant-avatar .material-symbols-rounded, body.md3 .msg-avatar .material-symbols-rounded { font-size:19px; }
body.md3 .chat-bot-title { display:block; color:#1a2b45; font-size:10.5px; font-weight:800; }
body.md3 .chat-bot-sub { display:block; color:#8390a2; font-size:8px; margin-top:2px; }
body.md3 .clear-chat-btn { height:32px; border:0 !important; background:#f4f7fb !important; color:#61718a !important; border-radius:8px !important; padding:0 10px !important; display:flex; gap:5px; align-items:center; font-size:8px !important; }
body.md3 .clear-chat-btn .material-symbols-rounded { font-size:16px; }
body.md3 .exact-chat .chat-messages { flex:1; min-height:480px; max-height:none !important; overflow:auto; padding:14px 18px 10px !important; background:#fff !important; display:flex; flex-direction:column; gap:13px; }
body.md3 .chat-day-label { align-self:center; padding:4px 11px; border-radius:12px; background:#f1f4f8; color:#8793a5; font-size:8px; }
body.md3 .exact-chat .message { display:flex; gap:8px; align-items:flex-start; width:100%; }
body.md3 .exact-chat .user-message { justify-content:flex-end; }
body.md3 .exact-chat .msg-bubble { max-width:66%; padding:10px 12px !important; border-radius:11px !important; background:#f0f2f6 !important; color:#304059 !important; box-shadow:none !important; }
body.md3 .exact-chat .bot-message .msg-bubble { border-top-left-radius:4px !important; }
body.md3 .exact-chat .user-message .msg-bubble { background:#e7f1ff !important; color:#20518b !important; border-top-right-radius:4px !important; }
body.md3 .exact-chat .msg-text { font-size:10px !important; line-height:1.55; }
body.md3 .exact-chat .msg-time { margin-top:5px; color:#8b97a8; font-size:7.5px !important; text-align:right; }
body.md3 .exact-chat .msg-author { display:none !important; }
body.md3 .chat-suggestions { padding:0 16px 10px; display:flex; gap:7px; flex-wrap:wrap; }
body.md3 .chat-suggestions .cmd-chip { height:30px; border:1px solid #cfe0f7 !important; border-radius:16px !important; background:#f4f8ff !important; color:#2d6bca !important; padding:0 11px !important; font-size:8px !important; }
body.md3 .exact-chat-input { margin:0 16px; min-height:46px; display:grid !important; grid-template-columns:24px 1fr 42px; gap:7px; align-items:center; border-top:1px solid #edf1f5 !important; padding:8px 0 !important; background:#fff !important; }
body.md3 .attachment-icon { color:#77869b; font-size:18px; }
body.md3 .exact-chat-input .chat-input { height:36px !important; border:1px solid #d9e2ec !important; border-radius:8px !important; padding:0 11px !important; background:#fff !important; color:#263650 !important; font-size:9px !important; }
body.md3 .exact-chat-input .chat-send-btn { width:38px !important; height:36px !important; border:0 !important; border-radius:8px !important; background:#74a9f4 !important; color:#fff !important; display:grid !important; place-items:center !important; }
body.md3 .exact-chat-input .chat-send-btn .material-symbols-rounded { font-size:18px; }
body.md3 .chat-footnote { padding:3px 16px 11px; color:#7d8b9e; font-size:7.5px; display:flex; align-items:center; gap:5px; }
body.md3 .chat-footnote .material-symbols-rounded { font-size:14px; color:#e3a51b; }
body.md3 .bot-side-column { display:grid; align-content:start; gap:14px; }
body.md3 .bot-side-card { background:#fff; border:1px solid var(--ui-line); border-radius:13px; padding:16px; box-shadow:0 3px 12px rgba(30,55,80,.025); }
body.md3 .side-card-title { display:flex; gap:10px; align-items:flex-start; margin-bottom:13px; }
body.md3 .side-card-title > .material-symbols-rounded { width:34px; height:34px; border-radius:9px; display:grid; place-items:center; background:#e6f5ea; color:#218858; font-size:19px; }
body.md3 .side-card-title h3 { margin:0; font-size:11.5px; color:#172740; }
body.md3 .side-card-title p { margin:3px 0 0; font-size:8px; color:#77869a; line-height:1.4; }
body.md3 .context-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; padding:13px; border-radius:11px; background:#f3f6fb; }
body.md3 .context-grid div { display:flex; flex-direction:column; gap:4px; }
body.md3 .context-grid small { font-size:8px; color:#7b899b; }
body.md3 .context-grid strong { font-size:9px; color:#273750; line-height:1.35; }
body.md3 .bot-tool-list { display:grid; gap:8px; }
body.md3 .bot-tool-list button { width:100%; border:0; border-radius:10px; min-height:58px; padding:8px 10px; display:grid; grid-template-columns:38px 1fr 18px; gap:9px; align-items:center; text-align:left; background:#eff9f4; color:#25624a; cursor:pointer; }
body.md3 .bot-tool-list button:nth-child(2) { background:#edf4ff; color:#2b61b5; }
body.md3 .bot-tool-list button:nth-child(3) { background:#f5efff; color:#6845bd; }
body.md3 .bot-tool-list button:nth-child(4) { background:#fff0f3; color:#b23f65; }
body.md3 .tool-ico { width:32px; height:32px; border-radius:9px; display:grid; place-items:center; background:rgba(255,255,255,.55); }
body.md3 .tool-ico .material-symbols-rounded { font-size:18px; }
body.md3 .bot-tool-list button > span:nth-child(2) { display:flex; flex-direction:column; gap:2px; }
body.md3 .bot-tool-list b { font-size:9px; }
body.md3 .bot-tool-list small { font-size:7.5px; opacity:.75; }
body.md3 .bot-tool-list button > .material-symbols-rounded { font-size:17px; }
body.md3 .pro-tip { display:flex; gap:10px; background:#f2fbf5; border-color:#d9efdf; }
body.md3 .pro-tip > .material-symbols-rounded { color:#2a8b5a; }
body.md3 .pro-tip h3 { margin:0 0 4px; font-size:10px; color:#276246; }
body.md3 .pro-tip p { margin:0; color:#6c7d73; font-size:8px; line-height:1.55; }

/* Retain consistency on other report views */
body.md3 .workspace-heading h2 { color:#12233f !important; }
body.md3 .table-toolbar, body.md3 .table-responsive, body.md3 .glass-panel { box-shadow:none; }
body.md3 .workspace-heading, body.md3 .table-toolbar, body.md3 .table-responsive { max-width:1400px; margin-left:auto; margin-right:auto; }

/* Dark mode remains available, but image-matched light mode is the primary design */





/* Responsive */
@media (max-width: 1260px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:260px minmax(280px,1fr) auto; gap:16px; padding:0 16px; }
  body.md3 .portal-compact { display:none; }
  body.md3 .dashboard-shell { grid-template-columns:190px minmax(0,1fr); }
  body.md3 .exact-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  body.md3 .overview-main-grid { grid-template-columns:1.15fr .85fr; }
  body.md3 .overview-side-stack { grid-column:1 / -1; grid-template-columns:1fr 1fr; grid-template-rows:auto; }
  body.md3 .overview-selectors { min-width:480px; }
}
@media (max-width: 980px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:220px 1fr auto; }
  body.md3 .global-search { display:none; }
  body.md3 .top-user-copy, body.md3 .top-chevron { display:none; }
  body.md3 .top-user { min-width:auto; }
  body.md3 .dashboard-shell { grid-template-columns:72px minmax(0,1fr); }
  body.md3 .exact-sidebar { padding:14px 8px !important; }
  body.md3 .exact-sidebar .tab-btn { justify-content:center; padding:0; }
  body.md3 .exact-sidebar .tab-btn > span:not(.tab-icon):not(.tab-count-badge) { display:none; }
  body.md3 .exact-sidebar .tab-btn.active::before { display:none; }
  body.md3 .exact-sidebar .tab-count-badge { display:none; }
  body.md3 .sidebar-help-card, body.md3 .sidebar-context { display:none; }
  body.md3 .overview-topline { flex-direction:column; }
  body.md3 .overview-selectors { min-width:0; width:100%; }
  body.md3 .overview-main-grid { grid-template-columns:1fr; }
  body.md3 .overview-side-stack { grid-column:auto; }
  body.md3 .bot-exact-layout { grid-template-columns:1fr; }
  body.md3 .bot-side-column { grid-template-columns:1fr 1fr; }
  body.md3 .pro-tip { grid-column:1 / -1; }
}
@media (max-width: 720px) {
  body.md3 .exact-topbar { height:62px; }
  body.md3 .exact-topbar .nav-container { height:62px; grid-template-columns:1fr auto; padding:0 12px; }
  body.md3 .brand-copy .nav-subtitle, body.md3 .notification-btn, body.md3 .top-language, body.md3 .top-auth { display:none !important; }
  body.md3 .dashboard-shell { display:block !important; }
  body.md3 .exact-sidebar { position:fixed !important; z-index:75; top:auto; bottom:0; left:0; right:0; width:100%; height:63px; padding:6px 7px !important; border-right:0 !important; border-top:1px solid var(--ui-line) !important; overflow-x:auto; overflow-y:hidden; }
  body.md3 .exact-sidebar .sidebar-nav { display:flex; flex-direction:row; min-width:max-content; gap:3px; }
  body.md3 .exact-sidebar .tab-btn { width:54px; min-width:54px; height:50px; min-height:50px; flex-direction:column; gap:2px; border-radius:9px; }
  body.md3 .exact-sidebar .tab-btn > span:nth-child(2) { display:block !important; max-width:50px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:6px; }
  body.md3 .exact-sidebar .tab-icon { width:auto; min-width:0; font-size:19px; }
  body.md3 .sidebar-spacer { display:none; }
  body.md3 .dashboard-workspace { padding:18px 12px 82px; }
  body.md3 .overview-selectors { grid-template-columns:1fr; }
  body.md3 .exact-kpis { grid-template-columns:1fr 1fr; gap:9px !important; }
  body.md3 .exact-kpis .kpi-card { min-height:152px !important; }
  body.md3 .overview-side-stack { grid-template-columns:1fr; }
  body.md3 .progress-hero { gap:15px; }
  body.md3 .donut { width:110px; height:110px; flex-basis:110px; }
  body.md3 .donut::after { width:80px; height:80px; }
  body.md3 .registered-head-row, body.md3 .registered-toolbar, body.md3 .bot-page-heading { flex-direction:column; }
  body.md3 .registered-total { border-left:0; padding-left:0; }
  body.md3 .registered-search { width:100%; }
  body.md3 .export-actions { width:100%; }
  body.md3 .bot-side-column { grid-template-columns:1fr; }
  body.md3 .exact-chat { min-height:620px; }
  body.md3 .exact-chat .msg-bubble { max-width:82%; }
  body.md3 #registeredCardModal { inset:62px 0 63px 0 !important; }
}
/* Neutralize earlier MD3 span rules on the image-matched KPI grid. */
body.md3 .exact-kpis > .kpi-card:nth-child(n) { grid-column:auto !important; }
body.md3 #registeredCardModalClose { width:30px !important; height:30px !important; min-width:30px !important; border:0 !important; border-radius:50% !important; background:transparent !important; color:#44536b !important; font-size:20px !important; display:grid !important; place-items:center !important; }
body.md3 #registeredCardModal .detail-modal-header > div:first-child { flex:1; min-width:0; }

/* ===== refinement.css ===== */
/* FPS Assistant — refinement pass R1
   Color/typography reference: user-provided Material Design 2 starter. */
:root {
  --m2-primary:#6200EE;
  --m2-primary-variant:#3700B3;
  --m2-secondary:#03DAC6;
  --m2-bg:#FAFAFA;
  --m2-surface:#FFFFFF;
  --m2-error:#B00020;
  --m2-on-primary:#FFFFFF;
  --m2-on-surface:#000000;
  --m2-text2:rgba(0,0,0,.60);
  --m2-text3:rgba(0,0,0,.38);
  --m2-divider:rgba(0,0,0,.12);
  --m2-e1:0 1px 3px rgba(0,0,0,.20),0 1px 1px rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);
  --m2-e2:0 1px 5px rgba(0,0,0,.20),0 2px 2px rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12);
  --m2-e4:0 2px 4px -1px rgba(0,0,0,.20),0 4px 5px rgba(0,0,0,.14),0 1px 10px rgba(0,0,0,.12);
  --m2-e8:0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);

  --ui-bg:var(--m2-bg);
  --ui-surface:var(--m2-surface);
  --ui-surface-soft:#F7F5FB;
  --ui-line:var(--m2-divider);
  --ui-line-strong:rgba(0,0,0,.28);
  --ui-text:#1C1B1F;
  --ui-muted:#625B71;
  --ui-blue:var(--m2-primary);
  --ui-blue-soft:#EDE7F6;
  --ui-green:#018786;
  --ui-green-soft:#E0F2F1;
  --ui-amber:#E65100;
  --ui-amber-soft:#FFF3E0;
  --ui-red:var(--m2-error);
  --ui-red-soft:#FCE4EC;
  --ui-purple:var(--m2-primary-variant);
  --ui-purple-soft:#EDE7F6;
  --ui-shadow:var(--m2-e1);
  --ui-radius:8px;
}

@font-face { font-family:"Noto Sans Devanagari Local"; src:url("/asset/fonts/NotoSansDevanagari.ttf") format("truetype"); font-display:swap; }

body.md3,
body.md3 button,
body.md3 input,
body.md3 select,
body.md3 textarea {
  font-family:Roboto,"Noto Sans Devanagari","Noto Sans Devanagari Local",Arial,sans-serif !important;
}
body.md3 { background:var(--m2-bg) !important; color:#1c1b1f !important; font-size:14px !important; line-height:1.45; }
body.md3.hindi-language { font-family:"Noto Sans Devanagari","Noto Sans Devanagari Local",Roboto,sans-serif !important; }

/* Universal app bar */
body.md3 .exact-topbar.m2-topbar {
  height:64px !important;
  background:var(--m2-primary) !important;
  border:0 !important;
  box-shadow:var(--m2-e4) !important;
  backdrop-filter:none !important;
}
body.md3 .exact-topbar .nav-container {
  height:64px !important;
  grid-template-columns:270px minmax(360px,680px) minmax(430px,1fr) !important;
  gap:22px !important;
  padding:0 18px !important;
}
body.md3 .exact-topbar .logo-badge {
  width:40px !important; height:40px !important; border-radius:50% !important; background:#fff !important;
  box-shadow:0 1px 2px rgba(0,0,0,.16) !important;
}
body.md3 .exact-topbar .app-logo { width:32px !important; height:32px !important; }
body.md3 .exact-topbar .nav-title { color:#fff !important; font:500 20px/1.15 Roboto,sans-serif !important; letter-spacing:.01em; }
body.md3 .exact-topbar .nav-subtitle { color:rgba(255,255,255,.78) !important; font-size:11px !important; }

body.md3 .m2-global-search {
  height:42px !important; border:0 !important; border-radius:4px !important; padding:0 10px 0 12px !important;
  background:rgba(255,255,255,.17) !important; color:#fff !important; box-shadow:none !important;
  transition:background .18s ease,box-shadow .18s ease;
}
body.md3 .m2-global-search:focus-within { background:rgba(255,255,255,.24) !important; box-shadow:inset 0 0 0 1px rgba(255,255,255,.46) !important; }
body.md3 .m2-global-search .material-symbols-rounded { color:#fff !important; font-size:21px; }
body.md3 .m2-global-search input { color:#fff !important; font-size:14px !important; font-weight:400 !important; }
body.md3 .m2-global-search input::placeholder { color:rgba(255,255,255,.72) !important; }
body.md3 .m2-global-search kbd { border:1px solid rgba(255,255,255,.34) !important; background:rgba(0,0,0,.12) !important; color:#fff !important; border-radius:4px !important; font-size:10px !important; }
body.md3 .global-search-scope {
  flex:0 0 auto; max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  padding:4px 8px; border-radius:12px; background:rgba(255,255,255,.16); color:#fff; font-size:10px; font-weight:500;
}

body.md3 .portal-compact strong, body.md3 .portal-compact span, body.md3 .portal-compact b { color:#fff !important; }
body.md3 .portal-compact span { opacity:.78; }
body.md3 .portal-compact .pulsing-dot { background:var(--m2-secondary) !important; box-shadow:0 0 0 4px rgba(3,218,198,.18) !important; }
body.md3 .top-icon-btn { color:#fff !important; border-radius:50% !important; }
body.md3 .top-icon-btn:hover { background:rgba(255,255,255,.15) !important; }
body.md3 .top-language { color:#fff !important; background:rgba(255,255,255,.12) !important; border:1px solid rgba(255,255,255,.28) !important; border-radius:4px !important; font-size:12px !important; font-weight:500 !important; }
body.md3 .notification-dot { background:var(--m2-error) !important; border-color:var(--m2-primary) !important; }
body.md3 .top-user {
  border:0; background:transparent; color:#fff; min-width:175px; border-radius:4px; padding:5px 7px; cursor:pointer; text-align:left;
}
body.md3 .top-user:hover, body.md3 .top-user[aria-expanded="true"] { background:rgba(255,255,255,.13); }
body.md3 .top-avatar { width:36px !important; height:36px !important; min-width:36px !important; background:#fff !important; color:var(--m2-primary) !important; font-size:14px !important; }
body.md3 .top-user-copy strong { color:#fff !important; font-size:13px !important; font-weight:500 !important; }
body.md3 .top-user-copy span { color:rgba(255,255,255,.76) !important; font-size:11px !important; }
body.md3 .top-chevron { color:rgba(255,255,255,.84) !important; }
body.md3 .top-auth { color:#fff !important; border:1px solid rgba(255,255,255,.36) !important; background:rgba(255,255,255,.10) !important; }

/* Profile drawer card */
.profile-drawer-scrim[hidden], .profile-drawer-card[hidden] { display:none !important; }
body.md3 .profile-drawer-scrim { position:fixed; inset:64px 0 0; z-index:88; background:rgba(0,0,0,.20); opacity:0; transition:opacity .18s ease; }
body.md3 .profile-drawer-card {
  position:fixed; z-index:89; top:72px; right:14px; width:min(370px,calc(100vw - 28px)); max-height:calc(100vh - 88px);
  overflow:auto; background:#fff; border-radius:8px; box-shadow:var(--m2-e8); transform:translateY(-8px) scale(.985); opacity:0;
  transform-origin:top right; transition:transform .18s ease,opacity .18s ease;
}
body.profile-drawer-open .profile-drawer-scrim { opacity:1; }
body.profile-drawer-open .profile-drawer-card { transform:none; opacity:1; }
body.md3 .profile-drawer-hero {
  position:relative; display:grid; grid-template-columns:56px 1fr 34px; gap:12px; align-items:center;
  padding:20px 18px; background:linear-gradient(135deg,var(--m2-primary),var(--m2-primary-variant)); color:#fff;
}
body.md3 .profile-drawer-avatar { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; background:#fff; color:var(--m2-primary); font-size:22px; font-weight:700; background-size:cover; background-position:center; }
body.md3 .profile-drawer-avatar.has-photo span { opacity:0; }
body.md3 .profile-drawer-identity { display:flex; flex-direction:column; min-width:0; }
body.md3 .profile-drawer-identity small { font-size:11px; opacity:.78; }
body.md3 .profile-drawer-identity strong { font-size:16px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.md3 .profile-drawer-identity span { font-size:12px; opacity:.82; }
body.md3 .profile-drawer-close { width:34px; height:34px; display:grid; place-items:center; color:#fff; background:transparent; border-radius:50%; }
body.md3 .profile-drawer-close:hover { background:rgba(255,255,255,.15); }
body.md3 .profile-drawer-body { padding:16px; display:grid; gap:14px; }
body.md3 .profile-location-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
body.md3 .profile-location-grid > div { display:grid; grid-template-columns:32px 1fr; gap:8px; align-items:center; padding:11px; border:1px solid var(--m2-divider); border-radius:4px; background:#fff; }
body.md3 .profile-location-grid .material-symbols-rounded { color:var(--m2-primary); font-size:20px; }
body.md3 .profile-location-grid p { margin:0; display:flex; flex-direction:column; }
body.md3 .profile-location-grid small, body.md3 .profile-plan-card small { color:var(--m2-text2); font-size:11px; }
body.md3 .profile-location-grid strong { color:#212121; font-size:13px; font-weight:500; }
body.md3 .profile-plan-card { padding:14px; border-radius:4px; background:#F7F3FC; border:1px solid #E1D5F4; }
body.md3 .profile-plan-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
body.md3 .profile-plan-heading > div { display:flex; flex-direction:column; }
body.md3 .profile-plan-heading strong { color:var(--m2-primary-variant); font-size:16px; font-weight:500; }
body.md3 .profile-plan-status { padding:4px 8px; border-radius:12px; background:#C8E6C9; color:#1B5E20; font-size:11px; font-weight:500; }
body.md3 .profile-plan-status[data-status="expired"] { background:#FFCDD2; color:#B71C1C; }
body.md3 .profile-plan-status[data-status="unavailable"] { background:#E0E0E0; color:#616161; }
body.md3 .profile-plan-progress { height:4px; margin:13px 0 10px; overflow:hidden; background:#D1C4E9; }
body.md3 .profile-plan-progress span { display:block; height:100%; width:0; background:var(--m2-primary); transition:width .3s ease; }
body.md3 .profile-plan-meta { display:grid; grid-template-columns:.8fr 1.2fr 1fr; gap:12px; }
body.md3 .profile-plan-meta span { display:flex; flex-direction:column; }
body.md3 .profile-plan-meta b { font-size:12px; color:#312D36; font-weight:500; }
body.md3 .profile-secondary-action, body.md3 .profile-signout-btn { min-height:44px; display:flex; align-items:center; gap:10px; padding:0 12px; border-radius:4px; font-size:14px; font-weight:500; cursor:pointer; }
body.md3 .profile-secondary-action { color:var(--m2-primary); border:1px solid rgba(98,0,238,.28); background:#fff; }
body.md3 .profile-signout-btn { width:100%; justify-content:center; color:#fff; background:var(--m2-primary); box-shadow:var(--m2-e2); border:0; }
body.md3 .profile-signout-btn:hover { background:var(--m2-primary-variant); }

/* Main shell and navigation */
body.md3 .dashboard-shell { min-height:calc(100vh - 64px) !important; }
body.md3 .exact-sidebar { top:64px !important; height:calc(100vh - 64px) !important; background:#fff !important; border-right:1px solid var(--m2-divider) !important; }
body.md3 .exact-sidebar .tab-btn { border-radius:4px !important; font-size:14px !important; font-weight:500 !important; color:rgba(0,0,0,.65) !important; min-height:48px !important; }
body.md3 .exact-sidebar .tab-btn:hover { background:rgba(0,0,0,.04) !important; color:#212121 !important; }
body.md3 .exact-sidebar .tab-btn.active { background:rgba(98,0,238,.10) !important; color:var(--m2-primary) !important; }
body.md3 .exact-sidebar .tab-btn.active::before { background:var(--m2-primary) !important; }
body.md3 .exact-sidebar .tab-count-badge { background:rgba(0,0,0,.07) !important; color:rgba(0,0,0,.60) !important; font-size:11px !important; }
body.md3 .sidebar-help-card { border-radius:4px !important; background:#F5F2F8 !important; color:var(--m2-primary-variant) !important; }
body.md3 .sidebar-help-card strong { font-size:13px !important; }
body.md3 .sidebar-help-card span { font-size:11px !important; }
body.md3 .sidebar-context small { font-size:10px !important; }
body.md3 .sidebar-context b { font-size:12px !important; }
body.md3 .dashboard-workspace { padding-top:28px !important; }

/* Typography scale */
body.md3 .overview-title-copy h2,
body.md3 .registered-head-row h2,
body.md3 .bot-page-heading h2,
body.md3 .workspace-heading h2 { font:500 28px/1.2 Roboto,"Noto Sans Devanagari",sans-serif !important; letter-spacing:0 !important; color:#212121 !important; }
body.md3 .overview-title-copy h3 { font:500 20px/1.3 "Noto Sans Devanagari",Roboto,sans-serif !important; color:#312D36 !important; }
body.md3 .overview-title-copy p,
body.md3 .registered-head-row p,
body.md3 .bot-page-heading p,
body.md3 .workspace-heading p { font-size:14px !important; color:var(--m2-text2) !important; line-height:1.5 !important; }
body.md3 .workspace-eyebrow { color:var(--m2-primary) !important; font-size:11px !important; font-weight:700 !important; letter-spacing:.08em !important; }
body.md3 .panel-heading h3, body.md3 .side-card-title h3, body.md3 .chat-bot-title { font-size:16px !important; font-weight:500 !important; }
body.md3 .panel-heading p, body.md3 .side-card-title p, body.md3 .chat-bot-sub { font-size:12px !important; }

/* KPI cards: M2 surfaces with top accents */
body.md3 .exact-kpis .kpi-card { position:relative; background:#fff !important; border:0 !important; border-radius:4px !important; box-shadow:var(--m2-e1) !important; min-height:168px !important; padding:18px 16px 14px !important; overflow:hidden; }
body.md3 .exact-kpis .kpi-card::before { content:""; position:absolute; inset:0 0 auto; height:4px; background:var(--m2-primary); }
body.md3 .exact-kpis .card-green::before { background:#018786; }
body.md3 .exact-kpis .card-amber::before { background:#E65100; }
body.md3 .exact-kpis .card-red::before { background:var(--m2-error); }
body.md3 .exact-kpis .card-purple::before { background:var(--m2-primary-variant); }
body.md3 .exact-kpis .kpi-card:hover { box-shadow:var(--m2-e4) !important; transform:none !important; }
body.md3 .exact-kpis .kpi-icon-wrap { width:40px !important; height:40px !important; border-radius:50% !important; background:#EDE7F6 !important; color:var(--m2-primary) !important; }
body.md3 .exact-kpis .card-green .kpi-icon-wrap { background:#E0F2F1 !important; color:#018786 !important; }
body.md3 .exact-kpis .card-amber .kpi-icon-wrap { background:#FFF3E0 !important; color:#E65100 !important; }
body.md3 .exact-kpis .card-red .kpi-icon-wrap { background:#FCE4EC !important; color:var(--m2-error) !important; }
body.md3 .exact-kpis .card-purple .kpi-icon-wrap { background:#EDE7F6 !important; color:var(--m2-primary-variant) !important; }
body.md3 .exact-kpis .kpi-value { font:400 36px/1.05 Roboto,sans-serif !important; color:#212121 !important; margin-top:2px !important; }
body.md3 .exact-kpis .kpi-label { font-size:14px !important; font-weight:500 !important; color:#212121 !important; }
body.md3 .exact-kpis .kpi-hindi { font-size:12px !important; color:var(--m2-text2) !important; }
body.md3 .exact-kpis .kpi-caption { font-size:12px !important; color:var(--m2-text2) !important; }
body.md3 .exact-kpis .kpi-trend { color:var(--m2-primary) !important; font-size:12px !important; }
body.md3 .kpi-progress-bar { background:var(--m2-primary) !important; }

/* Material surfaces and consistent reports */
body.md3 .overview-card,
body.md3 .selector-card,
body.md3 .registered-table-card,
body.md3 .exact-chat,
body.md3 .bot-side-card,
body.md3 .table-responsive,
body.md3 .table-toolbar,
body.md3 .report-intro,
body.md3 .historical-banner { border-radius:4px !important; border:0 !important; background:#fff !important; box-shadow:var(--m2-e1) !important; }
body.md3 .selector-card { border:1px solid var(--m2-divider) !important; box-shadow:none !important; }
body.md3 .selector-card:focus-within { border-color:var(--m2-primary) !important; box-shadow:inset 0 0 0 1px var(--m2-primary) !important; }
body.md3 .selector-card > .material-symbols-rounded { color:var(--m2-primary) !important; }

body.md3 .report-command-bar {
  min-height:64px; display:flex !important; align-items:center !important; gap:12px !important; padding:10px 14px !important; margin-bottom:14px !important;
  border-radius:4px !important; background:#fff !important; box-shadow:var(--m2-e1) !important;
}
body.md3 .search-input-wrap, body.md3 .registered-search {
  flex:1; width:auto !important; max-width:680px; min-width:260px; height:42px !important; display:flex; align-items:center; gap:9px;
  padding:0 12px !important; border:1px solid rgba(0,0,0,.30) !important; border-radius:4px !important; background:#fff !important; color:var(--m2-text3) !important;
}
body.md3 .search-input-wrap:focus-within, body.md3 .registered-search:focus-within { border-color:var(--m2-primary) !important; box-shadow:inset 0 0 0 1px var(--m2-primary) !important; }
body.md3 .search-input-wrap .search-icon, body.md3 .registered-search .material-symbols-rounded { color:var(--m2-text3) !important; font-size:20px !important; }
body.md3 .search-input-wrap input, body.md3 .registered-search input { color:#212121 !important; font-size:14px !important; font-weight:400 !important; }
body.md3 .search-input-wrap input::placeholder, body.md3 .registered-search input::placeholder { color:rgba(0,0,0,.46) !important; }
body.md3 .report-search-hint { margin-left:auto; color:var(--m2-text3); font-size:12px; }
body.md3 .toolbar-actions { margin-left:auto; gap:8px !important; }
body.md3 .action-btn, body.md3 .table-action-btn {
  min-height:38px !important; border-radius:4px !important; border:1px solid rgba(0,0,0,.28) !important; background:#fff !important; color:var(--m2-primary) !important;
  font-size:13px !important; font-weight:500 !important; letter-spacing:.03em !important; box-shadow:none !important;
}
body.md3 .action-btn:hover, body.md3 .table-action-btn:hover { background:rgba(98,0,238,.06) !important; }
body.md3 .pdf-btn { background:var(--m2-primary) !important; color:#fff !important; border-color:var(--m2-primary) !important; box-shadow:var(--m2-e2) !important; }
body.md3 .excel-btn { color:#018786 !important; border-color:rgba(1,135,134,.38) !important; }
body.md3 .filter-chip { border-radius:16px !important; font-size:12px !important; background:#E0E0E0 !important; color:#424242 !important; border:0 !important; padding:7px 13px !important; }
body.md3 .filter-chip.active { background:#EDE7F6 !important; color:var(--m2-primary) !important; }
body.md3 .workspace-count, body.md3 .report-summary-pill, body.md3 .stat-pill { border-radius:16px !important; font-size:12px !important; }

/* Tables */
body.md3 .data-table { font-size:13.5px !important; }
body.md3 .data-table thead th { padding:14px 16px !important; color:var(--m2-text2) !important; font-size:12px !important; font-weight:500 !important; background:#fff !important; border-bottom:1px solid var(--m2-divider) !important; }
body.md3 .data-table tbody td { padding:13px 16px !important; border-bottom:1px solid var(--m2-divider) !important; color:#333 !important; }
body.md3 .data-table tbody tr:hover { background:rgba(0,0,0,.025) !important; }
body.md3 .registered-table-card { overflow:auto !important; }
body.md3 .registered-total > .material-symbols-rounded { border-radius:50% !important; background:#EDE7F6 !important; color:var(--m2-primary) !important; }
body.md3 .registered-total small { font-size:12px !important; color:var(--m2-text2) !important; }
body.md3 .registered-total strong { font:400 28px/1.15 Roboto,sans-serif !important; color:var(--m2-primary) !important; }

/* Overview/assistant accents */
body.md3 .donut { background:conic-gradient(var(--m2-primary) calc(var(--progress,0)*1%),#E0E0E0 0) !important; }
body.md3 .overview-progress-message, body.md3 .attention-item strong, body.md3 .quick-action-grid b { color:#312D36 !important; }
body.md3 .quick-action-grid button { border-radius:4px !important; background:#fff !important; border:1px solid var(--m2-divider) !important; }
body.md3 .quick-action-grid button:hover { background:#F7F3FC !important; border-color:#D1C4E9 !important; }
body.md3 .simulation-badge { border-radius:4px !important; background:#EDE7F6 !important; color:var(--m2-primary) !important; }
body.md3 .exact-chat-header { border-radius:4px 4px 0 0 !important; }
body.md3 .chat-send-btn { background:var(--m2-primary) !important; color:#fff !important; }
body.md3 .cmd-chip { border-radius:16px !important; background:#EDE7F6 !important; color:var(--m2-primary) !important; border:0 !important; }
body.md3 .bot-tool-list button { border-radius:4px !important; }

/* Card details readability */
body.md3 #registeredCardModal .detail-modal-header { background:var(--m2-primary) !important; color:#fff !important; }
body.md3 #registeredCardModal .drawer-kicker,
body.md3 #registeredCardModal .drawer-title-line h2,
body.md3 #registeredCardModal .detail-modal-close { color:#fff !important; }
body.md3 .drawer-label, body.md3 .drawer-block small { font-size:11px !important; }
body.md3 .family-head-block h3 { font-size:17px !important; font-weight:500 !important; }
body.md3 .family-head-block > span:last-of-type { font-size:13px !important; }
body.md3 .drawer-section-title { font-size:13px !important; font-weight:500 !important; }
body.md3 .drawer-member-list li, body.md3 .drawer-member-list li > strong { font-size:12px !important; }
body.md3 .drawer-member-list li > small { font-size:11px !important; }
body.md3 .drawer-contact-row strong { font-size:13px !important; }
body.md3 .drawer-contact-row span:not(.material-symbols-rounded) { font-size:11px !important; }
body.md3 .drawer-actions button { font-size:13px !important; border-radius:4px !important; color:var(--m2-primary) !important; }

/* Dark theme: preserve usability while using the same primary brand */









@media (max-width:1260px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:235px minmax(300px,1fr) auto !important; gap:14px !important; }
  body.md3 .portal-compact { display:none !important; }
}
@media (max-width:980px) {
  body.md3 .global-search { display:none !important; }
  body.md3 .exact-topbar .nav-container { grid-template-columns:1fr auto !important; }
}
@media (max-width:720px) {
  body.md3 .exact-topbar.m2-topbar, body.md3 .exact-topbar .nav-container { height:60px !important; }
  body.md3 .exact-sidebar { top:auto !important; }
  body.md3 .profile-drawer-card { top:66px; right:8px; width:calc(100vw - 16px); }
  body.md3 .profile-drawer-scrim { inset:60px 0 0; }
  body.md3 .profile-location-grid { grid-template-columns:1fr; }
  body.md3 .report-command-bar { align-items:stretch !important; flex-direction:column !important; }
  body.md3 .search-input-wrap, body.md3 .registered-search { max-width:none !important; width:100% !important; min-width:0 !important; }
  body.md3 .toolbar-actions { width:100%; margin-left:0 !important; }
  body.md3 .report-search-hint { display:none; }
}

/* ===== refinement-r2.css ===== */
/* FPS Assistant — refinement pass R2
   Full-app Material 2 color system + accessibility typography.
   Reference tokens: primary #6200EE, primary variant #3700B3,
   secondary #03DAC6, background #FAFAFA, surface #FFFFFF. */

:root {
  --r2-primary:#6200EE;
  --r2-primary-variant:#3700B3;
  --r2-secondary:#03DAC6;
  --r2-secondary-dark:#018786;
  --r2-bg:#FAFAFA;
  --r2-surface:#FFFFFF;
  --r2-error:#B00020;
  --r2-text:#1F1B24;
  --r2-text-2:rgba(0,0,0,.68);
  --r2-text-3:rgba(0,0,0,.50);
  --r2-divider:rgba(0,0,0,.12);
  --r2-hover:rgba(98,0,238,.06);
  --r2-selected:rgba(98,0,238,.10);
  --r2-purple-50:#F6F1FF;
  --r2-purple-100:#EDE7F6;
  --r2-teal-50:#E0F7F4;
  --r2-green:#018786;
  --r2-green-soft:#D9F2EA;
  --r2-amber:#E65100;
  --r2-amber-soft:#FFF3E0;
  --r2-red-soft:#FCE4EC;
  --r2-blue:#1565C0;
  --r2-blue-soft:#E3F2FD;
  --r2-e1:0 1px 3px rgba(0,0,0,.20),0 1px 1px rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);
  --r2-e2:0 1px 5px rgba(0,0,0,.20),0 2px 2px rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12);
  --r2-e4:0 2px 4px -1px rgba(0,0,0,.20),0 4px 5px rgba(0,0,0,.14),0 1px 10px rgba(0,0,0,.12);
  --r2-e8:0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);
}

/* Accessibility-first type scale */
html { font-size:16px; }
body.md3,
body.md3 button,
body.md3 input,
body.md3 select,
body.md3 textarea,
body.md3 table {
  font-family:Roboto,"Noto Sans Devanagari","Noto Sans Devanagari Local",Arial,sans-serif !important;
}
body.md3 {
  background:var(--r2-bg) !important;
  color:var(--r2-text) !important;
  font-size:16px !important;
  line-height:1.55 !important;
  letter-spacing:.005em;
}
body.md3 h1, body.md3 h2, body.md3 h3, body.md3 h4 { color:var(--r2-text); letter-spacing:-.012em; }
body.md3 p { font-size:15px; line-height:1.55; }
body.md3 small { font-size:13px; line-height:1.45; }
body.md3 button, body.md3 input, body.md3 select, body.md3 textarea { font-size:15px !important; }
body.md3 .workspace-heading h2,
body.md3 .registered-head-row h2,
body.md3 .bot-page-heading h2,
body.md3 .overview-title-copy h2 { font-size:30px !important; line-height:1.2 !important; font-weight:500 !important; }
body.md3 .overview-title-copy h3 { font-size:23px !important; line-height:1.35 !important; }
body.md3 .workspace-heading p,
body.md3 .registered-head-row p,
body.md3 .bot-page-heading p,
body.md3 .overview-title-copy p { font-size:15px !important; color:var(--r2-text-2) !important; }

/* New compact brand mark */
body.md3 .brand-mark {
  position:relative;
  display:grid !important;
  place-items:center;
  overflow:hidden;
  background:#fff !important;
  color:var(--r2-primary) !important;
  border-radius:50% !important;
  box-shadow:var(--r2-e1) !important;
}
body.md3 .brand-mark .material-symbols-rounded { font-size:28px !important; font-variation-settings:"FILL" 1; }
body.md3 .brand-mark i {
  position:absolute;
  width:10px;
  height:10px;
  right:3px;
  bottom:3px;
  border-radius:50%;
  background:var(--r2-secondary);
  border:2px solid #fff;
}
body.md3 .login-mark.brand-mark { width:60px !important; height:60px !important; margin:0 auto 12px; }
body.md3 .login-mark.brand-mark .material-symbols-rounded { font-size:38px !important; }

/* Universal app bar */
body.md3 .exact-topbar.m2-topbar {
  height:68px !important;
  background:var(--r2-primary) !important;
  box-shadow:var(--r2-e4) !important;
  border:0 !important;
}
body.md3 .exact-topbar .nav-container {
  height:68px !important;
  max-width:none !important;
  display:grid !important;
  grid-template-columns:280px minmax(420px,1fr) auto !important;
  gap:24px !important;
  padding:0 20px !important;
}
body.md3 .exact-topbar .logo-badge { width:42px !important; height:42px !important; }
body.md3 .exact-topbar .nav-title { font-size:21px !important; font-weight:500 !important; color:#fff !important; }
body.md3 .exact-topbar .nav-subtitle { font-size:12.5px !important; color:rgba(255,255,255,.78) !important; }
body.md3 .m2-global-search {
  justify-self:stretch;
  width:100%;
  max-width:760px;
  height:46px !important;
  border-radius:5px !important;
  padding:0 12px 0 14px !important;
  background:rgba(255,255,255,.18) !important;
  box-shadow:none !important;
}
body.md3 .m2-global-search:focus-within { background:#fff !important; box-shadow:var(--r2-e2) !important; }
body.md3 .m2-global-search:focus-within .material-symbols-rounded { color:var(--r2-primary) !important; }
body.md3 .m2-global-search:focus-within input { color:var(--r2-text) !important; }
body.md3 .m2-global-search:focus-within input::placeholder { color:var(--r2-text-3) !important; }
body.md3 .m2-global-search:focus-within .global-search-scope { background:var(--r2-purple-100); color:var(--r2-primary); }
body.md3 .m2-global-search:focus-within kbd { color:var(--r2-text-2) !important; border-color:var(--r2-divider) !important; background:#f4f4f4 !important; }
body.md3 .m2-global-search input { font-size:15px !important; }
body.md3 .global-search-scope { font-size:11.5px !important; font-weight:500 !important; padding:4px 9px !important; }
body.md3 .m2-global-search kbd { font-size:11px !important; padding:3px 6px !important; }
body.md3 .portal-compact { min-width:118px; }
body.md3 .portal-compact strong { font-size:13px !important; }
body.md3 .portal-compact span { font-size:11px !important; }
body.md3 .notification-btn { width:42px !important; height:42px !important; }
body.md3 .top-user { min-width:188px !important; padding:5px 8px !important; }
body.md3 .top-user-copy strong { font-size:14px !important; }
body.md3 .top-user-copy span { font-size:12px !important; }

/* Sidebar and common surfaces */
body.md3 .exact-sidebar,
body.md3 .dashboard-sidebar,
body.md3 .admin-dashboard .dashboard-sidebar {
  background:var(--r2-surface) !important;
  border-right:1px solid var(--r2-divider) !important;
  box-shadow:none !important;
}
body.md3 .sidebar-nav .tab-btn {
  min-height:50px !important;
  margin:2px 8px !important;
  padding:0 14px !important;
  border-radius:4px !important;
  color:var(--r2-text-2) !important;
  font-size:15px !important;
  font-weight:500 !important;
}
body.md3 .sidebar-nav .tab-btn .tab-icon { font-size:23px !important; color:var(--r2-text-3) !important; }
body.md3 .sidebar-nav .tab-btn:hover { background:rgba(0,0,0,.04) !important; }
body.md3 .sidebar-nav .tab-btn.active { background:var(--r2-selected) !important; color:var(--r2-primary) !important; }
body.md3 .sidebar-nav .tab-btn.active .tab-icon { color:var(--r2-primary) !important; }
body.md3 .tab-count-badge { font-size:11.5px !important; min-width:26px; }
body.md3 .sidebar-help-card { background:var(--r2-purple-50) !important; border-color:#DED2F4 !important; }
body.md3 .sidebar-help-card > .material-symbols-rounded { color:var(--r2-primary) !important; }
body.md3 .sidebar-help-card strong { font-size:14px !important; color:var(--r2-primary-variant) !important; }
body.md3 .sidebar-help-card span { font-size:12.5px !important; }
body.md3 .sidebar-context { border-top-color:var(--r2-divider) !important; }
body.md3 .sidebar-context small { font-size:11.5px !important; }
body.md3 .sidebar-context b { font-size:13px !important; }

/* Dealer overview selector: FPS selector is admin-only */
body.md3 .admin-fps-selector { display:none !important; }
body.md3.admin-session .admin-fps-selector { display:flex !important; }
body.md3:not(.admin-session) .overview-selectors { grid-template-columns:minmax(250px,330px) !important; justify-content:end !important; }
body.md3 .admin-directory-selector { display:none !important; }
body.md3.admin-session .admin-directory-selector { display:flex !important; }
body.md3.admin-session .overview-selectors { grid-template-columns:repeat(4,minmax(175px,1fr)); min-width:min(900px,70vw); }
body.md3 .selector-card { min-height:72px !important; }
body.md3 .selector-copy small { font-size:12.5px !important; }
body.md3 .selector-copy select { font-size:15px !important; font-weight:500 !important; }

@media (max-width:1260px) {
  body.md3.admin-session .overview-selectors { grid-template-columns:repeat(2,minmax(210px,1fr)); min-width:min(620px,70vw); }
}
@media (max-width:720px) {
  body.md3.admin-session .overview-selectors { grid-template-columns:1fr; min-width:0; }
}

/* M2 surfaces across the entire product */
body.md3 .overview-card,
body.md3 .table-responsive,
body.md3 .report-intro,
body.md3 .registered-table-card,
body.md3 .exact-chat,
body.md3 .bot-side-card,
body.md3 .bot-info-panel,
body.md3 .telegram-integration-card,
body.md3 .historical-banner,
body.md3 .admin-panel,
body.md3 .admin-kpi,
body.md3 .admin-hero,
body.md3 .login-card,
body.md3 .onboarding-card,
body.md3 .detail-modal-card,
body.md3 .profile-drawer-card {
  background:var(--r2-surface) !important;
  border:0 !important;
  border-radius:5px !important;
  box-shadow:var(--r2-e1) !important;
}
body.md3 .overview-card:hover,
body.md3 .admin-kpi:hover { box-shadow:var(--r2-e2) !important; }
body.md3 .workspace-eyebrow,
body.md3 .overview-eyebrow,
body.md3 .admin-eyebrow,
body.md3 .detail-modal-eyebrow { color:var(--r2-primary) !important; font-size:12px !important; font-weight:700 !important; letter-spacing:.08em !important; }
body.md3 .panel-heading h3,
body.md3 .report-intro h3,
body.md3 .bot-side-card h3,
body.md3 .table-header-title,
body.md3 .admin-panel h3 { font-size:18px !important; font-weight:500 !important; }

/* KPI colors use M2 palette without visual noise */
body.md3 .exact-kpis .kpi-card { border-radius:5px !important; box-shadow:var(--r2-e1) !important; border:0 !important; min-height:170px !important; }
body.md3 .exact-kpis .kpi-card:hover { box-shadow:var(--r2-e4) !important; transform:translateY(-1px); }
body.md3 .exact-kpis .card-blue { border-top:4px solid var(--r2-primary) !important; }
body.md3 .exact-kpis .card-green { border-top:4px solid var(--r2-secondary-dark) !important; }
body.md3 .exact-kpis .card-amber { border-top:4px solid var(--r2-amber) !important; }
body.md3 .exact-kpis .card-red { border-top:4px solid var(--r2-error) !important; }
body.md3 .exact-kpis .card-purple { border-top:4px solid var(--r2-primary-variant) !important; }
body.md3 .exact-kpis .kpi-value { font-size:40px !important; font-weight:400 !important; }
body.md3 .exact-kpis .kpi-label { font-size:15px !important; font-weight:500 !important; }
body.md3 .exact-kpis .kpi-hindi,
body.md3 .exact-kpis .kpi-caption { font-size:13px !important; }
body.md3 .exact-kpis .kpi-icon-wrap { width:46px !important; height:46px !important; }

/* Report headings and one consistent export control */
body.md3 .workspace-heading,
body.md3 .registered-head-row { align-items:center !important; gap:20px !important; margin-bottom:18px !important; }
body.md3 .report-head-actions,
body.md3 .registered-head-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-left:auto; }
body.md3 .registered-head-actions { min-width:max-content; }
body.md3 .report-stat-strip { display:flex; gap:10px; flex-wrap:wrap; margin:-4px 0 14px; }
body.md3 .stat-pill,
body.md3 .workspace-count,
body.md3 .report-summary-pill { font-size:13px !important; min-height:32px; display:inline-flex; align-items:center; }
body.md3 details.export-menu { position:relative; flex:0 0 auto; z-index:12; }
body.md3 details.export-menu[open] { z-index:80; }
body.md3 .export-trigger {
  list-style:none;
  min-height:42px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 12px;
  border:1px solid rgba(98,0,238,.38);
  border-radius:4px;
  background:#fff;
  color:var(--r2-primary);
  font-size:14px;
  font-weight:500;
  cursor:pointer;
  user-select:none;
}
body.md3 .export-trigger::-webkit-details-marker { display:none; }
body.md3 .export-trigger:hover { background:var(--r2-hover); }
body.md3 .export-trigger > .material-symbols-rounded { font-size:20px; }
body.md3 .export-trigger .export-chevron { font-size:18px; transition:transform .18s ease; }
body.md3 details[open] .export-chevron { transform:rotate(180deg); }
body.md3 .export-menu-popover {
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  width:224px;
  padding:6px;
  background:#fff;
  border-radius:5px;
  box-shadow:var(--r2-e8);
  border:1px solid var(--r2-divider);
}
body.md3 .export-option {
  width:100%;
  min-height:54px;
  display:grid;
  grid-template-columns:34px 1fr;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:4px;
  text-align:left;
  color:var(--r2-text);
}
body.md3 .export-option:hover { background:var(--r2-hover); }
body.md3 .export-option > .material-symbols-rounded { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; font-size:19px; }
body.md3 .export-option .excel-mark { color:var(--r2-secondary-dark); background:var(--r2-teal-50); }
body.md3 .export-option .pdf-mark { color:var(--r2-error); background:var(--r2-red-soft); }
body.md3 .export-option > span:last-child { display:flex; flex-direction:column; }
body.md3 .export-option strong { font-size:14px; font-weight:500; }
body.md3 .export-option small { font-size:11.5px; color:var(--r2-text-2); }

/* Filters remain; duplicate search bars are intentionally removed */
body.md3 .registered-filter-row { margin-bottom:14px !important; }
body.md3 .filter-chip { min-height:36px !important; padding:0 15px !important; font-size:13.5px !important; border-radius:18px !important; }
body.md3 .filter-chip.active { background:var(--r2-purple-100) !important; color:var(--r2-primary) !important; }

/* Tables - larger accessible density */
body.md3 .data-table { font-size:14.5px !important; }
body.md3 .data-table thead th {
  padding:15px 16px !important;
  font-size:13px !important;
  line-height:1.35 !important;
  font-weight:500 !important;
  color:var(--r2-text-2) !important;
  background:#fff !important;
}
body.md3 .data-table tbody td { padding:14px 16px !important; font-size:14.5px !important; line-height:1.45 !important; color:var(--r2-text) !important; }
body.md3 .data-table tbody tr:hover { background:rgba(98,0,238,.025) !important; }
body.md3 .data-table tbody tr:focus-within { background:var(--r2-purple-50) !important; }
body.md3 .rc-cell, body.md3 .mono { font-variant-numeric:tabular-nums; }
body.md3 .pagination-bar button { min-width:40px !important; min-height:40px !important; font-size:14px !important; }
body.md3 .pagination-bar button.active { background:var(--r2-primary) !important; color:#fff !important; }
body.md3 .registration-status,
body.md3 .chip,
body.md3 .status-chip { font-size:12.5px !important; }

/* Profile drawer becomes account/settings hub */
body.md3 .profile-drawer-card { width:min(400px,calc(100vw - 24px)) !important; top:76px !important; }
body.md3 .profile-drawer-hero { background:linear-gradient(135deg,var(--r2-primary),var(--r2-primary-variant)) !important; padding:22px 18px !important; }
body.md3 .profile-drawer-identity small { font-size:12px !important; }
body.md3 .profile-drawer-identity strong { font-size:17px !important; }
body.md3 .profile-drawer-identity span { font-size:13px !important; }
body.md3 .profile-drawer-body { gap:14px !important; padding:16px !important; }
body.md3 .profile-location-grid > div { min-height:66px; }
body.md3 .profile-location-grid small,
body.md3 .profile-plan-card small { font-size:12px !important; }
body.md3 .profile-location-grid strong { font-size:14px !important; }
body.md3 .profile-plan-heading strong { font-size:17px !important; }
body.md3 .profile-plan-meta b { font-size:13px !important; }
body.md3 .profile-settings-card { border-top:1px solid var(--r2-divider); padding-top:12px; }
body.md3 .profile-settings-heading { display:flex; align-items:center; gap:10px; padding:4px 6px 8px; color:var(--r2-primary); }
body.md3 .profile-settings-heading > .material-symbols-rounded { font-size:22px; }
body.md3 .profile-settings-heading > div { display:flex; flex-direction:column; }
body.md3 .profile-settings-heading strong { font-size:14px; font-weight:500; color:var(--r2-text); }
body.md3 .profile-settings-heading small { font-size:11.5px; color:var(--r2-text-2); }
body.md3 .profile-setting-row {
  width:100%;
  min-height:58px;
  display:grid;
  grid-template-columns:38px 1fr 24px;
  align-items:center;
  gap:9px;
  padding:6px 7px;
  background:transparent;
  border:0;
  border-radius:4px;
  text-align:left;
  cursor:pointer;
  color:var(--r2-text);
}
body.md3 .profile-setting-row:hover { background:var(--r2-hover); }
body.md3 .profile-setting-row > span:nth-child(2) { display:flex; flex-direction:column; min-width:0; }
body.md3 .profile-setting-row strong { font-size:14px; font-weight:500; }
body.md3 .profile-setting-row small { font-size:12px; color:var(--r2-text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.md3 .profile-setting-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; background:var(--r2-purple-100); color:var(--r2-primary); }
body.md3 .profile-setting-icon .material-symbols-rounded { font-size:20px; }
body.md3 .profile-setting-row .trailing { font-size:20px; color:var(--r2-text-3); }
body.md3 .profile-signout-btn { min-height:46px !important; font-size:14px !important; color:var(--r2-error) !important; background:#fff !important; border:1px solid rgba(176,0,32,.28) !important; }
body.md3 .profile-signout-btn:hover { background:var(--r2-red-soft) !important; }

/* Settings dialogs */
body.md3 .settings-dialog { border:0; padding:0; background:transparent; width:min(520px,calc(100vw - 28px)); max-width:520px; }
body.md3 .settings-dialog::backdrop { background:rgba(0,0,0,.42); }
body.md3 .settings-dialog-card { background:#fff; border-radius:5px; box-shadow:var(--r2-e8); overflow:hidden; }
body.md3 .settings-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:20px 22px 15px; border-bottom:1px solid var(--r2-divider); }
body.md3 .settings-dialog-head > div:first-child { display:flex; gap:12px; }
body.md3 .settings-dialog-head > div:first-child > .material-symbols-rounded { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:var(--r2-purple-100); color:var(--r2-primary); }
body.md3 .settings-dialog-head h3 { margin:0; font-size:20px !important; font-weight:500 !important; }
body.md3 .settings-dialog-head p { margin:3px 0 0; color:var(--r2-text-2); font-size:13px !important; }
body.md3 .settings-dialog-close { width:38px; height:38px; display:grid; place-items:center; border-radius:50%; color:var(--r2-text-2); }
body.md3 .settings-dialog-close:hover { background:rgba(0,0,0,.05); }
body.md3 .settings-dialog-body { padding:18px 22px; display:grid; gap:12px; }
body.md3 .settings-dialog-body label { display:grid; gap:6px; font-size:13.5px; font-weight:500; color:var(--r2-text-2); }
body.md3 .settings-dialog-body .form-control { min-height:46px !important; font-size:15px !important; }
body.md3 .settings-password-grid { gap:14px; }
body.md3 .settings-help { margin:0; font-size:12px !important; color:var(--r2-text-2); }
body.md3 .settings-error { min-height:18px; margin:0; color:var(--r2-error); font-size:12.5px !important; }
body.md3 .settings-dialog-actions { display:flex; justify-content:flex-end; gap:8px; padding:10px 18px 16px; }
body.md3 .settings-dialog-actions .btn-text { min-height:40px; padding:0 14px; color:var(--r2-primary); font-weight:500; }
body.md3 .settings-dialog-actions .primary-btn { min-height:42px; }

/* Forms and controls everywhere */
body.md3 .form-control,
body.md3 .admin-panel input,
body.md3 .login-card input,
body.md3 .onboarding-card input,
body.md3 .onboarding-card select,
body.md3 .chat-input {
  min-height:46px !important;
  border:1px solid rgba(0,0,0,.32) !important;
  border-radius:4px !important;
  background:#fff !important;
  color:var(--r2-text) !important;
  box-shadow:none !important;
}
body.md3 .form-control:focus,
body.md3 .admin-panel input:focus,
body.md3 .login-card input:focus,
body.md3 .onboarding-card input:focus,
body.md3 .onboarding-card select:focus,
body.md3 .chat-input:focus { border-color:var(--r2-primary) !important; box-shadow:inset 0 0 0 1px var(--r2-primary) !important; outline:none !important; }
body.md3 .primary-btn,
body.md3 .auth-btn,
body.md3 .auth-secondary-btn { min-height:44px !important; border-radius:4px !important; font-size:14px !important; font-weight:500 !important; letter-spacing:.035em; }
body.md3 .primary-btn { background:var(--r2-primary) !important; color:#fff !important; box-shadow:var(--r2-e2) !important; }
body.md3 .primary-btn:hover { background:var(--r2-primary-variant) !important; }
body.md3 .auth-secondary-btn { color:var(--r2-primary) !important; border-color:rgba(98,0,238,.34) !important; background:#fff !important; }

/* Authentication/onboarding */
body.md3 .auth-overlay { background:linear-gradient(135deg,#F7F2FF 0%,#FAFAFA 48%,#ECFFFB 100%) !important; }
body.md3 .login-card { width:min(440px,calc(100vw - 28px)) !important; padding:28px !important; }
body.md3 .login-brand h2 { font-size:25px !important; font-weight:500 !important; }
body.md3 .login-brand p { font-size:14px !important; }
body.md3 .login-card label,
body.md3 .onboarding-card label { font-size:13.5px !important; }
body.md3 .onboarding-header { border-bottom-color:var(--r2-divider) !important; }
body.md3 .onboarding-header h2 { font-size:24px !important; font-weight:500 !important; }
body.md3 .onboarding-help { font-size:14px !important; }
body.md3 .onboarding-readonly,
body.md3 .onboarding-summary { background:var(--r2-purple-50) !important; border-color:#DED2F4 !important; }

/* Registered detail drawers */
body.md3 #registeredCardModal .detail-modal-header,
body.md3 #registeredCardTransactionsModal .detail-modal-header { background:var(--r2-primary) !important; }
body.md3 .detail-modal-card { color:var(--r2-text) !important; }
body.md3 .drawer-section-title { font-size:14px !important; }
body.md3 .drawer-label, body.md3 .drawer-block small { font-size:12px !important; }
body.md3 .family-head-block h3 { font-size:19px !important; }
body.md3 .family-head-block > span:last-of-type { font-size:14px !important; }
body.md3 .drawer-member-list li,
body.md3 .drawer-member-list li > strong { font-size:13.5px !important; }
body.md3 .drawer-member-list li > small { font-size:12px !important; }
body.md3 .drawer-contact-row strong { font-size:14px !important; }
body.md3 .drawer-contact-row span:not(.material-symbols-rounded) { font-size:12px !important; }

/* Assistant / bot */
body.md3 .simulation-badge { background:var(--r2-purple-100) !important; color:var(--r2-primary) !important; }
body.md3 .simulation-badge strong { font-size:14px !important; }
body.md3 .simulation-badge span { font-size:12px !important; }
body.md3 .chat-bot-title { font-size:15px !important; }
body.md3 .chat-bot-sub { font-size:12px !important; }
body.md3 .message .msg-text { font-size:14.5px !important; line-height:1.5 !important; }
body.md3 .user-message .msg-bubble { background:var(--r2-purple-100) !important; color:var(--r2-primary-variant) !important; }
body.md3 .bot-message .msg-bubble { background:#F5F5F5 !important; color:var(--r2-text) !important; }
body.md3 .cmd-chip { min-height:36px !important; padding:0 13px !important; font-size:13px !important; background:var(--r2-purple-100) !important; color:var(--r2-primary) !important; }
body.md3 .chat-send-btn { background:var(--r2-primary) !important; }
body.md3 .bot-tool-list button:hover { background:var(--r2-purple-50) !important; }

/* Admin consistency */
body.md3 .admin-dashboard { background:var(--r2-bg) !important; color:var(--r2-text) !important; }
body.md3 .admin-hero { background:linear-gradient(110deg,var(--r2-primary),var(--r2-primary-variant)) !important; color:#fff !important; }
body.md3 .admin-hero h2,
body.md3 .admin-hero p,
body.md3 .admin-hero .admin-eyebrow { color:#fff !important; }
body.md3 .admin-kpi strong { color:var(--r2-primary) !important; font-size:34px !important; }
body.md3 .admin-kpi span { font-size:14px !important; color:var(--r2-text-2) !important; }
body.md3 .plan-card,
body.md3 .plan-list > * { border-color:var(--r2-divider) !important; }

/* Toasts and feedback */
body.md3 .toast { background:#323232 !important; color:#fff !important; border-radius:4px !important; box-shadow:var(--r2-e8) !important; font-size:14px !important; }
body.md3 .pulse-loader { border-color:#D1C4E9 !important; border-top-color:var(--r2-primary) !important; }

/* Dark theme remains available from Profile > Settings */










/* Responsive */
@media (max-width:1280px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:240px minmax(330px,1fr) auto !important; gap:14px !important; }
  body.md3 .portal-compact { display:none !important; }
}
@media (max-width:1000px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:220px minmax(260px,1fr) auto !important; }
  body.md3 .nav-subtitle { display:none; }
  body.md3 .global-search-scope, body.md3 .m2-global-search kbd { display:none; }
  body.md3 .top-user-copy { display:none !important; }
  body.md3 .top-user { min-width:auto !important; }
}
@media (max-width:760px) {
  body.md3 .exact-topbar.m2-topbar { height:auto !important; min-height:64px !important; }
  body.md3 .exact-topbar .nav-container { min-height:64px !important; height:auto !important; grid-template-columns:1fr auto !important; grid-template-areas:"brand actions" "search search"; padding:7px 10px 9px !important; gap:6px 10px !important; }
  body.md3 .nav-brand { grid-area:brand; }
  body.md3 .nav-actions { grid-area:actions; }
  body.md3 .m2-global-search { grid-area:search; display:flex !important; max-width:none; height:42px !important; }
  body.md3 .notification-btn { display:none !important; }
  body.md3 .workspace-heading,
  body.md3 .registered-head-row { align-items:flex-start !important; flex-direction:column !important; }
  body.md3 .report-head-actions,
  body.md3 .registered-head-actions { width:100%; justify-content:space-between; margin-left:0; }
  body.md3 .registered-head-actions { align-items:center; }
  body.md3 .profile-drawer-card { top:70px !important; right:8px !important; width:calc(100vw - 16px) !important; }
  body.md3 .profile-location-grid { grid-template-columns:1fr !important; }
  body.md3 .profile-plan-meta { grid-template-columns:1fr 1fr !important; }
  body.md3 .export-menu-popover { left:0; right:auto; }
  body.md3 .report-intro { align-items:flex-start !important; }
}
body.md3 .footer-brand-mark { width:28px; height:28px; display:grid; place-items:center; border-radius:50%; background:var(--r2-primary); color:#fff; font-size:18px !important; }
body.md3 .footer { background:#fff !important; border-top:1px solid var(--r2-divider) !important; }
body.md3 .footer-brand span:last-child { color:var(--r2-text) !important; font-size:14px !important; font-weight:500; }
body.md3 .footer-sub { color:var(--r2-text-2) !important; font-size:12.5px !important; }

/* ===== refinement-r3.css ===== */
/* FPS Assistant R3 — production polish */
:root{
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:40px;
  --m2-primary:#6200ee;--m2-primary-variant:#3700b3;--m2-secondary:#03dac6;--m2-bg:#fafafa;--m2-surface:#fff;
  --semantic-success:#1b7f3a;--semantic-success-bg:#e7f5ec;--semantic-warning:#9a6700;--semantic-warning-bg:#fff3cd;--semantic-danger:#b3261e;--semantic-danger-bg:#fbe9e7;--semantic-info:#0b57d0;--semantic-info-bg:#e8f0fe;
  --text-primary:#1f1f1f;--text-secondary:#5f6368;--divider:rgba(0,0,0,.12);--focus:#03dac6;
  --radius-sm:6px;--radius-md:10px;--radius-lg:16px;--tap:44px;
}
html{font-size:17px} body{font-family:Roboto,"Noto Sans Devanagari",sans-serif;background:var(--m2-bg);color:var(--text-primary);line-height:1.5}
body.light-theme{background:var(--m2-bg)}
button,input,select,textarea{font:inherit}.nav-title{font-size:1.2rem}.nav-subtitle{font-size:.78rem}.workspace-heading h2,.registered-head-row h2,.overview-heading h2{font-size:1.65rem;line-height:1.2}.workspace-heading p,.registered-head-row p,.overview-heading p{font-size:.95rem}.panel-heading h3,.report-intro h3{font-size:1.08rem}.data-table{font-size:.93rem}.data-table th{font-size:.79rem;letter-spacing:.025em}.data-table td,.data-table th{padding:15px 16px;vertical-align:middle}.data-table tbody tr{min-height:52px}.data-table th:nth-child(n/**/+4),.data-table td.numeric{font-variant-numeric:tabular-nums}
/* spacing */
.dashboard-workspace{padding:var(--space-5)}.tab-content{gap:var(--space-4)}.workspace-heading,.registered-head-row,.overview-heading{margin-bottom:var(--space-4)}.overview-card,.glass-panel,.registered-table-card,.report-intro{border-radius:var(--radius-md)}
/* top app bar */
.m2-topbar{min-height:72px}.m2-topbar .nav-container{gap:var(--space-4)}.brand-mark{box-shadow:0 2px 8px rgba(55,0,179,.25)}.brand-mark i{background:var(--m2-secondary)}
.global-search{position:relative;min-height:48px}.global-search input{font-size:.96rem;padding-right:164px}.global-search-feedback{position:absolute;right:110px;top:50%;transform:translateY(-50%);font-size:.72rem;color:rgba(255,255,255,.78);white-space:nowrap}.global-search-clear{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;color:white}.global-search-clear:hover{background:rgba(255,255,255,.15)}
.notification-button{position:relative;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:#fff}.notification-button:hover,.notification-button:focus-visible{background:rgba(255,255,255,.15)}.notification-badge{position:absolute;right:2px;top:2px;min-width:18px;height:18px;border-radius:99px;background:#d93025;color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;padding:0 4px;border:2px solid var(--m2-primary)}
/* semantic states */
.status-chip,.chip,.profile-plan-status{font-weight:700}.status-success,.chip.success,.profile-plan-status[data-status="active"]{background:var(--semantic-success-bg)!important;color:var(--semantic-success)!important}.status-warning,.chip.warning{background:var(--semantic-warning-bg)!important;color:var(--semantic-warning)!important}.status-error,.chip.error{background:var(--semantic-danger-bg)!important;color:var(--semantic-danger)!important}.status-info,.chip.info{background:var(--semantic-info-bg)!important;color:var(--semantic-info)!important}
.card-green .kpi-icon-wrap{color:var(--semantic-success)}.card-amber .kpi-icon-wrap{color:var(--semantic-warning)}.card-red .kpi-icon-wrap{color:var(--semantic-danger)}
/* tables */
.table-responsive{background:#fff;border:1px solid var(--divider);box-shadow:0 1px 3px rgba(0,0,0,.12)}.data-table thead{position:sticky;top:0;z-index:2;background:#fff}.data-table tbody tr:hover{background:#f7f4fd}.data-table tbody tr:focus-within{outline:2px solid rgba(98,0,238,.35);outline-offset:-2px}.pagination-bar{font-size:.86rem;color:var(--text-secondary)}
.loading-state,.report-empty,.empty-state,.activity-empty,.empty-mini{padding:36px 20px!important;text-align:center;color:var(--text-secondary);font-size:.95rem}.loading-state::before{content:"";display:inline-block;width:22px;height:22px;margin-right:10px;border:3px solid #ddd;border-top-color:var(--m2-primary);border-radius:50%;animation:r3spin .8s linear infinite;vertical-align:middle}@keyframes r3spin{to{transform:rotate(360deg)}}
.report-error{padding:28px;text-align:center;background:var(--semantic-danger-bg);color:var(--semantic-danger);border-radius:var(--radius-md)}.report-error button{margin-top:12px}
/* export */
.export-trigger{min-height:44px;border:1px solid rgba(98,0,238,.28);color:var(--m2-primary);font-weight:700}.export-trigger:hover{background:rgba(98,0,238,.06)}.export-option{min-height:52px}.excel-mark{color:#137333!important}.pdf-mark{color:#b3261e!important}.export-menu[aria-busy="true"] .export-trigger{opacity:.65;pointer-events:none}.export-menu[aria-busy="true"] .export-trigger::after{content:"";width:14px;height:14px;border:2px solid #ccc;border-top-color:var(--m2-primary);border-radius:50%;animation:r3spin .7s linear infinite}
/* profile/settings */
.profile-settings-section-label{padding:14px 16px 6px;color:var(--m2-primary);font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.profile-setting-row{min-height:58px}.profile-setting-row strong{font-size:.95rem}.profile-setting-row small{font-size:.78rem}.profile-plan-meta b{font-size:.9rem}.settings-dialog-card{border-radius:var(--radius-md)}
/* notification center */
.notification-scrim{position:fixed;inset:0;background:rgba(0,0,0,.25);z-index:119}.notification-panel{position:fixed;right:16px;top:82px;width:min(390px,calc(100vw - 32px));max-height:calc(100vh - 100px);overflow:auto;background:#fff;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.25);z-index:120;border:1px solid var(--divider)}.notification-head{display:flex;justify-content:space-between;align-items:center;padding:18px 18px 12px;border-bottom:1px solid var(--divider)}.notification-head small{font-size:.68rem;color:var(--m2-primary);font-weight:800;letter-spacing:.08em}.notification-head h2{font-size:1.2rem}.notification-head button{width:40px;height:40px;border-radius:50%}.notification-list{padding:8px}.notification-item{width:100%;display:flex;align-items:flex-start;gap:12px;padding:14px;border-radius:8px;text-align:left}.notification-item:hover{background:#f7f4fd}.notification-item .material-symbols-rounded{padding:8px;border-radius:50%}.notification-item.warning .material-symbols-rounded{background:var(--semantic-warning-bg);color:var(--semantic-warning)}.notification-item.error .material-symbols-rounded{background:var(--semantic-danger-bg);color:var(--semantic-danger)}.notification-item.info .material-symbols-rounded{background:var(--semantic-info-bg);color:var(--semantic-info)}.notification-item strong{display:block;font-size:.92rem}.notification-item small{display:block;color:var(--text-secondary);font-size:.78rem;margin-top:3px}.notification-empty{padding:34px 20px;text-align:center;color:var(--text-secondary);display:grid;gap:6px;justify-items:center}.notification-empty .material-symbols-rounded{font-size:32px;color:var(--semantic-success)}
/* overview hierarchy */
.kpi-card{min-height:154px}.kpi-card .kpi-value{font-size:2.2rem}.kpi-card.card-amber,.kpi-card.card-red{box-shadow:0 2px 10px rgba(0,0,0,.08)}.attention-row{min-height:68px}.quick-action-grid button{min-height:84px;border:1px solid var(--divider);background:#fff}.quick-action-grid button:hover{border-color:rgba(98,0,238,.3);background:#f7f4fd}
/* dialog/drawer normalization */
.settings-dialog-card,.registered-card-drawer,.profile-drawer-card{box-shadow:0 8px 30px rgba(0,0,0,.24)}.settings-dialog-actions button,.primary-btn,.btn-text{min-height:44px}
/* accessibility */
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:3px solid var(--focus)!important;outline-offset:2px!important}button,.tab-btn,.filter-chip,.page-btn{min-height:var(--tap)}.material-symbols-rounded{font-size:22px}.tab-btn .material-symbols-rounded{font-size:24px}
/* admin distinction */
body.admin-session{--m2-primary:#3700b3}.admin-session .m2-topbar{background:#3700b3}.admin-session .nav-title::after{content:"  ADMIN";font-size:.62rem;letter-spacing:.1em;background:#fff;color:#3700b3;padding:3px 7px;border-radius:99px;margin-left:8px;vertical-align:middle}.admin-session .dashboard-workspace{background:#f6f3fb}
/* mobile */
.mobile-bottom-nav{display:none}.mobile-nav-item{color:#5f6368}.mobile-nav-item.active{color:var(--m2-primary)}
@media(max-width:900px){html{font-size:16px}.global-search-feedback,.global-search-scope,.global-search kbd{display:none}.global-search input{padding-right:42px}.dashboard-workspace{padding:16px}.notification-panel{top:72px}.mobile-bottom-nav{position:fixed;left:0;right:0;bottom:0;height:68px;background:#fff;border-top:1px solid var(--divider);display:grid;grid-template-columns:repeat(4,1fr);z-index:100;box-shadow:0 -2px 12px rgba(0,0,0,.08)}.mobile-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:.7rem}.mobile-nav-item .material-symbols-rounded{font-size:24px}.dashboard-workspace{padding-bottom:84px}.dashboard-sidebar{display:none!important}}
@media(max-width:720px){.table-responsive{overflow:visible;background:transparent;border:0;box-shadow:none}.data-table,.data-table tbody,.data-table tr,.data-table td{display:block;width:100%}.data-table thead{display:none}.data-table tbody{display:grid;gap:12px}.data-table tbody tr{background:#fff;border:1px solid var(--divider);border-radius:10px;padding:10px 14px;box-shadow:0 1px 3px rgba(0,0,0,.08)}.data-table tbody td{border:0;padding:7px 0;min-height:auto}.data-table tbody td:empty{display:none}.data-table tbody td::before{content:attr(data-label);display:block;font-size:.68rem;color:var(--text-secondary);font-weight:700;text-transform:uppercase;letter-spacing:.04em}.workspace-heading,.registered-head-row{align-items:flex-start}.report-head-actions{width:100%;justify-content:flex-end}.kpi-card .kpi-value{font-size:1.9rem}}
.brand-mark{padding:0!important;overflow:hidden;background:transparent!important}.brand-mark img{width:42px;height:42px;display:block}.report-error{display:grid!important;justify-items:center;gap:8px}.report-error .material-symbols-rounded{font-size:32px}.report-empty{display:grid!important;justify-items:center;gap:6px}.report-empty .material-symbols-rounded{font-size:30px;color:#9aa0a6}.report-empty strong,.report-error strong{font-size:1rem}

/* ===== refinement-r4.css ===== */
/* FPS Assistant — R4 consistency & visibility pass */
:root{
  --r4-surface:#fff;
  --r4-surface-soft:#fafafa;
  --r4-surface-tint:#f7f4fd;
  --r4-border:rgba(0,0,0,.12);
  --r4-border-strong:rgba(0,0,0,.18);
  --r4-text:#202124;
  --r4-muted:#5f6368;
  --r4-primary:#6200ee;
  --r4-primary-dark:#3700b3;
  --r4-secondary:#03dac6;
  --r4-shadow-1:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.08);
  --r4-shadow-2:0 4px 12px rgba(55,0,179,.10),0 2px 5px rgba(0,0,0,.08);
}

/* Universal top bar */
body.md3 .exact-topbar{min-height:68px!important;box-shadow:0 2px 6px rgba(0,0,0,.18)!important}
body.md3 .exact-topbar .nav-container{gap:18px!important;padding:0 22px!important;min-height:68px!important}
body.md3 .nav-brand{min-width:245px!important}
body.md3 .m2-global-search{height:46px!important;max-width:620px!important;min-width:340px!important;padding:0 13px!important;border-radius:6px!important;background:rgba(255,255,255,.16)!important;border:1px solid rgba(255,255,255,.22)!important;gap:9px!important}
body.md3 .m2-global-search input{font-size:16px!important;padding-right:138px!important;line-height:1.25!important}
body.md3 .m2-global-search:focus-within{background:#fff!important;border-color:#fff!important;box-shadow:0 3px 12px rgba(0,0,0,.22)!important}
body.md3 .global-search-feedback{right:104px!important;font-size:12px!important}
body.md3 .global-search-scope{font-size:12px!important;padding:5px 9px!important;border-radius:12px!important}
body.md3 .nav-actions{gap:10px!important;align-items:center!important}
body.md3 .portal-compact{min-height:44px!important;padding:6px 10px!important;border-radius:6px!important;background:rgba(255,255,255,.10)!important}

/* Better attention control */
body.md3 .notification-button{width:auto!important;min-width:46px!important;height:44px!important;padding:0 11px!important;border-radius:6px!important;border:1px solid rgba(255,255,255,.24)!important;background:rgba(255,255,255,.10)!important;color:#fff!important;display:flex!important;gap:6px!important;align-items:center!important;justify-content:center!important}
body.md3 .notification-button:hover,body.md3 .notification-button:focus-visible{background:rgba(255,255,255,.20)!important;border-color:rgba(255,255,255,.40)!important}
body.md3 .notification-main-icon{font-size:22px!important}
body.md3 .notification-label{font-size:13px!important;font-weight:600!important;letter-spacing:.01em!important}
body.md3 .notification-badge{right:-5px!important;top:-6px!important;border-color:var(--r4-primary)!important}

/* Close buttons: one consistent pattern everywhere */
body.md3 .profile-drawer-close,
body.md3 .settings-dialog-close,
body.md3 .notification-head button,
body.md3 #onboardingCloseBtn,
body.md3 .modal-close,
body.md3 .drawer-close{
  width:38px!important;height:38px!important;min-width:38px!important;padding:0!important;border:1px solid var(--r4-border)!important;border-radius:50%!important;background:#fff!important;color:#5f6368!important;display:grid!important;place-items:center!important;box-shadow:none!important
}
body.md3 .profile-drawer-close:hover,
body.md3 .settings-dialog-close:hover,
body.md3 .notification-head button:hover,
body.md3 #onboardingCloseBtn:hover,
body.md3 .modal-close:hover,
body.md3 .drawer-close:hover{background:#f4f4f4!important;color:var(--r4-primary)!important;border-color:rgba(98,0,238,.24)!important}
body.md3 .profile-drawer-hero .profile-drawer-close{background:rgba(255,255,255,.14)!important;border-color:rgba(255,255,255,.28)!important;color:#fff!important}
body.md3 .profile-drawer-hero .profile-drawer-close:hover{background:rgba(255,255,255,.24)!important}

/* Sidebar: cleaner, no metadata block, single controlled scroll */
body.md3 .dashboard-shell{align-items:stretch!important}
body.md3 .dashboard-sidebar{height:calc(100vh - 68px)!important;max-height:calc(100vh - 68px)!important;position:sticky!important;top:68px!important;overflow:hidden!important;padding:12px 10px!important;background:#fff!important;border-right:1px solid var(--r4-border)!important}
body.md3 .sidebar-nav{overflow-y:auto!important;overflow-x:hidden!important;min-height:0!important;flex:1 1 auto!important;padding:2px 3px 10px!important;scrollbar-width:thin;scrollbar-color:#c6b5e8 transparent}
body.md3 .sidebar-nav::-webkit-scrollbar{width:6px}body.md3 .sidebar-nav::-webkit-scrollbar-track{background:transparent}body.md3 .sidebar-nav::-webkit-scrollbar-thumb{background:#c6b5e8;border-radius:99px}
body.md3 .sidebar-nav::-webkit-scrollbar-thumb:hover{background:#9b7bd5}
body.md3 .tab-btn{min-height:46px!important;margin:2px 0!important;border-radius:5px!important;font-size:14px!important;padding:0 11px!important}
body.md3 .tab-btn .tab-icon{font-size:21px!important}
body.md3 .sidebar-help-card{margin:10px 2px 2px!important;padding:10px!important;border-radius:6px!important;background:#f7f4fd!important;border:1px solid rgba(98,0,238,.12)!important;flex:0 0 auto!important}
body.md3 .sidebar-spacer{display:none!important}

/* Report header system — all reports now follow the Registered Cards density */
body.md3 .workspace-heading,
body.md3 .registered-head-row{
  width:100%!important;max-width:none!important;min-height:94px!important;padding:18px 20px!important;margin:0 0 14px!important;border:1px solid var(--r4-border)!important;border-left:4px solid var(--r4-primary)!important;border-radius:7px!important;background:#fff!important;box-shadow:var(--r4-shadow-1)!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important
}
body.md3 .workspace-heading>div:first-child,body.md3 .registered-head-row>div:first-child{min-width:0!important}
body.md3 .workspace-heading h2,body.md3 .registered-head-row h2{font-size:1.55rem!important;line-height:1.2!important;font-weight:500!important;color:var(--r4-text)!important;margin:2px 0 4px!important}
body.md3 .workspace-heading p:not(.workspace-eyebrow),body.md3 .registered-head-row p{font-size:.94rem!important;line-height:1.45!important;color:var(--r4-muted)!important;margin:0!important}
body.md3 .workspace-eyebrow{font-size:.71rem!important;font-weight:700!important;letter-spacing:.10em!important;color:var(--r4-primary)!important;margin:0 0 2px!important}
body.md3 .report-head-actions,body.md3 .registered-head-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:10px!important;flex-wrap:wrap!important}
body.md3 .workspace-count,body.md3 .registered-total{min-height:42px!important;border-radius:5px!important;background:#f7f4fd!important;border:1px solid rgba(98,0,238,.12)!important;color:var(--r4-primary)!important}

/* Variance/Portability explainer is secondary, not competing with the page title */
body.md3 .report-intro{padding:14px 16px!important;margin:0 0 14px!important;border-radius:6px!important;background:#fafafa!important;border:1px solid var(--r4-border)!important;box-shadow:none!important;gap:14px!important}
body.md3 .report-intro h3{font-size:1rem!important;margin-bottom:3px!important}.report-intro p{font-size:.88rem!important;line-height:1.45!important}

/* Export menu consistency/fill */
body.md3 details.export-menu{position:relative!important;z-index:20!important}
body.md3 details.export-menu[open]{z-index:140!important}
body.md3 .export-trigger{height:42px!important;min-height:42px!important;padding:0 13px!important;border-radius:5px!important;border:1px solid rgba(98,0,238,.32)!important;background:#fff!important;color:var(--r4-primary)!important;box-shadow:none!important;display:flex!important;align-items:center!important;gap:7px!important;font-size:14px!important;font-weight:600!important}
body.md3 .export-trigger:hover{background:#f7f4fd!important;border-color:rgba(98,0,238,.55)!important}
body.md3 .export-menu-popover{top:calc(100% + 7px)!important;right:0!important;left:auto!important;min-width:225px!important;padding:6px!important;border-radius:7px!important;background:#fff!important;border:1px solid var(--r4-border)!important;box-shadow:0 8px 24px rgba(0,0,0,.18)!important;color:var(--r4-text)!important;overflow:hidden!important}
body.md3 .export-option{width:100%!important;min-height:52px!important;padding:8px 10px!important;border-radius:5px!important;background:#fff!important;color:var(--r4-text)!important;text-align:left!important}
body.md3 .export-option:hover{background:#f7f4fd!important}.export-option strong{font-size:14px!important}.export-option small{font-size:12px!important;color:var(--r4-muted)!important}

/* One table system for Registered / Entitled / Pending / Completed / Variances / Portability */
body.md3 .table-responsive,body.md3 .registered-table-card{width:100%!important;max-width:none!important;margin:0!important;border-radius:6px!important;background:#fff!important;border:1px solid var(--r4-border)!important;box-shadow:var(--r4-shadow-1)!important;overflow:auto!important}
body.md3 .data-table,body.md3 .exact-registered .data-table{width:100%!important;border-collapse:collapse!important;font-size:14.5px!important;line-height:1.42!important;background:#fff!important}
body.md3 .data-table thead th,body.md3 .exact-registered .data-table thead th{height:48px!important;padding:12px 14px!important;background:#f5f3f8!important;color:#4f4657!important;font-size:12.5px!important;font-weight:700!important;letter-spacing:.025em!important;border-bottom:1px solid var(--r4-border)!important;white-space:nowrap!important;text-align:left!important}
body.md3 .data-table tbody td,body.md3 .exact-registered .data-table tbody td{min-height:52px!important;padding:13px 14px!important;color:var(--r4-text)!important;font-size:14.5px!important;line-height:1.42!important;border-bottom:1px solid rgba(0,0,0,.08)!important;vertical-align:middle!important}
body.md3 .exact-registered .data-table td strong{font-size:14.5px!important;color:var(--r4-text)!important}body.md3 .exact-registered .data-table td small{font-size:12.5px!important;color:var(--r4-muted)!important;margin-top:2px!important}
body.md3 .data-table tbody tr:hover,body.md3 .exact-registered .data-table tbody tr:hover{background:#faf8fd!important}
body.md3 .pagination-bar{min-height:48px!important;padding:10px 4px!important;font-size:13.5px!important}
body.md3 .registered-filter-row{margin:0 0 12px!important;gap:7px!important}.filter-chip{min-height:36px!important;padding:0 14px!important;font-size:13px!important}

/* Month selector: cleaner single visual control */
body.md3 .overview-selectors{gap:10px!important}.admin-fps-selector{display:none!important}
body.md3 .period-card{min-width:285px!important;min-height:64px!important;padding:9px 12px!important;background:#fff!important;border:1px solid rgba(98,0,238,.20)!important;border-radius:7px!important;box-shadow:var(--r4-shadow-1)!important}
body.md3 .period-card>.material-symbols-rounded{width:34px;height:34px;border-radius:50%;background:#ede7f6;color:var(--r4-primary);display:grid;place-items:center;font-size:20px!important}
body.md3 .period-inline{display:grid!important;grid-template-columns:minmax(120px,1fr) 88px!important;gap:6px!important;margin-top:3px!important}
body.md3 .period-inline .form-control{height:34px!important;min-height:34px!important;padding:4px 8px!important;border:1px solid var(--r4-border)!important;border-radius:4px!important;background:#fff!important;color:var(--r4-text)!important;font-size:14px!important;font-weight:500!important}
body.md3 .period-inline .form-control:focus{border-color:var(--r4-primary)!important;box-shadow:0 0 0 1px var(--r4-primary)!important;outline:0!important}

/* Overview visibility, especially below KPI */
body.md3 .overview-main-grid{gap:16px!important;margin-top:16px!important}
body.md3 .overview-card,body.md3 .distribution-card,body.md3 .activity-card,body.md3 .attention-card,body.md3 .quick-actions-card{background:#fff!important;border:1px solid var(--r4-border)!important;border-radius:7px!important;box-shadow:var(--r4-shadow-1)!important;color:var(--r4-text)!important}
body.md3 .panel-heading{padding-bottom:10px!important;border-bottom:1px solid rgba(0,0,0,.08)!important;margin-bottom:12px!important}.panel-heading h3{color:var(--r4-text)!important;font-weight:500!important}.panel-heading span{color:var(--r4-muted)!important}
body.md3 .attention-row{background:#fff!important;border:1px solid rgba(0,0,0,.08)!important;border-radius:6px!important;margin-bottom:8px!important}.attention-row:hover{background:#faf8fd!important;border-color:rgba(98,0,238,.20)!important}
body.md3 .quick-action-grid button{background:#fff!important;border:1px solid var(--r4-border)!important;color:var(--r4-text)!important}.quick-action-grid button:hover{background:#f7f4fd!important;border-color:rgba(98,0,238,.25)!important}
body.md3 .commodity-row,body.md3 .activity-row{color:var(--r4-text)!important;border-bottom-color:rgba(0,0,0,.08)!important}

/* Onboarding accessibility and visual consistency */
body.md3 .onboarding-overlay{background:rgba(28,18,36,.56)!important;backdrop-filter:blur(2px)!important}
body.md3 .onboarding-card{width:min(94vw,620px)!important;max-height:min(90vh,780px)!important;padding:0!important;border-radius:8px!important;border:0!important;background:#fff!important;box-shadow:0 18px 50px rgba(0,0,0,.28)!important;overflow:auto!important}
body.md3 .onboarding-header{position:sticky!important;top:0!important;z-index:4!important;background:#fff!important;padding:20px 22px 16px!important;margin:0!important;border-bottom:1px solid var(--r4-border)!important;align-items:flex-start!important}
body.md3 .onboarding-header h2{font-size:1.5rem!important;line-height:1.25!important;color:var(--r4-text)!important}.onboarding-header p{font-size:.9rem!important;line-height:1.45!important}
body.md3 .onboarding-step{padding:20px 22px 8px!important;gap:14px!important}.onboarding-help{font-size:.92rem!important;line-height:1.5!important;color:var(--r4-muted)!important}
body.md3 .onboarding-step label{font-size:.9rem!important;font-weight:600!important;color:#3c4043!important;gap:6px!important}.onboarding-step .form-control,body.md3 .onboarding-step input,body.md3 .onboarding-step select{min-height:48px!important;font-size:16px!important;border-radius:5px!important;background:#fff!important;border:1px solid var(--r4-border-strong)!important;color:var(--r4-text)!important}
body.md3 .onboarding-readonly{background:#fafafa!important;border:1px solid var(--r4-border)!important;border-radius:6px!important;padding:14px!important}.onboarding-plans>*{border-radius:6px!important}
body.md3 .onboarding-actions{position:sticky!important;bottom:0!important;background:#fff!important;padding:14px 22px 18px!important;border-top:1px solid var(--r4-border)!important;z-index:4!important}

/* General visibility */
body.md3 .dashboard-workspace{background:#fafafa!important;color:var(--r4-text)!important}
body.md3 .tab-content{color:var(--r4-text)!important}
body.md3 .stat-pill,body.md3 .report-summary-pill{border:1px solid var(--r4-border)!important;background:#fff!important;color:#4f4657!important}
body.md3 .field-help,body.md3 small,body.md3 .kpi-caption{color:#68636b}
body.md3 :focus-visible{outline:3px solid rgba(3,218,198,.58)!important;outline-offset:2px!important}

/* Admin can still use FPS selection */
body.md3 .admin-dashboard .admin-fps-selector,body.md3.admin-mode .admin-fps-selector{display:flex!important}

/* Dark theme parity */






@media(max-width:1100px){body.md3 .notification-label{display:none}.m2-global-search{min-width:260px!important}.portal-compact{display:none!important}}
@media(max-width:900px){body.md3 .m2-global-search{min-width:0!important;max-width:none!important}.notification-button{width:44px!important;min-width:44px!important;padding:0!important}.workspace-heading,.registered-head-row{min-height:0!important;align-items:flex-start!important;flex-direction:column!important;padding:16px!important}.report-head-actions,.registered-head-actions{width:100%!important;justify-content:space-between!important}.period-card{width:100%!important;min-width:0!important}.overview-topline{align-items:stretch!important}}
@media(max-width:720px){body.md3 .data-table tbody tr{padding:12px 14px!important;border-radius:7px!important}.data-table tbody td,.exact-registered .data-table tbody td{padding:7px 0!important;font-size:14px!important}.data-table tbody td::before{font-size:11px!important}.workspace-heading h2,.registered-head-row h2{font-size:1.35rem!important}.onboarding-card{width:calc(100vw - 20px)!important}.onboarding-header,.onboarding-step,.onboarding-actions{padding-left:16px!important;padding-right:16px!important}}
/* Browser-native search clear is intentionally hidden; one universal search, no competing X control. */
body.md3 .m2-global-search input[type="search"]::-webkit-search-cancel-button,
body.md3 .m2-global-search input[type="search"]::-webkit-search-decoration{display:none!important;-webkit-appearance:none!important}
body.md3 .m2-global-search input[type="search"]{-webkit-appearance:none!important;appearance:none!important}

/* Consistent unobtrusive scrolling for secondary surfaces. */
body.md3 .profile-drawer-body,body.md3 .notification-list,body.md3 .onboarding-card{scrollbar-width:thin;scrollbar-color:#c6b5e8 transparent}
body.md3 .profile-drawer-body::-webkit-scrollbar,body.md3 .notification-list::-webkit-scrollbar,body.md3 .onboarding-card::-webkit-scrollbar{width:6px}
body.md3 .profile-drawer-body::-webkit-scrollbar-thumb,body.md3 .notification-list::-webkit-scrollbar-thumb,body.md3 .onboarding-card::-webkit-scrollbar-thumb{background:#c6b5e8;border-radius:99px}

/* Keep report/table content legible against all surface variants. */
body.md3 .loading-state,body.md3 .report-empty,body.md3 .report-error{min-height:150px!important;color:var(--r4-muted)!important;background:#fff!important}
body.md3 .loading-state p,body.md3 .report-empty span,body.md3 .report-error span{color:var(--r4-muted)!important}

/* ===== refinement-r5.css ===== */
/* FPS Assistant R5 — coherent progress/loading feedback */
:root{--r5-primary:#6200ee;--r5-secondary:#03dac6;--r5-track:rgba(98,0,238,.16)}
.global-progress{position:fixed;left:0;right:0;top:72px;height:3px;background:rgba(255,255,255,.22);z-index:220;overflow:hidden;pointer-events:none}
.global-progress[hidden]{display:none!important}.global-progress>span{display:block;width:38%;height:100%;background:var(--r5-secondary);animation:r5bar 1.15s ease-in-out infinite;box-shadow:0 0 10px rgba(3,218,198,.45)}
@keyframes r5bar{0%{transform:translateX(-120%)}55%{transform:translateX(130%)}100%{transform:translateX(320%)}}
.ui-spinner{display:inline-block!important;width:16px;height:16px;flex:0 0 16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:r5spin .7s linear infinite;vertical-align:-2px;opacity:.9}
.ui-spinner-lg{width:28px;height:28px;flex-basis:28px;border-width:3px}@keyframes r5spin{to{transform:rotate(360deg)}}
button.is-busy,.primary-btn.is-busy,.table-action-btn.is-busy,.export-option.is-busy{cursor:progress!important;pointer-events:none!important;opacity:.78!important;display:inline-flex;align-items:center;justify-content:center;gap:9px}
button.is-busy>.ui-spinner{display:inline-block!important}button.is-busy>[class*="material-symbol"],button.is-busy>.tab-icon{opacity:.35}
.chat-send-btn.is-busy{width:auto;min-width:48px;padding-inline:13px}.chat-send-btn.is-busy .material-symbols-rounded{display:none}
.export-option.is-busy{min-width:180px}.export-menu[aria-busy="true"]>.export-trigger{cursor:progress!important;opacity:.72!important}.export-menu[aria-busy="true"]>.export-trigger::after{content:"";width:15px;height:15px;border:2px solid rgba(98,0,238,.25);border-top-color:var(--r5-primary);border-radius:50%;animation:r5spin .7s linear infinite;margin-left:7px}
.is-surface-busy{position:relative!important;min-height:120px}.surface-busy-overlay{position:absolute;inset:0;z-index:35;display:flex;align-items:center;justify-content:center;gap:12px;background:rgba(250,250,250,.88);backdrop-filter:blur(2px);font-weight:600;color:#4f4755;border-radius:inherit}
.report-loading-state{padding:28px 24px!important;min-height:164px!important}.report-loader{display:flex;align-items:center;justify-content:center;gap:13px;color:#3f3745}.report-loader>div{display:flex;flex-direction:column;gap:3px;text-align:left}.report-loader strong{font-size:1rem}.report-loader small{font-size:.82rem;color:#746d79}.skeleton-lines{max-width:620px;margin:22px auto 0;display:grid;gap:9px}.skeleton-lines i{display:block;height:11px;border-radius:999px;background:linear-gradient(90deg,#eee 25%,#f8f5fa 40%,#eee 65%);background-size:400% 100%;animation:r5shimmer 1.35s ease infinite}.skeleton-lines i:nth-child(2){width:82%}.skeleton-lines i:nth-child(3){width:63%}@keyframes r5shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
body.app-data-busy .overview-grid,body.app-data-busy .kpi-grid{position:relative}body.app-data-busy .kpi-card{overflow:hidden}body.app-data-busy .kpi-card::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:linear-gradient(90deg,transparent,var(--r5-secondary),transparent);animation:r5kpi 1.25s ease-in-out infinite}@keyframes r5kpi{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
select[aria-busy="true"],input[aria-busy="true"]{cursor:progress;background-image:linear-gradient(90deg,rgba(98,0,238,.05),rgba(3,218,198,.10),rgba(98,0,238,.05));background-size:220% 100%;animation:r5shimmer 1.35s linear infinite}
.txn-loading-spinner{border-top-color:var(--r5-primary)!important}.txn-loading-state{min-height:180px}
@media(max-width:760px){.global-progress{top:64px}.report-loading-state{padding:24px 14px!important}.surface-busy-overlay{font-size:.9rem}.report-loader{align-items:flex-start}.report-loader>div{text-align:left}}
@media(prefers-reduced-motion:reduce){.global-progress>span,.ui-spinner,.skeleton-lines i,body.app-data-busy .kpi-card::after{animation-duration:1.8s}}

.inline-loading{min-height:70px;display:flex;align-items:center;justify-content:center;gap:10px;color:#5f5664;font-weight:600;background:rgba(98,0,238,.035);border:1px dashed rgba(98,0,238,.18);border-radius:8px;padding:14px}.card-icon-action-btn.is-busy svg{display:none}.card-icon-action-btn.is-busy{min-width:34px}

.detail-loading{display:flex!important;align-items:center;justify-content:center;gap:10px;min-height:96px;color:#665d6b;font-weight:600}.detail-loading .ui-spinner{color:var(--r5-primary)}

/* ===== refinement-r6.css ===== */
/* FPS Assistant R6 — visual cleanup & icon consistency */
:root{
  --r6-text:#202124;
  --r6-text-2:#5f6368;
  --r6-text-3:#80868b;
  --r6-border:rgba(32,33,36,.14);
  --r6-surface:#fff;
  --r6-surface-soft:#fafafa;
  --r6-primary:#6200ee;
  --r6-primary-dark:#3700b3;
  --r6-primary-soft:#f1eafd;
  --r6-warning:#8a5600;
  --r6-warning-bg:#fff4d6;
  --r6-success:#176b3a;
  --r6-success-bg:#e6f4ea;
  --r6-error:#b00020;
  --r6-error-bg:#fde7ec;
}
body.md3{color:var(--r6-text)}
body.md3 :where(.dashboard-workspace,.detail-modal-card,.profile-drawer-card,.settings-dialog-card,.notification-panel,.onboarding-card){color:var(--r6-text)}
body.md3 :where(p,small,.section-desc,.overview-topline p,.admin-panel-note,.kpi-caption,.activity-row span,.activity-row small,.drawer-contact-row small,.drawer-contact-row span,.detail-card-subtitle,.txn-comm-meta,.txn-pending-desc,.txn-nav-month-hi,.txn-metric-label,.txn-meta-pill){color:var(--r6-text-2)}
body.md3 :where(h1,h2,h3,h4,strong,.section-title,.report-title,.drawer-contact-row strong,.txn-comm-name,.txn-metric-value){color:var(--r6-text)}
/* Preserve color only when it communicates state/action */
body.md3 :where(a,.text-link,.btn-text,.table-action-btn){color:var(--r6-primary)}
body.md3 .alert-text,body.md3 .detail-error,body.md3 .report-error{color:var(--r6-error)}

/* Sidebar badges: consistent size, neutral counts, semantic attention only */
body.md3 .sidebar-nav .tab-count-badge{
  margin-left:auto!important;min-width:28px!important;height:24px!important;padding:0 8px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  border-radius:12px!important;background:#eee9f7!important;color:#55456f!important;
  border:1px solid #ddd2ef!important;font-size:12px!important;font-weight:700!important;line-height:1!important;
  font-variant-numeric:tabular-nums;box-shadow:none!important;
}
body.md3 .sidebar-nav .tab-count-badge.is-attention{
  background:var(--r6-warning-bg)!important;color:var(--r6-warning)!important;border-color:#f0d58b!important;
}
body.md3 .sidebar-nav .tab-btn.active .tab-count-badge{
  background:#fff!important;color:var(--r6-primary)!important;border-color:#d9c6f8!important;
}
body.md3 .sidebar-nav .tab-btn.active .tab-count-badge.is-attention{color:var(--r6-warning)!important;border-color:#e7c76b!important;background:#fffaf0!important}

/* Icon language */
body.md3 .material-symbols-rounded{vertical-align:middle}
body.md3 .admin-shell .tab-icon{font-family:'Material Symbols Rounded'!important;font-size:23px!important;font-weight:normal!important;font-style:normal!important;line-height:1!important}
body.md3 .msg-author{display:flex;align-items:center;gap:6px}
body.md3 .msg-author .material-symbols-rounded{font-size:16px!important}

/* Card detail drawer: one action only; mobile editing stays next to the number */
body.md3 #registeredCardModal .drawer-actions{grid-template-columns:1fr!important}
body.md3 #registeredCardModal .drawer-actions button{width:100%;justify-content:center}

/* Common transaction history Material treatment */
body.md3 #registeredCardTransactionsModal{background:rgba(32,33,36,.42)!important;backdrop-filter:blur(2px)}
body.md3 #registeredCardTransactionsModal .registered-card-transactions-card{
  width:min(920px,calc(100vw - 32px))!important;max-height:min(860px,calc(100vh - 32px))!important;
  background:var(--r6-surface)!important;border:1px solid var(--r6-border)!important;border-radius:12px!important;
  box-shadow:0 10px 30px rgba(32,33,36,.22)!important;overflow:hidden!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-header{
  background:var(--r6-surface)!important;color:var(--r6-text)!important;border-bottom:1px solid var(--r6-border)!important;
  padding:18px 20px!important;min-height:84px!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-eyebrow{color:var(--r6-primary)!important;font-size:11px!important;letter-spacing:.09em!important;font-weight:800!important}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity h2{color:var(--r6-text)!important;font-size:20px!important}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity span{color:var(--r6-text-2)!important}
body.md3 #registeredCardTransactionsModal .detail-modal-header-actions{gap:10px!important;align-items:center!important}
body.md3 #registeredCardTransactionsModal .icon-btn,
body.md3 #registeredCardModal .icon-btn{
  width:40px!important;height:40px!important;border-radius:50%!important;background:transparent!important;color:var(--r6-text-2)!important;
  border:1px solid transparent!important;display:grid!important;place-items:center!important;padding:0!important;
}
body.md3 #registeredCardTransactionsModal .icon-btn:hover,
body.md3 #registeredCardModal .icon-btn:hover{background:#f3f1f7!important;color:var(--r6-primary)!important;border-color:#e5dcef!important}
body.md3 #registeredCardTransactionsModal .icon-btn .material-symbols-rounded,
body.md3 #registeredCardModal .icon-btn .material-symbols-rounded{font-size:22px!important}
body.md3 #registeredCardTransactionsModal .detail-modal-body{padding:0!important;background:var(--r6-surface-soft)!important}
body.md3 .txn-month-nav{
  display:grid!important;grid-template-columns:minmax(150px,1fr) minmax(260px,1.4fr) minmax(150px,1fr)!important;
  align-items:center!important;gap:12px!important;padding:14px 18px!important;background:#fff!important;border-bottom:1px solid var(--r6-border)!important;
}
body.md3 .txn-nav-btn{
  min-height:42px!important;padding:8px 14px!important;border:1px solid #d5c8e9!important;border-radius:6px!important;
  background:#fff!important;color:var(--r6-primary)!important;font-weight:600!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
}
body.md3 .txn-nav-btn:hover:not(:disabled){background:var(--r6-primary-soft)!important;border-color:#b79bdd!important}
body.md3 .txn-nav-btn:disabled{opacity:.45!important;cursor:not-allowed!important}
body.md3 .txn-nav-center{text-align:center!important}
body.md3 .txn-nav-month-title{display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;color:var(--r6-text)!important;font-size:17px!important;font-weight:700!important}
body.md3 .txn-nav-month-title .material-symbols-rounded{color:var(--r6-primary)!important;font-size:21px!important}
body.md3 .txn-nav-month-hi{font-size:13px!important;margin-top:2px!important}
body.md3 .txn-badge-current,body.md3 .txn-status-badge.completed{background:var(--r6-success-bg)!important;color:var(--r6-success)!important;border:1px solid #b7dfc5!important}
body.md3 .txn-status-badge.pending{background:var(--r6-warning-bg)!important;color:var(--r6-warning)!important;border:1px solid #efd690!important}
body.md3 .txn-jump-current-btn{display:inline-flex!important;align-items:center!important;gap:5px!important;color:var(--r6-primary)!important;background:transparent!important;border:0!important;font-weight:600!important}
body.md3 #txnFlashCardContainer{padding:18px!important;background:var(--r6-surface-soft)!important}
body.md3 .txn-flash-card{
  background:#fff!important;border:1px solid var(--r6-border)!important;border-radius:10px!important;box-shadow:0 1px 3px rgba(32,33,36,.10)!important;overflow:hidden!important;
}
body.md3 .txn-flash-card.is-completed,body.md3 .txn-flash-card.is-pending{border-top:3px solid var(--r6-primary)!important}
body.md3 .txn-flash-header{background:#fff!important;border-bottom:1px solid var(--r6-border)!important;padding:16px 18px!important}
body.md3 .txn-flash-eyebrow{color:var(--r6-primary)!important;font-weight:800!important;font-size:11px!important;letter-spacing:.06em!important}
body.md3 .txn-entitled-strip{background:#f7f3fc!important;border:1px solid #e3d8f4!important;border-radius:7px!important;padding:11px 12px!important;margin-top:10px!important}
body.md3 .txn-entitled-label{color:var(--r6-text)!important;display:flex!important;align-items:center!important;gap:6px!important;font-weight:600!important}
body.md3 .txn-entitled-label .material-symbols-rounded{font-size:18px!important;color:var(--r6-primary)!important}
body.md3 .txn-entitled-chip{background:#fff!important;border:1px solid #ddd2ef!important;color:var(--r6-text)!important;border-radius:16px!important}
body.md3 .txn-entitled-icon{font-size:17px!important;color:var(--r6-primary)!important}
body.md3 .txn-section-title{color:var(--r6-text)!important;background:#fff!important;border-bottom:1px solid var(--r6-border)!important;padding:14px 18px!important}
body.md3 .txn-section-title>span:first-child{display:flex!important;align-items:center!important;gap:7px!important;font-weight:700!important}
body.md3 .txn-section-title .material-symbols-rounded{font-size:19px!important;color:var(--r6-primary)!important}
body.md3 .txn-commodities-grid{padding:14px 18px!important;gap:10px!important;background:#fff!important}
body.md3 .txn-comm-card{background:#fafafa!important;border:1px solid var(--r6-border)!important;border-radius:8px!important;box-shadow:none!important}
body.md3 .txn-comm-icon{width:36px!important;height:36px!important;border-radius:50%!important;background:var(--r6-primary-soft)!important;color:var(--r6-primary)!important;display:grid!important;place-items:center!important;font-size:20px!important}
body.md3 .txn-comm-qty{color:var(--r6-text)!important;font-weight:700!important}
body.md3 .txn-pending-box{margin:16px 18px!important;padding:16px!important;border:1px solid #efd690!important;border-radius:8px!important;background:#fffaf0!important}
body.md3 .txn-pending-title{display:flex!important;align-items:center!important;gap:7px!important;color:var(--r6-warning)!important;font-weight:700!important}
body.md3 .txn-pending-title .material-symbols-rounded{font-size:20px!important}
body.md3 .txn-metric-tiles{padding:0 18px 14px!important;gap:10px!important;background:#fff!important}
body.md3 .txn-metric-tile{background:#fafafa!important;border:1px solid var(--r6-border)!important;border-radius:8px!important;box-shadow:none!important}
body.md3 .txn-metric-value.highlight{color:var(--r6-text)!important}
body.md3 .txn-meta-strip{padding:12px 18px 16px!important;background:#fff!important;border-top:1px solid var(--r6-border)!important;gap:8px!important}
body.md3 .txn-meta-pill{background:#f5f3f7!important;border:1px solid #e2dde7!important;border-radius:16px!important;color:var(--r6-text-2)!important}
body.md3 .txn-meta-pill strong{color:var(--r6-text)!important}
body.md3 .txn-loading-state{min-height:200px!important;color:var(--r6-text-2)!important}
body.md3 .txn-loading-spinner{border-color:#e3d8f4!important;border-top-color:var(--r6-primary)!important}
body.md3 .txn-footer-actions{display:flex!important;justify-content:flex-end!important;gap:8px!important;padding:14px 18px!important;border-top:1px solid var(--r6-border)!important;background:#fff!important}
body.md3 .txn-footer-actions .action-btn{min-height:40px!important;padding:8px 14px!important;border-radius:6px!important;border:1px solid #d5c8e9!important;background:#fff!important;color:var(--r6-primary)!important;font-weight:600!important}
body.md3 .txn-footer-actions .action-btn:last-child{background:var(--r6-primary)!important;color:#fff!important;border-color:var(--r6-primary)!important}

/* Utility/info icons all share one controlled style */
body.md3 :where(.drawer-contact-row,.sidebar-help-card,.profile-location-grid,.side-card-title,.activity-icon,.attention-icon)>.material-symbols-rounded{color:var(--r6-primary)}
body.md3 .activity-icon.success>.material-symbols-rounded{color:var(--r6-success)}
body.md3 .activity-icon.warning>.material-symbols-rounded,body.md3 .attention-icon.warning>.material-symbols-rounded{color:var(--r6-warning)}
body.md3 .activity-icon.error>.material-symbols-rounded,body.md3 .attention-icon.error>.material-symbols-rounded{color:var(--r6-error)}

@media(max-width:720px){
  body.md3 .txn-month-nav{grid-template-columns:1fr 1fr!important}
  body.md3 .txn-nav-center{grid-column:1/-1;grid-row:1}
  body.md3 #txnFlashCardContainer{padding:10px!important}
  body.md3 .txn-commodities-grid{grid-template-columns:1fr!important;padding:10px!important}
  body.md3 .txn-metric-tiles{grid-template-columns:1fr!important;padding:0 10px 10px!important}
  body.md3 .txn-footer-actions{flex-direction:column-reverse!important}
  body.md3 .txn-footer-actions .action-btn{width:100%!important}
}

/* ===== refinement-r7.css ===== */
/* FPS Assistant R7 — header visibility, flat topbar, card-type counts */
:root{--r7-primary:#6200ee;--r7-primary-dark:#3700b3;--r7-on-primary:#fff;--r7-line:rgba(255,255,255,.25)}

/* Top universal bar: one purple plane, no second-shade pills */
body.md3 .m2-topbar .global-search,
body.md3 .m2-topbar .portal-compact,
body.md3 .m2-topbar .notification-button{
  background:transparent!important;
  border:1px solid rgba(255,255,255,.24)!important;
  box-shadow:none!important;
  color:#fff!important;
}
body.md3 .m2-topbar .global-search:focus-within,
body.md3 .m2-topbar .portal-compact:hover,
body.md3 .m2-topbar .notification-button:hover{
  background:rgba(255,255,255,.08)!important;
  border-color:rgba(255,255,255,.42)!important;
}
body.md3 .m2-topbar .global-search input,
body.md3 .m2-topbar .global-search .material-symbols-rounded,
body.md3 .m2-topbar .global-search-scope,
body.md3 .m2-topbar .global-search-feedback,
body.md3 .m2-topbar .portal-compact strong,
body.md3 .m2-topbar .portal-compact span,
body.md3 .m2-topbar .portal-compact b,
body.md3 .m2-topbar .notification-button .material-symbols-rounded,
body.md3 .m2-topbar .notification-label{color:#fff!important}
body.md3 .m2-topbar .global-search input::placeholder{color:rgba(255,255,255,.72)!important}
body.md3 .m2-topbar .notification-badge{background:#03dac6!important;color:#10201e!important;border:2px solid var(--r7-primary)!important}

/* Drawer/modal headers: same surface, visible title/status/actions */
body.md3 .profile-drawer-hero,
body.md3 #registeredCardModal .detail-modal-header,
body.md3 #registeredCardTransactionsModal .detail-modal-header{
  background:linear-gradient(135deg,var(--r7-primary),var(--r7-primary-dark))!important;
  color:#fff!important;
  border-bottom:0!important;
  min-height:88px!important;
  padding:18px 18px!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  overflow:visible!important;
}
body.md3 .profile-drawer-identity,
body.md3 #registeredCardModal .detail-modal-header>div:first-child,
body.md3 #registeredCardTransactionsModal .detail-modal-header>div:first-child,
body.md3 .registered-card-modal-identity,
body.md3 .card-detail-heading-main{min-width:0!important;flex:1 1 auto!important;overflow:visible!important}
body.md3 .profile-drawer-identity :where(small,strong,span),
body.md3 #registeredCardModal .detail-modal-header :where(.detail-modal-eyebrow,h2,.drawer-kicker,.drawer-title-line h2),
body.md3 #registeredCardTransactionsModal .detail-modal-header :where(.detail-modal-eyebrow,h2,.registered-card-modal-identity span){color:#fff!important}
body.md3 .profile-drawer-identity strong,
body.md3 #registeredCardModal .drawer-title-line h2,
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity h2{
  white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.22!important;
}
body.md3 #registeredCardModal .drawer-title-line{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;width:100%!important}
body.md3 #registeredCardModal .drawer-title-line>div{min-width:0!important;flex:1 1 180px!important}
body.md3 #registeredCardModal .drawer-status,
body.md3 #registeredCardTransactionsModal .detail-card-type,
body.md3 #registeredCardTransactionsModal #registeredCardTxnStatusBadge>*{
  flex:0 0 auto!important;background:rgba(255,255,255,.16)!important;color:#fff!important;border:1px solid rgba(255,255,255,.34)!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-header-actions{margin-left:auto!important;flex:0 0 auto!important;display:flex!important;align-items:center!important;gap:8px!important}

/* Close buttons: plain transparent cross, no filled circle */
body.md3 :where(.profile-drawer-close,.settings-dialog-close,#notificationClose,#registeredCardModalClose,#registeredCardTransactionsClose,#onboardingCloseBtn){
  background:transparent!important;border:0!important;box-shadow:none!important;border-radius:50%!important;padding:0!important;width:40px!important;height:40px!important;display:grid!important;place-items:center!important;
}
body.md3 :where(.profile-drawer-close,#registeredCardModalClose,#registeredCardTransactionsClose) .material-symbols-rounded{color:#fff!important;font-size:26px!important;font-weight:500!important}
body.md3 :where(.settings-dialog-close,#notificationClose,#onboardingCloseBtn) .material-symbols-rounded{color:#5f6368!important;font-size:25px!important}
body.md3 :where(.profile-drawer-close,#registeredCardModalClose,#registeredCardTransactionsClose):hover{background:rgba(255,255,255,.10)!important}
body.md3 :where(.settings-dialog-close,#notificationClose,#onboardingCloseBtn):hover{background:rgba(32,33,36,.06)!important}

/* Registered card type filters with live count badges */
body.md3 #tabRegisteredDetails .filter-chip{display:inline-flex!important;align-items:center!important;gap:7px!important;min-height:38px!important;padding:7px 10px 7px 12px!important}
body.md3 #tabRegisteredDetails .filter-chip .type-count{min-width:24px;height:22px;padding:0 7px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;background:#ede7f6;color:#5a3e82;font-size:11px;font-weight:800;font-variant-numeric:tabular-nums}
body.md3 #tabRegisteredDetails .filter-chip.active .type-count{background:rgba(255,255,255,.22);color:currentColor;border:1px solid currentColor}
body.md3 #tabRegisteredDetails .report-filter-row{row-gap:8px!important;overflow-x:auto!important;scrollbar-width:thin}

@media(max-width:760px){
  body.md3 .m2-topbar .portal-compact .portal-compact-meta,body.md3 .m2-topbar .notification-label{display:none!important}
  body.md3 #registeredCardTransactionsModal .detail-modal-header{align-items:flex-start!important;flex-wrap:wrap!important}
  body.md3 #registeredCardTransactionsModal .detail-modal-header-actions{width:100%!important;justify-content:flex-end!important}
}

/* ===== refinement-r8.css ===== */
/* FPS Assistant R8 — light-only transaction/sidebar production cleanup */
:root{color-scheme:light}
html,body{background:#fafafa!important;color:#1f1b24!important}

/* Sidebar: deterministic light Material surface */
body.md3 .exact-sidebar,
body.md3 .dashboard-sidebar{
  background:#fff!important;
  color:#1f1b24!important;
  border-right:1px solid rgba(0,0,0,.12)!important;
  box-shadow:none!important;
}
body.md3 .sidebar-nav .tab-btn{
  background:transparent!important;
  color:#5f6368!important;
  border:0!important;
  box-shadow:none!important;
}
body.md3 .sidebar-nav .tab-btn .material-symbols-rounded{color:#6f6a73!important}
body.md3 .sidebar-nav .tab-btn:hover{
  background:#f7f3fb!important;
  color:#3700b3!important;
}
body.md3 .sidebar-nav .tab-btn:hover .material-symbols-rounded{color:#6200ee!important}
body.md3 .sidebar-nav .tab-btn.active{
  background:#ede7f6!important;
  color:#4f2995!important;
  box-shadow:inset 3px 0 0 #6200ee!important;
}
body.md3 .sidebar-nav .tab-btn.active .material-symbols-rounded{color:#6200ee!important}
body.md3 .sidebar-nav .tab-count-badge{
  background:#f1edf5!important;
  color:#5f5866!important;
  border:1px solid #e1d9e8!important;
}
body.md3 .sidebar-nav .tab-count-badge.is-attention{
  background:#fff3cd!important;
  color:#8a5d00!important;
  border-color:#efd690!important;
}
body.md3 .sidebar-help-card{background:#faf8fc!important;color:#4f4655!important;border:1px solid #e5dfea!important}
body.md3 .sidebar-help-card .material-symbols-rounded{color:#6200ee!important}

/* Transaction history: remove any legacy black/teal flash-card appearance */
body.md3 #registeredCardTransactionsModal{
  background:rgba(55,0,179,.16)!important;
  backdrop-filter:blur(2px)!important;
}
body.md3 #registeredCardTransactionsModal .registered-card-transactions-card{
  background:#fff!important;
  color:#1f1b24!important;
  border:1px solid #ded8e3!important;
  box-shadow:0 12px 36px rgba(42,31,51,.18)!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-body,
body.md3 #txnFlashCardContainer{background:#fafafa!important;color:#1f1b24!important}
body.md3 .txn-month-nav,
body.md3 .txn-flash-card,
body.md3 .txn-flash-header,
body.md3 .txn-commodities-grid,
body.md3 .txn-metric-tiles,
body.md3 .txn-meta-strip,
body.md3 .txn-footer-actions,
body.md3 .txn-section-title{background:#fff!important;color:#1f1b24!important}
body.md3 .txn-flash-card{
  border:1px solid #ddd7e2!important;
  border-top:3px solid #6200ee!important;
  box-shadow:0 1px 4px rgba(31,27,36,.09)!important;
}
body.md3 .txn-flash-header{border-bottom:1px solid rgba(0,0,0,.12)!important}
body.md3 .txn-nav-btn,
body.md3 .txn-footer-actions .action-btn{
  background:#fff!important;
  color:#6200ee!important;
  border:1px solid #cfc3db!important;
  box-shadow:none!important;
}
body.md3 .txn-nav-btn:hover:not(:disabled),
body.md3 .txn-footer-actions .action-btn:hover{background:#f5f0fb!important;border-color:#a98ac9!important}
body.md3 .txn-footer-actions .action-btn:last-child{background:#6200ee!important;color:#fff!important;border-color:#6200ee!important}
body.md3 .txn-metric-tile,
body.md3 .txn-comm-card{background:#fafafa!important;color:#1f1b24!important;border:1px solid #e2dde6!important;box-shadow:none!important}
body.md3 .txn-entitled-strip{background:#f7f3fc!important;border:1px solid #e3d8f4!important}
body.md3 :where(.txn-flash-period-name,.txn-metric-value,.txn-comm-name,.txn-entitled-label,.txn-section-title){color:#1f1b24!important}
body.md3 :where(.txn-nav-month-hi,.txn-metric-label,.txn-comm-meta,.txn-meta-pill,.txn-pending-desc){color:#686169!important}
body.md3 :where(.txn-flash-eyebrow,.txn-section-title .material-symbols-rounded,.txn-nav-month-title .material-symbols-rounded){color:#6200ee!important}
body.md3 .txn-entitled-chip{background:#fff!important;color:#1f1b24!important;border:1px solid #ddd2ef!important}
body.md3 .txn-entitled-chip strong{color:#6200ee!important}
body.md3 .txn-metric-value.highlight{color:#1f1b24!important}
body.md3 .txn-metric-value.success{color:#1b7f3a!important}
body.md3 .txn-status-badge.completed{background:#e7f5ec!important;color:#1b7f3a!important;border:1px solid #b7dfc5!important;box-shadow:none!important}
body.md3 .txn-status-badge.pending{background:#fff3cd!important;color:#8a5d00!important;border:1px solid #efd690!important;box-shadow:none!important}
body.md3 .txn-status-dot{box-shadow:none!important}
body.md3 .txn-pending-box{background:#fffaf0!important;color:#1f1b24!important}

/* Defensive light-only surfaces for menus/dialogs that previously inherited old theme vars */
body.md3 :where(.export-menu-popover,.settings-dialog-card,.profile-drawer-card,.notification-panel,.detail-modal-card,.login-card,.onboarding-card,.admin-panel){
  color-scheme:light!important;
}
body.md3 :where(.export-menu-popover,.settings-dialog-card,.profile-drawer-card,.notification-panel){background:#fff!important;color:#1f1b24!important}

@media(max-width:760px){
  body.md3 .sidebar-nav .tab-btn.active{box-shadow:inset 3px 0 0 #6200ee!important}
}


/* ===== R9 production accessibility & mobile additions ===== */
:root{color-scheme:light}
html{scroll-padding-top:76px}
body{padding-bottom:env(safe-area-inset-bottom,0px)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid rgba(3,218,198,.95)!important;outline-offset:2px!important}
.mobile-more-sheet{display:none}
@media(max-width:900px){
  .mobile-bottom-nav{height:calc(68px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);grid-template-columns:repeat(5,1fr)!important}
  .dashboard-workspace{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
  .mobile-more-sheet{position:fixed;left:12px;right:12px;bottom:calc(78px + env(safe-area-inset-bottom,0px));z-index:140;background:#fff;border:1px solid rgba(0,0,0,.12);border-radius:18px;box-shadow:0 8px 28px rgba(0,0,0,.2);padding:10px;max-height:64vh;overflow:auto}
  .mobile-more-sheet.open{display:block}
  .mobile-more-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .mobile-more-item{min-height:48px;border-radius:12px;padding:10px 12px;display:flex;align-items:center;gap:10px;text-align:left;color:#2d2d33;background:transparent}
  .mobile-more-item:hover,.mobile-more-item:focus-visible{background:rgba(98,0,238,.08)}
  .mobile-more-item .material-symbols-rounded{color:#6200ee}
}

/* ===== R10 Functional QA fixes ===== */
body.md3 .dashboard-shell{grid-template-columns:252px minmax(0,1fr)!important}
body.md3 .dashboard-sidebar{width:252px!important;min-width:252px!important}
body.md3 .sidebar-nav .tab-btn{min-height:48px!important;padding:0 12px!important;gap:10px!important}
body.md3 .sidebar-nav .tab-btn>span:nth-child(2){white-space:normal!important;line-height:1.2!important}
body.md3 .admin-profile-actions{display:grid;gap:8px;margin-top:14px}
body.md3 .admin-profile-action{min-height:42px;border:1px solid #ded7e7;border-radius:8px;background:#fff;color:#4f2995;font-weight:700;display:flex;align-items:center;justify-content:center;gap:8px}
body.md3 .admin-profile-action.danger{color:#b00020;border-color:#f0c9d1;background:#fff8fa}
body.md3 .admin-state-cta{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
body.md3 #registeredDetailsTable .card-type-label{font-weight:700;color:#2f2933;white-space:nowrap}
body.md3 #registeredDetailsTable th,body.md3 #registeredDetailsTable td{vertical-align:middle!important}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity h2,
body.md3 #registeredCardTransactionsModal #registeredCardTransactionsTitle{color:#fff!important;opacity:1!important;visibility:visible!important;text-shadow:none!important}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity span{color:rgba(255,255,255,.92)!important}
body.md3 .export-trigger{background:#fff!important;color:#4f2995!important;border:1px solid #d9d1e4!important;box-shadow:0 1px 2px rgba(0,0,0,.06)!important}
body.md3 .export-trigger:hover{background:#f7f3fb!important;border-color:#bca9d8!important}
body.md3 .export-menu-popover{background:#fff!important;border:1px solid #ddd6e6!important;box-shadow:0 10px 26px rgba(36,22,49,.16)!important;border-radius:10px!important}
body.md3 .export-option{background:transparent!important;color:#2f2933!important;border-radius:7px!important}
body.md3 .export-option:hover{background:#f7f3fb!important}
body.md3 .exact-chat-input .chat-input{font-size:16px!important;line-height:1.35!important;height:44px!important;padding:0 13px!important}
body.md3 .exact-chat-input{min-height:58px!important}
.mobile-sidebar-toggle{display:none;border:0;background:transparent;color:#fff;width:40px;height:40px;border-radius:50%;align-items:center;justify-content:center}
.mobile-sidebar-toggle .material-symbols-rounded{font-size:26px}
.mobile-sidebar-scrim{display:none}
@media(max-width:900px){
  body.md3 .mobile-sidebar-toggle{display:inline-flex}
  body.md3 .dashboard-sidebar{display:flex!important;position:fixed!important;left:0!important;top:64px!important;bottom:0!important;height:auto!important;max-height:none!important;width:min(84vw,300px)!important;min-width:0!important;z-index:160!important;transform:translateX(-105%);transition:transform .22s ease;box-shadow:0 12px 30px rgba(0,0,0,.2)!important;overflow:hidden!important}
  body.md3.mobile-sidebar-open .dashboard-sidebar{transform:translateX(0)}
  body.md3 .mobile-sidebar-scrim{position:fixed;inset:64px 0 0;background:rgba(0,0,0,.36);z-index:150}
  body.md3.mobile-sidebar-open .mobile-sidebar-scrim{display:block}
  body.md3 .sidebar-nav{overflow-y:auto!important;overscroll-behavior:contain}
  body.md3 .dashboard-shell{display:block!important}
}
@media(min-width:901px) and (max-width:1180px){body.md3 .dashboard-shell{grid-template-columns:230px minmax(0,1fr)!important}body.md3 .dashboard-sidebar{width:230px!important;min-width:230px!important}}
body.md3 .admin-state-summary{margin-top:16px!important}
body.md3 .admin-state-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:14px}
body.md3 .admin-state-grid>div{background:#faf8fc;border:1px solid #e4ddeb;border-radius:10px;padding:14px}
body.md3 .admin-state-grid small{display:block;color:#6c6570;font-weight:700;margin-bottom:6px}
body.md3 .admin-state-grid strong{font-size:1.55rem;color:#3700b3}
@media(max-width:900px){body.md3 .admin-state-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
body.md3 .card-profile-extra{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
body.md3 .card-profile-extra>div{border:1px solid #e8e2ec;background:#faf9fb;border-radius:8px;padding:10px 12px;min-width:0}
body.md3 .card-profile-extra small{display:block;color:#726b76;font-size:.78rem;margin-bottom:4px}
body.md3 .card-profile-extra strong{display:block;color:#2f2933;font-size:.92rem;overflow-wrap:anywhere}

/* R11 card-master onboarding verification */
.onboarding-verify-line,
.onboarding-verify-warning {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 32px;
  font-size: .96rem;
  color: var(--text-primary);
}
.onboarding-verify-line .material-symbols-rounded { color: var(--success, #188038); font-size: 20px; }
.onboarding-verify-warning { color: var(--warning, #8a5a00); }
.onboarding-verify-warning .material-symbols-rounded { font-size: 20px; }

/* ===== R12 Mobile-first Login + Onboarding polish ===== */
body.md3 .auth-overlay{
  padding:18px 12px!important;
  align-items:center!important;
  justify-content:center!important;
  background:linear-gradient(180deg,#f4effb 0%,#faf8fc 46%,#fff 100%)!important;
}
body.md3 .first-run-card{
  width:min(100%,420px)!important;
  max-width:420px!important;
  border-radius:20px!important;
  border:1px solid #e2d9ec!important;
  background:#fff!important;
  box-shadow:0 18px 48px rgba(55,0,179,.14)!important;
}
body.md3 .login-card.first-run-card{padding:24px 22px!important;gap:11px!important}
body.md3 .first-run-brand{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;margin:0 0 6px!important}
body.md3 .first-run-brand .login-mark.brand-mark{width:48px!important;height:48px!important;margin:0!important;border-radius:15px!important;background:#f1e9fb!important;color:#6200ee!important}
body.md3 .first-run-brand .login-mark .material-symbols-rounded{font-size:30px!important}
body.md3 .first-run-brand .nav-title{font-size:1.22rem!important;font-weight:700!important;color:#2f2933!important;-webkit-text-fill-color:#2f2933!important;line-height:1.1!important}
body.md3 .first-run-brand small{display:block;margin-top:3px;color:#746c79;font-size:.78rem;font-weight:600}
body.md3 .first-run-intro{display:flex;align-items:flex-start;gap:10px;background:#faf8fd;border:1px solid #ebe4f1;border-radius:12px;padding:12px;margin:4px 0 7px}
body.md3 .first-run-intro>.material-symbols-rounded{color:#6200ee;font-size:23px;margin-top:1px}
body.md3 .first-run-intro h2{font-size:1.16rem!important;margin:0 0 2px!important;color:#2f2933!important}
body.md3 .first-run-intro p{font-size:.84rem!important;margin:0!important;color:#6e6673!important}
body.md3 .login-card label,body.md3 .onboarding-card label{font-size:.86rem!important;font-weight:700!important;color:#514a56!important}
body.md3 .login-card input,body.md3 .onboarding-card input,body.md3 .onboarding-card select{font-size:16px!important;min-height:48px!important;border-radius:10px!important;background:#fff!important}
body.md3 .password-field{position:relative;display:flex;align-items:center}
body.md3 .password-field>input{width:100%!important;padding-right:48px!important}
body.md3 .password-toggle{position:absolute;right:4px;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;color:#655d6a;background:transparent}
body.md3 .password-toggle:hover{background:#f2edf7;color:#6200ee}
body.md3 .password-toggle .material-symbols-rounded{font-size:21px}
body.md3 .auth-main-action{min-height:48px!important;margin-top:5px!important;border-radius:10px!important;font-size:.96rem!important}
body.md3 .first-run-divider{display:flex;align-items:center;gap:10px;color:#8a818e;font-size:.76rem;font-weight:700;margin:4px 0 0}
body.md3 .first-run-divider:before,body.md3 .first-run-divider:after{content:"";height:1px;background:#ece5f0;flex:1}
body.md3 .auth-onboard-action{min-height:46px!important;border-radius:10px!important;justify-content:center!important;display:flex!important;align-items:center!important;gap:8px!important;font-weight:700!important}
body.md3 .auth-onboard-action .material-symbols-rounded{font-size:20px}
body.md3 .login-error{color:#b00020!important;font-size:.82rem!important;font-weight:600!important;line-height:1.35!important}

body.md3 .onboarding-card.first-run-card{width:min(100%,430px)!important;max-width:430px!important;max-height:min(92vh,780px)!important;padding:0!important;overflow:auto!important;overscroll-behavior:contain}
body.md3 .onboarding-header{position:sticky!important;top:0!important;z-index:5!important;padding:18px 18px 12px!important;background:#6200ee!important;border:0!important;color:#fff!important}
body.md3 .onboarding-header .detail-modal-eyebrow,body.md3 .onboarding-header h2,body.md3 .onboarding-header p{color:#fff!important}
body.md3 .onboarding-header h2{font-size:1.18rem!important;line-height:1.2!important;margin:2px 0 3px!important}
body.md3 .onboarding-header p{font-size:.78rem!important;opacity:.88!important;margin:0!important}
body.md3 .onboarding-header .icon-btn{background:transparent!important;color:#fff!important;border:0!important}
body.md3 .onboarding-header .icon-btn:hover{background:rgba(255,255,255,.12)!important}
body.md3 .onboarding-progress-rail{display:grid;grid-template-columns:repeat(6,1fr);gap:2px;padding:12px 13px 10px;background:#fff;border-bottom:1px solid #eee8f2;position:sticky;top:78px;z-index:4}
body.md3 .onboarding-progress-rail>span{min-width:0;display:grid;justify-items:center;gap:4px;color:#98909b;font-size:.58rem;font-weight:700;text-align:center;position:relative}
body.md3 .onboarding-progress-rail>span:not(:last-child):after{content:"";position:absolute;top:11px;left:65%;width:70%;height:2px;background:#e7e0ec;z-index:0}
body.md3 .onboarding-progress-rail i{width:23px;height:23px;border-radius:50%;display:grid;place-items:center;background:#f0ecf3;color:#817985;font-size:.68rem;font-style:normal;font-weight:800;z-index:1;border:1px solid #e5dce9}
body.md3 .onboarding-progress-rail .is-current{color:#6200ee}
body.md3 .onboarding-progress-rail .is-current i{background:#6200ee;color:#fff;border-color:#6200ee;box-shadow:0 0 0 3px rgba(98,0,238,.10)}
body.md3 .onboarding-progress-rail .is-done{color:#25733c}
body.md3 .onboarding-progress-rail .is-done i{background:#e7f5ec;color:#1b7f3a;border-color:#b8dfc5}
body.md3 .onboarding-progress-rail .is-done:not(:last-child):after{background:#b8dfc5}
body.md3 .onboarding-step{padding:18px!important}
body.md3 .onboarding-help{font-size:.84rem!important;line-height:1.45!important;color:#716a75!important;margin:0 0 14px!important}
body.md3 .onboarding-step label{display:grid;gap:6px;margin-bottom:13px}
body.md3 .onboarding-shop-card{display:grid!important;grid-template-columns:1fr!important;gap:0!important;padding:0!important;border:1px solid #e7dfec!important;background:#faf8fc!important;border-radius:12px!important;overflow:hidden}
body.md3 .onboarding-shop-card>div{padding:11px 13px;border-bottom:1px solid #ece6f0}
body.md3 .onboarding-shop-card>div:last-child{border-bottom:0}
body.md3 .onboarding-shop-card span{display:block;font-size:.7rem!important;text-transform:uppercase;letter-spacing:.045em;color:#837a87!important;font-weight:800}
body.md3 .onboarding-shop-card strong{display:block;margin-top:3px;color:#2f2933!important;font-size:.94rem!important;line-height:1.35;overflow-wrap:anywhere}
body.md3 .verify-check{display:flex!important;grid-template-columns:none!important;align-items:flex-start!important;gap:9px!important;padding:11px 12px;border-radius:10px;background:#f7f3fc;border:1px solid #e5d9f2;color:#463c4d!important;font-size:.82rem!important}
body.md3 .verify-check input{min-height:0!important;width:18px!important;height:18px!important;flex:0 0 auto;margin-top:1px}
body.md3 .onboarding-plan-section{margin-top:15px;border-top:1px solid #eee7f2;padding-top:14px}
body.md3 .onboarding-plan-heading>div{display:flex;align-items:flex-start;gap:9px;margin-bottom:10px}
body.md3 .onboarding-plan-heading .material-symbols-rounded{font-size:22px;color:#6200ee}
body.md3 .onboarding-plan-heading strong{display:block;font-size:.92rem;color:#2f2933}
body.md3 .onboarding-plan-heading small{display:block;color:#79717d;font-size:.73rem;margin-top:2px}
body.md3 .onboarding-plans{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
body.md3 .onboarding-plan{display:grid!important;grid-template-columns:26px minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;margin:0!important;padding:12px!important;border:1px solid #e2dbe7!important;border-radius:12px!important;background:#fff!important;cursor:pointer;transition:border-color .16s,background .16s,box-shadow .16s}
body.md3 .onboarding-plan>input{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important;min-height:0!important}
body.md3 .onboarding-plan:has(input:checked){border-color:#6200ee!important;background:#f8f3fe!important;box-shadow:0 0 0 2px rgba(98,0,238,.08)!important}
body.md3 .onboarding-plan-select{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;border:2px solid #c9bdcf;color:transparent;background:#fff}
body.md3 .onboarding-plan:has(input:checked) .onboarding-plan-select{background:#6200ee;border-color:#6200ee;color:#fff}
body.md3 .onboarding-plan-select .material-symbols-rounded{font-size:15px}
body.md3 .onboarding-plan-copy{min-width:0;display:block}
body.md3 .onboarding-plan-title{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
body.md3 .onboarding-plan-copy strong{font-size:.9rem;color:#2f2933}
body.md3 .onboarding-plan-copy small{display:block;color:#77707a;font-size:.7rem;line-height:1.3;margin-top:3px}
body.md3 .onboarding-plan-copy em{display:block;color:#1b7f3a;font-size:.68rem;font-style:normal;font-weight:700;margin-top:3px}
body.md3 .plan-value-badge{display:inline-flex;padding:2px 6px;border-radius:99px;background:#e8ddfb;color:#4f2995;font-size:.58rem;font-weight:800;letter-spacing:.04em}
body.md3 .plan-value-badge.neutral{background:#eaf6f3;color:#176c61}
body.md3 .onboarding-plan-price{text-align:right;white-space:nowrap}
body.md3 .onboarding-plan-price b{display:block;font-size:1rem;color:#3700b3}
body.md3 .onboarding-plan-price small{display:block;font-size:.62rem;color:#867e89;margin-top:1px}
body.md3 .onboarding-plan-error{display:flex;align-items:center;gap:8px;padding:11px;border:1px solid #f0c7d0;background:#fff7f9;color:#9f1733;border-radius:10px;font-size:.8rem;font-weight:700}
body.md3 .onboarding-summary{display:grid!important;gap:12px!important;padding:0!important;background:transparent!important;border:0!important}
body.md3 .onboarding-success-mark{display:flex;gap:10px;align-items:center;padding:13px;border-radius:12px;background:#edf8f0;border:1px solid #c8e6d1}
body.md3 .onboarding-success-mark>.material-symbols-rounded{font-size:29px;color:#1b7f3a}
body.md3 .onboarding-success-mark strong{display:block;color:#205c31;font-size:.96rem}
body.md3 .onboarding-success-mark small{display:block;color:#55745d;font-size:.73rem;margin-top:2px}
body.md3 .onboarding-success-identity{border:1px solid #e6dfea;border-radius:12px;background:#fff;overflow:hidden}
body.md3 .onboarding-success-identity>div{padding:10px 12px;border-bottom:1px solid #eee8f1}
body.md3 .onboarding-success-identity>div:last-child{border-bottom:0}
body.md3 .onboarding-success-identity small{display:block;color:#827985;font-size:.66rem;text-transform:uppercase;font-weight:800;letter-spacing:.04em}
body.md3 .onboarding-success-identity b{display:block;color:#2f2933;font-size:.88rem;margin-top:2px;overflow-wrap:anywhere}
body.md3 .onboarding-success-checks{display:grid;gap:6px;padding:11px 12px;background:#faf8fc;border:1px solid #e9e2ed;border-radius:12px}
body.md3 .onboarding-success-plan{display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid #ded1ee;background:#f8f3fe;border-radius:12px}
body.md3 .onboarding-success-plan>.material-symbols-rounded{color:#6200ee}
body.md3 .onboarding-success-plan small{display:block;color:#817786;font-size:.66rem;text-transform:uppercase;font-weight:800}
body.md3 .onboarding-success-plan b{display:inline-block;color:#3f3150;font-size:.86rem;margin-right:7px}
body.md3 .onboarding-success-plan span{color:#6200ee;font-weight:800;font-size:.82rem}
body.md3 .onboarding-sync-note{display:flex;align-items:flex-start;gap:8px;margin:0!important;padding:10px 11px;border-radius:10px;background:#f5f2f8;color:#6b6370!important;font-size:.75rem!important;line-height:1.4}
body.md3 .onboarding-sync-note .material-symbols-rounded{font-size:18px;color:#6200ee;flex:0 0 auto}
body.md3 .onboarding-actions{position:sticky!important;bottom:0!important;z-index:5!important;background:#fff!important;border-top:1px solid #eee8f1!important;padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px))!important;gap:9px!important}
body.md3 .onboarding-actions button{min-height:46px!important;border-radius:10px!important;flex:1}
body.md3 #onboardingError{padding:0 18px!important;display:block!important;min-height:0!important}

@media(max-width:460px){
  body.md3 .auth-overlay{padding:0!important;align-items:stretch!important;background:#fff!important}
  body.md3 .login-card.first-run-card{width:100%!important;max-width:none!important;min-height:100dvh!important;border:0!important;border-radius:0!important;box-shadow:none!important;justify-content:center!important;padding:24px 18px calc(28px + env(safe-area-inset-bottom,0px))!important}
  body.md3 .onboarding-card.first-run-card{width:100%!important;max-width:none!important;height:100dvh!important;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important}
  body.md3 .onboarding-progress-rail{top:78px!important;padding-left:8px!important;padding-right:8px!important}
  body.md3 .onboarding-progress-rail>span{font-size:.53rem!important}
  body.md3 .onboarding-step{padding:16px!important}
  body.md3 .onboarding-actions{padding-left:16px!important;padding-right:16px!important}
}

/* ===== R12 UI touch-up pass ===== */
/* Keep the universal app bar vertically balanced on desktop and mobile. */
body.md3 .exact-topbar .nav-container{
  padding-top:10px!important;
  padding-bottom:10px!important;
  height:auto!important;
  min-height:68px!important;
}
body.md3 .m2-global-search,
body.md3 .portal-compact,
body.md3 .notification-button,
body.md3 .top-user,
body.md3 .top-auth{align-self:center!important;margin-top:0!important;margin-bottom:0!important}
@media(max-width:760px){
  body.md3 .exact-topbar .nav-container{padding:8px 10px!important;}
}

/* Utility icon buttons: compact rounded-square hit areas instead of oval/circle outlines. */
body.md3 :where(.icon-btn,.password-toggle,.profile-drawer-close,.settings-dialog-close,.notification-head button,#onboardingCloseBtn,.row-chevron){
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  padding:0!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  box-shadow:none!important;
  display:inline-grid!important;
  place-items:center!important;
}
body.md3 :where(.icon-btn,.password-toggle,.profile-drawer-close,.settings-dialog-close,.notification-head button,#onboardingCloseBtn,.row-chevron):hover{
  background:rgba(98,0,238,.08)!important;
}
body.md3 .onboarding-header #onboardingCloseBtn,
body.md3 .profile-drawer-hero .profile-drawer-close,
body.md3 .detail-modal-header .icon-btn{
  color:#fff!important;
}
body.md3 .onboarding-header #onboardingCloseBtn:hover,
body.md3 .profile-drawer-hero .profile-drawer-close:hover,
body.md3 .detail-modal-header .icon-btn:hover{
  background:rgba(255,255,255,.14)!important;
}

/* Onboarding Back action: keep label optically centered. */
body.md3 #onboardingBackBtn{
  display:inline-flex;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}

/* Typography floor: lift the two smallest tiers across the app without inflating headings. */
body.md3 :where(.sidebar-context small,.sidebar-help-card span,.portal-compact span,.top-user-copy span,.kpi-caption,.exact-kpis .kpi-caption,.panel-heading>div>span,.text-link,.donut span,.selector-copy small,.profile-details div,.workspace-eyebrow,.admin-eyebrow){
  font-size:max(11px,.72rem)!important;
  line-height:1.35!important;
}
body.md3 :where(.sidebar-help-card strong,.sidebar-context b,.portal-compact strong,.top-user-copy strong,.exact-kpis .kpi-hindi,.progress-copy span,.mini-section-heading strong,.activity-row small,.activity-row span,.attention-copy span,.quick-actions small){
  font-size:max(12px,.78rem)!important;
  line-height:1.4!important;
}
body.md3 .panel-heading h3{font-size:15px!important}
body.md3 .panel-heading>div>span{font-size:11.5px!important}
body.md3 .text-link{font-size:11.5px!important}
body.md3 .progress-copy strong{font-size:14px!important}
body.md3 .progress-copy span{font-size:12px!important}
body.md3 .activity-row strong,
body.md3 .attention-copy strong,
body.md3 .quick-actions b{font-size:13px!important}

/* Hamburger navigation is now a true left drawer at every viewport size. */
body.md3 .mobile-sidebar-toggle{
  display:inline-flex!important;
  flex:0 0 40px;
  border-radius:9px!important;
}
body.md3 .dashboard-shell{
  display:block!important;
  grid-template-columns:1fr!important;
}
body.md3 .dashboard-workspace{
  width:100%!important;
  min-width:0!important;
}
body.md3 .dashboard-sidebar,
body.md3 .exact-sidebar,
body.md3 .admin-dashboard .dashboard-sidebar{
  display:flex!important;
  position:fixed!important;
  left:0!important;
  top:68px!important;
  bottom:0!important;
  width:min(86vw,300px)!important;
  min-width:0!important;
  height:auto!important;
  max-height:none!important;
  z-index:160!important;
  transform:translateX(-105%)!important;
  transition:transform .22s ease!important;
  box-shadow:0 12px 32px rgba(18,12,28,.22)!important;
  overflow-y:auto!important;
  border-right:1px solid rgba(0,0,0,.12)!important;
}
body.md3.mobile-sidebar-open .dashboard-sidebar,
body.md3.mobile-sidebar-open .exact-sidebar,
body.md3.mobile-sidebar-open .admin-dashboard .dashboard-sidebar{
  transform:translateX(0)!important;
}
body.md3 .mobile-sidebar-scrim{
  position:fixed!important;
  inset:68px 0 0!important;
  background:rgba(20,17,25,.38)!important;
  z-index:150!important;
}
body.md3.mobile-sidebar-open .mobile-sidebar-scrim{display:block!important}
body.md3 .sidebar-nav{overflow-y:auto!important;overscroll-behavior:contain}
@media(max-width:760px){
  body.md3 .dashboard-sidebar,
  body.md3 .exact-sidebar,
  body.md3 .admin-dashboard .dashboard-sidebar{top:64px!important;}
  body.md3 .mobile-sidebar-scrim{inset:64px 0 0!important;}
}

/* Consistent row-number column across report tables. */
body.md3 .data-table th:first-child:has(+ th),
body.md3 .table-row-number{
  text-align:center!important;
}
body.md3 .table-row-number{
  color:var(--text-muted)!important;
  font-variant-numeric:tabular-nums;
  width:60px;
  white-space:nowrap;
}

/* Registered Cards: counts represent card types; scheme badges are intentionally removed. */
body.md3 .registered-filter-row{gap:8px!important;align-items:center!important;flex-wrap:wrap!important}
body.md3 .registered-filter-row .filter-chip{min-height:36px!important;padding:0 10px 0 12px!important;gap:8px!important}
body.md3 .registered-filter-row .type-count{
  min-width:24px!important;
  height:22px!important;
  padding:0 6px!important;
  border-radius:11px!important;
  display:inline-grid!important;
  place-items:center!important;
  background:rgba(98,0,238,.09)!important;
  color:#4f2995!important;
  font-size:11px!important;
  font-weight:800!important;
}
body.md3 .registered-filter-row .filter-chip.active .type-count{
  background:rgba(255,255,255,.22)!important;
  color:inherit!important;
}

/* Overview readability and app-wide small-text floor requested in R12. */
body.md3 small{font-size:11.5px!important;line-height:1.4!important}
body.md3 .mini-section-heading span,
body.md3 .commodity-bar-values,
body.md3 .empty-mini,
body.md3 .activity-empty,
body.md3 .activity-row strong,
body.md3 .activity-row span,
body.md3 .activity-row small,
body.md3 .activity-row time,
body.md3 .attention-row strong,
body.md3 .attention-row small,
body.md3 .quick-action-grid b,
body.md3 .quick-action-grid small{
  font-size:12px!important;
  line-height:1.4!important;
}
body.md3 .activity-row strong,
body.md3 .attention-row strong,
body.md3 .quick-action-grid b{font-size:12.5px!important}
body.md3 .commodity-bar-values{font-size:11.5px!important}

/* R12 typography floor for dense reports, drawers and assistant surfaces. */
body.md3 .data-table th{font-size:12px!important;line-height:1.35!important}
body.md3 .data-table td{font-size:12.5px!important;line-height:1.4!important}
body.md3 .exact-registered .data-table thead th{font-size:12px!important}
body.md3 .exact-registered .data-table tbody td,
body.md3 .exact-registered .data-table td strong{font-size:12.5px!important}
body.md3 .filter-chip{font-size:12px!important}
body.md3 .table-status,
body.md3 .scheme-pill,
body.md3 .drawer-status{font-size:11.5px!important}
body.md3 :where(.drawer-label,.drawer-block small,.drawer-section-title,.drawer-member-list li,.drawer-member-list li>strong,.drawer-contact-row strong,.side-card-title p,.context-grid small,.context-grid strong,.bot-tool-list b,.bot-tool-list small,.pro-tip p){font-size:11.5px!important;line-height:1.4!important}
body.md3 .exact-chat .msg-text{font-size:13px!important}
body.md3 .exact-chat .msg-time,
body.md3 .chat-bot-sub,
body.md3 .chat-day-label,
body.md3 .chat-suggestions .cmd-chip,
body.md3 .chat-footnote{font-size:11.5px!important}
body.md3 .chat-bot-title,
body.md3 .pro-tip h3{font-size:12.5px!important}
body.md3 .exact-registered .pagination-bar,
body.md3 .page-btn{font-size:11.5px!important}

/* ===== R13 Logo-free application branding ===== */
/* Keep the product name as the sole app identity. Use a plain sans-serif face. */
body.md3 .nav-title,
body.md3 .exact-topbar .nav-title,
body.md3 .first-run-brand .nav-title,
body.md3 .footer-app-title,
body.md3 .chat-bot-title {
  font-family: Roboto, Arial, Helvetica, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
body.md3 .nav-title,
body.md3 .exact-topbar .nav-title,
body.md3 .first-run-brand .nav-title {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Top app bar: no logo, stronger product title. */
body.md3 .exact-topbar .nav-brand {
  gap: 10px !important;
}
body.md3 .exact-topbar .nav-title {
  font-size: 24px !important;
  line-height: 1.12 !important;
  color: #fff !important;
}
body.md3 .exact-topbar .nav-subtitle {
  margin-top: 2px !important;
}

/* Login / first-run branding: text only. */
body.md3 .first-run-brand {
  gap: 0 !important;
  margin-bottom: 8px !important;
}
body.md3 .first-run-brand .nav-title {
  font-size: 1.42rem !important;
  line-height: 1.15 !important;
  color: #2f2933 !important;
}
body.md3 .first-run-brand small {
  margin-top: 4px !important;
}

/* Footer branding: text only and clearly visible. */
body.md3 .footer-brand {
  gap: 0 !important;
}
body.md3 .footer-brand .footer-app-title {
  font-size: 15.5px !important;
  line-height: 1.2 !important;
  color: var(--r2-text) !important;
}
body.md3 .chat-bot-title {
  font-size: 13.5px !important;
}

/* Legacy logo containers are intentionally suppressed if old cached markup appears. */
body.md3 .logo-badge,
body.md3 .brand-mark,
body.md3 .login-mark,
body.md3 .footer-brand-mark {
  display: none !important;
}

@media (max-width: 760px) {
  body.md3 .exact-topbar .nav-title {
    font-size: 21px !important;
  }
  body.md3 .first-run-brand .nav-title {
    font-size: 1.32rem !important;
  }
}


/* ===== R14 desktop header + live transaction refresh polish ===== */
/* Desktop: restore the persistent left navigation; drawer remains mobile-only. */
@media (min-width: 901px) {
  body.md3 .mobile-sidebar-toggle { display:none!important; }
  body.md3 .dashboard-shell {
    display:grid!important;
    grid-template-columns:252px minmax(0,1fr)!important;
    gap:18px!important;
  }
  body.md3 .dashboard-sidebar,
  body.md3 .exact-sidebar,
  body.md3 .admin-dashboard .dashboard-sidebar {
    position:sticky!important;
    left:auto!important;
    top:86px!important;
    bottom:auto!important;
    width:252px!important;
    min-width:252px!important;
    height:calc(100vh - 104px)!important;
    max-height:calc(100vh - 104px)!important;
    transform:none!important;
    z-index:20!important;
    box-shadow:none!important;
    overflow-y:auto!important;
    border-right:1px solid var(--r2-divider)!important;
  }
  body.md3 .mobile-sidebar-scrim { display:none!important; }
}
@media (min-width:901px) and (max-width:1180px) {
  body.md3 .dashboard-shell { grid-template-columns:230px minmax(0,1fr)!important; }
  body.md3 .dashboard-sidebar,
  body.md3 .exact-sidebar,
  body.md3 .admin-dashboard .dashboard-sidebar { width:230px!important; min-width:230px!important; }
}

/* Universal search: roomy, optically even spacing around every item. */
body.md3 .exact-topbar .nav-container {
  grid-template-columns:330px minmax(520px,1fr) auto!important;
  gap:20px!important;
}
body.md3 .m2-global-search {
  max-width:900px!important;
  height:48px!important;
  padding:0 16px!important;
  gap:12px!important;
  border-radius:7px!important;
  align-items:center!important;
}
body.md3 .m2-global-search > .material-symbols-rounded {
  flex:0 0 auto!important;
  margin:0!important;
}
body.md3 .m2-global-search input {
  min-width:0!important;
  padding:0!important;
  margin:0!important;
  line-height:24px!important;
}
body.md3 .global-search-scope,
body.md3 .m2-global-search kbd {
  flex:0 0 auto!important;
  margin:0!important;
}
body.md3 .global-search-scope {
  min-height:30px!important;
  padding:0 11px!important;
  display:inline-flex!important;
  align-items:center!important;
}
body.md3 .m2-global-search kbd {
  min-height:30px!important;
  padding:0 9px!important;
  display:inline-flex!important;
  align-items:center!important;
}
@media (max-width:1280px) and (min-width:1001px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:280px minmax(420px,1fr) auto!important; gap:14px!important; }
}
@media (max-width:1000px) and (min-width:761px) {
  body.md3 .exact-topbar .nav-container { grid-template-columns:240px minmax(320px,1fr) auto!important; gap:12px!important; }
  body.md3 .m2-global-search { padding:0 13px!important; gap:10px!important; }
}
@media (max-width:760px) {
  body.md3 .m2-global-search { height:44px!important; padding:0 13px!important; gap:10px!important; }
}

/* ===== R15 balanced desktop app-bar geometry ===== */
/* Keep the purple bar and its content on one shared height so controls never
   overflow below the bar. This intentionally overrides the earlier R12/R14
   min-height + padding combination. */
@media (min-width: 761px) {
  body.md3 .exact-topbar.m2-topbar {
    height: 80px !important;
    min-height: 80px !important;
  }

  body.md3 .exact-topbar .nav-container {
    height: 80px !important;
    min-height: 80px !important;
    box-sizing: border-box !important;
    padding: 10px 20px !important;
    grid-template-columns: 360px minmax(560px, 1fr) auto !important;
    gap: 18px !important;
    align-items: center !important;
  }

  body.md3 .exact-topbar .nav-brand,
  body.md3 .exact-topbar .nav-actions,
  body.md3 .m2-global-search {
    align-self: center !important;
  }

  body.md3 .m2-global-search {
    width: 100% !important;
    max-width: none !important;
    height: 52px !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
    padding: 0 15px !important;
    gap: 12px !important;
  }

  body.md3 .exact-topbar .nav-actions {
    height: 52px !important;
    min-height: 52px !important;
    gap: 10px !important;
  }

  body.md3 .portal-compact,
  body.md3 .notification-button,
  body.md3 .top-user,
  body.md3 .top-auth {
    height: 52px !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center !important;
  }

  body.md3 .portal-compact {
    padding: 7px 12px !important;
    margin-right: 0 !important;
  }

  body.md3 .notification-button {
    padding: 0 13px !important;
  }

  body.md3 .top-user {
    padding: 6px 9px !important;
    margin-left: 0 !important;
  }

  body.md3 .global-search-scope,
  body.md3 .m2-global-search kbd {
    min-height: 32px !important;
  }
}

@media (min-width: 1181px) and (max-width: 1450px) {
  body.md3 .exact-topbar .nav-container {
    grid-template-columns: 300px minmax(500px, 1fr) auto !important;
    gap: 14px !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body.md3 .exact-topbar .nav-container {
    grid-template-columns: 270px minmax(390px, 1fr) auto !important;
    gap: 12px !important;
    padding-inline: 16px !important;
  }
  body.md3 .m2-global-search {
    gap: 9px !important;
    padding-inline: 12px !important;
  }
}

/* Mobile keeps the existing compact hamburger/drawer layout. */
@media (max-width: 760px) {
  body.md3 .exact-topbar.m2-topbar,
  body.md3 .exact-topbar .nav-container {
    height: 64px !important;
    min-height: 64px !important;
    box-sizing: border-box !important;
  }
  body.md3 .exact-topbar .nav-container {
    padding: 8px 10px !important;
  }
}

/* R15 close controls — quiet by default, destructive cue on hover/focus. */
body.md3 :where(
  .profile-drawer-close,
  .settings-dialog-close,
  #notificationClose,
  #registeredCardModalClose,
  #registeredCardTransactionsClose,
  #onboardingCloseBtn
){
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px!important;
  padding:0!important;
  border-radius:50%!important;
  border:1px solid rgba(60,64,67,.22)!important;
  background:transparent!important;
  color:#4b5563!important;
  box-shadow:none!important;
  display:inline-grid!important;
  place-items:center!important;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease!important;
}
body.md3 :where(
  .profile-drawer-close,
  .settings-dialog-close,
  #notificationClose,
  #registeredCardModalClose,
  #registeredCardTransactionsClose,
  #onboardingCloseBtn
) .material-symbols-rounded{
  color:currentColor!important;
  font-size:26px!important;
  font-weight:400!important;
}

/* Close controls that sit on purple/dark surfaces. */
body.md3 :where(
  .onboarding-header #onboardingCloseBtn,
  .profile-drawer-hero .profile-drawer-close,
  .detail-modal-header #registeredCardModalClose,
  .detail-modal-header #registeredCardTransactionsClose
){
  color:#fff!important;
  border-color:rgba(255,255,255,.40)!important;
  background:rgba(255,255,255,.03)!important;
}

/* Soft destructive affordance only when the user interacts with Close. */
body.md3 :where(
  .profile-drawer-close,
  .settings-dialog-close,
  #notificationClose,
  #registeredCardModalClose,
  #registeredCardTransactionsClose,
  #onboardingCloseBtn
):is(:hover,:focus-visible){
  background:rgba(220,38,38,.12)!important;
  border-color:rgba(220,38,38,.68)!important;
  color:#dc2626!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(220,38,38,.10)!important;
}
body.md3 :where(
  .onboarding-header #onboardingCloseBtn,
  .profile-drawer-hero .profile-drawer-close,
  .detail-modal-header #registeredCardModalClose,
  .detail-modal-header #registeredCardTransactionsClose
):is(:hover,:focus-visible){
  background:rgba(220,38,38,.34)!important;
  border-color:rgba(255,132,132,.90)!important;
  color:#fff!important;
  box-shadow:0 0 0 3px rgba(255,255,255,.10)!important;
}

/* R14.1 transaction header refinement: compact identity-first layout */
body.md3 #registeredCardTransactionsModal .detail-modal-header{
  min-height:0!important;
  padding:16px 18px!important;
  align-items:flex-start!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-header>div:first-child{
  display:flex!important;
  flex-direction:column!important;
  gap:5px!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-eyebrow{
  color:rgba(255,255,255,.82)!important;
  font-size:10px!important;
  font-weight:800!important;
  letter-spacing:.08em!important;
  line-height:1.3!important;
}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity{
  display:flex!important;
  align-items:flex-start!important;
  min-width:0!important;
}
body.md3 #registeredCardTransactionsModal .card-detail-heading-main{
  display:flex!important;
  flex-direction:column!important;
  gap:5px!important;
  min-width:0!important;
}
body.md3 #registeredCardTransactionsModal .registered-card-modal-identity h2{
  margin:0!important;
  color:#fff!important;
  font-size:21px!important;
  line-height:1.2!important;
  font-weight:750!important;
}
body.md3 #registeredCardTransactionsModal .txn-header-meta{
  display:flex!important;
  align-items:center!important;
  gap:8px 16px!important;
  flex-wrap:wrap!important;
  color:rgba(255,255,255,.86)!important;
  font-size:12px!important;
}
body.md3 #registeredCardTransactionsModal .txn-header-meta span{
  color:rgba(255,255,255,.86)!important;
}
body.md3 #registeredCardTransactionsModal .txn-header-meta strong{
  color:#fff!important;
  font-weight:700!important;
}
body.md3 #registeredCardTransactionsModal .txn-header-card-type{
  display:flex!important;
  align-items:center!important;
  margin-top:2px!important;
}
body.md3 #registeredCardTransactionsModal .detail-card-type{
  display:inline-flex!important;
  align-items:center!important;
  min-height:28px!important;
  padding:4px 10px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.13)!important;
  border:1px solid rgba(255,255,255,.28)!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:700!important;
  white-space:nowrap!important;
}
body.md3 #registeredCardTransactionsModal .detail-modal-header-actions{
  align-self:center!important;
  margin-left:14px!important;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
}
body.md3 #registeredCardTransactionsModal #registeredCardTxnStatusBadge>*{
  min-height:30px!important;
  padding:5px 11px!important;
  border-radius:999px!important;
  white-space:nowrap!important;
  font-size:12px!important;
  font-weight:800!important;
  letter-spacing:.01em!important;
}
@media(max-width:760px){
  body.md3 #registeredCardTransactionsModal .detail-modal-header{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:10px!important;
    align-items:start!important;
    padding:14px!important;
  }
  body.md3 #registeredCardTransactionsModal .detail-modal-header-actions{
    width:auto!important;
    margin-left:0!important;
    justify-content:flex-end!important;
    align-self:start!important;
  }
  body.md3 #registeredCardTransactionsModal #registeredCardTxnStatusBadge{
    position:absolute!important;
    left:14px!important;
    bottom:12px!important;
  }
  body.md3 #registeredCardTransactionsModal .detail-modal-header{
    position:relative!important;
    padding-bottom:52px!important;
  }
  body.md3 #registeredCardTransactionsModal .registered-card-modal-identity h2{font-size:19px!important}
  body.md3 #registeredCardTransactionsModal .txn-header-meta{font-size:11px!important;gap:4px 10px!important}
}

/* R15 Stock Ledger — official stock + received + live ePOS reconciliation */
.stock-ledger-heading .report-head-actions{
  align-items:center;
  gap:10px;
}
.stock-refresh-btn{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 14px;
  border:1px solid rgba(98,0,238,.2);
  border-radius:10px;
  background:var(--bg-card,#fff);
  color:#4f18a8;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.stock-refresh-btn:hover:not(:disabled){
  background:rgba(98,0,238,.06);
  border-color:rgba(98,0,238,.38);
  box-shadow:0 4px 14px rgba(55,0,179,.08);
}
.stock-refresh-btn:active:not(:disabled){transform:translateY(1px)}
.stock-refresh-btn:disabled{opacity:.65;cursor:wait}
.stock-refresh-btn.is-loading .material-symbols-rounded{animation:stockSpin .8s linear infinite}
@keyframes stockSpin{to{transform:rotate(360deg)}}

.stock-source-strip{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0 0 18px;
}
.stock-source-item{
  min-height:62px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:11px 14px;
  border:1px solid var(--border-color,rgba(17,24,39,.12));
  border-radius:12px;
  background:var(--bg-card,#fff);
}
.stock-source-item .stock-source-dot{
  width:9px;height:9px;border-radius:50%;flex:0 0 9px;
  background:#a1a1aa;
  box-shadow:0 0 0 4px rgba(161,161,170,.12);
}
.stock-source-item>div{min-width:0;display:flex;flex-direction:column;gap:2px}
.stock-source-item strong{font-size:.9rem;line-height:1.2;color:var(--text-primary,#111827)}
.stock-source-item small{font-size:.75rem;line-height:1.25;color:var(--text-muted,#6b7280);white-space:normal}
.stock-source-item.is-loading .stock-source-dot{background:#7c3aed;box-shadow:0 0 0 4px rgba(124,58,237,.12);animation:stockPulse 1.2s ease-in-out infinite}
.stock-source-item.is-ok .stock-source-dot,.stock-source-item.source-live .stock-source-dot{background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.12)}
.stock-source-item.is-warn .stock-source-dot{background:#d97706;box-shadow:0 0 0 4px rgba(217,119,6,.12)}
@keyframes stockPulse{50%{opacity:.45;transform:scale(.85)}}

.ledger-cards-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.stock-ledger-placeholder,.stock-ledger-empty{
  grid-column:1/-1;
  min-height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border:1px dashed var(--border-color,rgba(17,24,39,.16));
  border-radius:14px;
  background:var(--bg-card,#fff);
  color:var(--text-muted,#6b7280);
}
.stock-ledger-empty{flex-direction:column;text-align:center;padding:28px}
.stock-ledger-empty>.material-symbols-rounded{font-size:32px;color:#6d28d9}
.stock-ledger-empty strong{color:var(--text-primary,#111827);font-size:1rem}

.stock-commodity-card{
  padding:16px;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
}
.stock-card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.stock-card-title{display:flex;align-items:center;gap:10px;min-width:0}
.stock-commodity-icon{
  width:38px;height:38px;border-radius:10px;
  display:grid;place-items:center;
  background:rgba(98,0,238,.08);
  color:#6200ee;
  flex:0 0 38px;
}
.stock-card-title>div{display:flex;flex-direction:column;min-width:0}
.stock-card-title strong{font-size:1.03rem;line-height:1.2;color:var(--text-primary,#111827)}
.stock-card-title small{font-size:.72rem;color:var(--text-muted,#6b7280);margin-top:2px}
.stock-status-chip{
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  min-height:27px;padding:4px 8px;border-radius:999px;
  font-size:.72rem;font-weight:750;white-space:nowrap;border:1px solid transparent;
}
.stock-status-chip .material-symbols-rounded{font-size:15px}
.stock-status-chip.matched{color:#166534;background:#f0fdf4;border-color:#bbf7d0}
.stock-status-chip.mismatch{color:#b42318;background:#fff1f0;border-color:#fecaca}
.stock-status-chip.live{color:#075985;background:#f0f9ff;border-color:#bae6fd}
.stock-status-chip.partial{color:#854d0e;background:#fffbeb;border-color:#fde68a}

.stock-flow{
  display:grid;
  grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr);
  align-items:stretch;
  gap:4px;
}
.stock-flow-step{
  min-width:0;
  min-height:82px;
  padding:10px 8px;
  border:1px solid rgba(17,24,39,.08);
  border-radius:10px;
  background:rgba(248,250,252,.76);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  font:inherit;
  color:inherit;
}
button.stock-flow-step{cursor:pointer}
.stock-flow-step.is-action:hover{border-color:rgba(98,0,238,.26);background:rgba(98,0,238,.045)}
.stock-flow-step>span{font-size:.7rem;color:var(--text-muted,#6b7280);font-weight:650}
.stock-flow-step>strong{font-size:.94rem;color:var(--text-primary,#111827);line-height:1.2;margin:4px 0;font-variant-numeric:tabular-nums}
.stock-flow-step>small{font-size:.66rem;color:var(--text-muted,#6b7280)}
.stock-flow-step.received strong{color:#5b21b6}
.stock-flow-step.distributed strong{color:#047857}
.stock-flow-step.balance{background:rgba(98,0,238,.055);border-color:rgba(98,0,238,.14)}
.stock-flow-step.balance strong{color:#4c1d95}
.stock-flow-operator{display:grid;place-items:center;font-size:1.05rem;font-weight:800;color:#9ca3af}
.stock-flow-operator.equals{color:#6d28d9}
.stock-card-footer{
  min-height:26px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-top:2px;
  font-size:.76rem;
  color:var(--text-muted,#6b7280);
}
.stock-card-footer b{color:var(--text-secondary,#374151)}
.stock-difference.ok{color:#15803d}
.stock-difference.alert{color:#b42318;font-weight:700}
.stock-source-note{color:#a16207}
.stock-allocation-note{
  display:flex;align-items:flex-start;gap:6px;
  margin-top:-4px;padding:8px 10px;border-radius:9px;
  background:#fffbeb;border:1px solid #fde68a;color:#854d0e;
  font-size:.72rem;line-height:1.35;
}
.stock-allocation-note .material-symbols-rounded{font-size:16px;flex:0 0 auto}

.stock-reconciliation-panel,.stock-received-panel{overflow:hidden}
.stock-table-heading{
  min-height:66px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:12px 16px;
  border-bottom:1px solid var(--border-color,rgba(17,24,39,.1));
}
.stock-table-heading h3{margin:0;font-size:1rem;color:var(--text-primary,#111827)}
.stock-table-heading p{margin:3px 0 0;font-size:.76rem;color:var(--text-muted,#6b7280)}
.stock-live-badge,.received-entry-count{
  display:inline-flex;align-items:center;gap:6px;
  padding:5px 9px;border-radius:999px;
  background:#f0fdf4;border:1px solid #bbf7d0;color:#166534;
  font-size:.72rem;font-weight:750;white-space:nowrap;
}
.stock-live-dot{width:7px;height:7px;border-radius:50%;background:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.12);animation:stockPulse 1.5s ease-in-out infinite}
.received-entry-count{background:rgba(98,0,238,.06);border-color:rgba(98,0,238,.15);color:#5b21b6}
.stock-commodity-name{display:flex;align-items:center;gap:7px;white-space:nowrap}
.stock-commodity-name .material-symbols-rounded{font-size:19px;color:#6d28d9}
.stock-number-cell{font-weight:650;font-variant-numeric:tabular-nums;white-space:nowrap}
.stock-live-number{color:#047857}
.stock-balance-number{color:#4c1d95;font-weight:800}
.stock-mismatch-number{color:#b42318!important;background:rgba(254,226,226,.45)}
.received-status-chip{display:inline-flex;padding:4px 8px;border-radius:999px;background:#f0fdf4;color:#166534;font-size:.72rem;font-weight:700}

@media(max-width:1180px){
  .ledger-cards-grid{grid-template-columns:1fr}
  .stock-flow{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr) 18px minmax(0,1fr) 18px minmax(0,1fr)}
}
@media(max-width:760px){
  .stock-ledger-heading .report-head-actions{width:100%;justify-content:flex-start}
  .stock-source-strip{grid-template-columns:1fr}
  .stock-source-item{min-height:56px}
  .stock-flow{grid-template-columns:1fr 1fr;gap:8px}
  .stock-flow-operator{display:none}
  .stock-flow-step{min-height:76px}
  .stock-card-footer{align-items:flex-start;flex-direction:column;gap:5px}
  .stock-table-heading{align-items:flex-start;flex-direction:column;gap:8px}
  .stock-live-badge,.received-entry-count{align-self:flex-start}
}

/* ===== R16 report-banner + onboarding/header fixes ===== */
/* The base .navbar still carries vertical padding. Reset it here so the fixed
   app-bar height is the real visual height and every control is centered with
   equal space above and below. */
body.md3 .exact-topbar.m2-topbar {
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.md3 .exact-topbar.m2-topbar .nav-container {
  box-sizing: border-box !important;
  align-items: center !important;
}
body.md3 .exact-topbar.m2-topbar :where(.nav-brand,.m2-global-search,.nav-actions,.portal-compact,.notification-button,.top-user,.top-auth) {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  align-self: center !important;
}

/* Registered Cards must use the same report canvas width as every other report. */
body.md3 #tabRegisteredDetails.exact-registered {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.md3 #tabRegisteredDetails .registered-table-card {
  width: 100% !important;
  max-width: none !important;
}

/* Read-only reporting-period chip. Period selection remains on Overview only. */
body.md3 .report-period-pill {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(98,0,238,.18);
  border-radius: 16px;
  background: #f7f4fd;
  color: #4f2995;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
body.md3 .report-period-pill .material-symbols-rounded {
  font-size: 17px !important;
  color: #6200ee !important;
}

/* Completed summary chips now live inside the title banner. */
body.md3 .report-head-actions .report-stat-strip {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  flex-wrap: wrap !important;
}
body.md3 .workspace-heading .stat-pill,
body.md3 .workspace-heading .report-summary-pill {
  min-height: 32px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Onboarding close: override the older ID rule that made the button white on
   the purple banner, which also made the white close glyph disappear. */
body.md3 .onboarding-header #onboardingCloseBtn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,.48) !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  display: inline-grid !important;
  place-items: center !important;
  box-shadow: none !important;
  flex: 0 0 auto !important;
}
body.md3 .onboarding-header #onboardingCloseBtn .onboarding-close-glyph {
  display: block;
  color: currentColor;
  font: 400 28px/1 Arial, sans-serif;
  transform: translateY(-1px);
}
body.md3 .onboarding-header #onboardingCloseBtn:is(:hover,:focus-visible) {
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.72) !important;
  color: #fff !important;
  outline: 2px solid rgba(255,255,255,.32) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  body.md3 .report-head-actions,
  body.md3 .registered-head-actions {
    align-items: center !important;
    gap: 8px !important;
  }
  body.md3 .report-head-actions .report-stat-strip {
    width: auto !important;
  }
}

/* R17: keep Registered Cards type counts inside the report title banner. */
body.md3 .registered-head-main{
  flex:1 1 620px!important;
  min-width:0!important;
}
body.md3 .registered-title-counts{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:6px!important;
  margin:10px 0 0!important;
}
body.md3 #tabRegisteredDetails .registered-title-counts .filter-chip{
  min-width:0!important;
  min-height:30px!important;
  height:30px!important;
  padding:4px 8px 4px 10px!important;
  gap:6px!important;
  border-radius:15px!important;
  font-size:11px!important;
  line-height:1!important;
}
body.md3 #tabRegisteredDetails .registered-title-counts .filter-chip .type-count{
  min-width:21px!important;
  height:20px!important;
  padding:0 6px!important;
  border-radius:10px!important;
  font-size:10px!important;
}

/* Card profile, entitlement state, and motion accessibility */
.card-profile-header-chips{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}
.profile-chip,.member-count-badge{display:inline-flex;align-items:center;min-height:24px;padding:3px 9px;border-radius:999px;background:#e9f0ff;color:#2854a1;font-size:11px;font-weight:750;line-height:1.2}
.profile-chip.scheme{background:#eee8f8;color:#68459a}
.member-count-badge{background:#e3f4e9;color:#16794b;margin-top:8px}
.member-count-badge.inline{margin:0 0 0 6px;min-height:20px;padding:2px 7px;font-size:10px}
.profile-fps-name{display:block;margin-top:4px;color:rgba(255,255,255,.9);font-size:12px}
.boolean-value{font-size:14px!important;font-weight:650!important}
.entitlement-status{display:inline-flex;margin-top:4px;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:750;white-space:nowrap}
.entitlement-status.completed{background:#dff4e8;color:#168653}
.entitlement-status.pending{background:#fff0d8;color:#a75d00}
.entitlement-status.unknown{background:#edf0f4;color:#5f6978}
.filter-chip.entitlement-filter:not(.active){border-color:#e7be72}
.onboarding-readiness{display:flex;align-items:flex-start;gap:10px;margin-top:14px;padding:12px 14px;border:1px solid #dfe4ec;border-radius:12px;background:#f7f9fc;color:#5f6978}
.onboarding-readiness>div{display:flex;flex-direction:column;gap:3px}
.onboarding-readiness small{font-size:12px;line-height:1.4}
.onboarding-readiness.checking{border-color:#b9ccef;background:#f1f6ff;color:#2854a1}
.onboarding-readiness.ready{border-color:#a8ddbe;background:#edf9f2;color:#16794b}
.onboarding-readiness.blocked{border-color:#efc6c2;background:#fff3f2;color:#a33a32}
.onboarding-actions .primary-btn:disabled{cursor:not-allowed;opacity:.55}

@media (prefers-reduced-motion: reduce){
  .activity-row{animation:none!important;transition:none!important}
}
body.md3 .registered-head-actions{
  flex:0 1 auto!important;
}

/* R17: selected location remains visible while the FPS identity request runs. */
body.md3 .onboarding-shop-card{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:0!important;
  padding:0!important;
  overflow:hidden!important;
}
body.md3 .onboarding-shop-card>div{
  min-width:0!important;
  padding:12px 14px!important;
  border-bottom:1px solid #eee8f2!important;
}
body.md3 .onboarding-shop-card>div:nth-child(odd){border-right:1px solid #eee8f2!important}
body.md3 .onboarding-shop-card>div:nth-child(3){grid-column:1/-1!important;border-right:0!important}
body.md3 .onboarding-shop-card>div:nth-child(5){border-bottom:0!important}
body.md3 .onboarding-shop-card>div:nth-child(4){border-bottom:0!important}
body.md3 .onboarding-shop-card strong{
  display:block!important;
  margin-top:4px!important;
  overflow-wrap:anywhere!important;
  line-height:1.3!important;
}

@media (max-width: 1100px){
  body.md3 .registered-head-row{align-items:flex-start!important;flex-wrap:wrap!important}
  body.md3 .registered-head-actions{width:100%!important;justify-content:flex-start!important;margin-left:0!important}
}
@media (max-width: 560px){
  body.md3 .registered-title-counts{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:3px!important;scrollbar-width:thin}
  body.md3 .registered-title-counts .filter-chip{flex:0 0 auto!important}
  body.md3 .onboarding-shop-card{grid-template-columns:1fr!important}
  body.md3 .onboarding-shop-card>div{grid-column:1!important;border-right:0!important;border-bottom:1px solid #eee8f2!important}
  body.md3 .onboarding-shop-card>div:last-child{border-bottom:0!important}
}


/* R17: Recent Activity identity-first layout */
body.md3 .activity-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
body.md3 .activity-primary{display:flex;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}
body.md3 .activity-primary strong{font-size:13px!important;color:#1d2d47;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
body.md3 .activity-status-chip{display:inline-flex!important;align-items:center;min-height:21px;padding:2px 8px;border-radius:999px;font-size:10.5px!important;font-weight:700;line-height:1.2!important;white-space:nowrap;overflow:visible!important}
body.md3 .activity-status-chip.success{background:#dff4e8;color:#168653}
body.md3 .activity-status-chip.warning{background:#fff0d8;color:#bd6c08}
body.md3 .activity-row .activity-rc{font-size:10.5px!important;color:#7b8799;font-weight:600}

/* R18: keep the administrator sidebar independent from dealer/sidebar responsive rules. */
@media (min-width: 901px) {
  body.md3.admin-session #adminDashboard .admin-shell {
    display:grid!important;
    grid-template-columns:260px minmax(0,1fr)!important;
    align-items:start!important;
    gap:18px!important;
  }
  body.md3.admin-session #adminDashboard .dashboard-sidebar {
    position:sticky!important;
    top:86px!important;
    width:260px!important;
    min-width:260px!important;
    height:auto!important;
    max-height:calc(100vh - 104px)!important;
    padding:12px!important;
    display:flex!important;
    flex-direction:column!important;
    overflow-y:auto!important;
    transform:none!important;
    border:1px solid var(--r2-divider)!important;
    border-radius:10px!important;
    background:#fff!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile {
    display:block!important;
    padding:10px 8px 14px!important;
    border-bottom:1px solid var(--r2-divider)!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile .profile-avatar {
    display:grid!important;
    margin:0 0 10px!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile .profile-eyebrow,
  body.md3.admin-session #adminDashboard .admin-profile .profile-details {
    display:grid!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile h2 {
    display:block!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile .profile-details {
    grid-template-columns:1fr!important;
    gap:7px!important;
    margin:12px 0!important;
  }
  body.md3.admin-session #adminDashboard .admin-profile .profile-details div {
    display:flex!important;
    justify-content:space-between!important;
    gap:8px!important;
  }
  body.md3.admin-session #adminDashboard .sidebar-nav {
    display:flex!important;
    flex-direction:column!important;
    overflow:visible!important;
    margin:0!important;
    padding:12px 0 2px!important;
    gap:4px!important;
  }
  body.md3.admin-session #adminDashboard .sidebar-nav-label {
    display:block!important;
    padding:4px 10px 6px!important;
  }
  body.md3.admin-session #adminDashboard .sidebar-nav .tab-btn {
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    justify-content:flex-start!important;
    padding:0 11px!important;
  }
  body.md3.admin-session #adminDashboard .sidebar-nav .tab-btn > span:nth-child(2) {
    flex:1 1 auto!important;
    white-space:normal!important;
    text-align:left!important;
  }
  body.md3.admin-session #adminDashboard .tab-count-badge {
    display:inline-grid!important;
  }
}
