/* ============================================================
   Flipkart ASP Partner Portal – Stylesheet v3
   ============================================================ */

/* ── Light Theme (default) ── */
[data-theme="light"] {
  --primary: #2874F0;
  --primary-d: #1a5dc8;
  --primary-l: #4f8ef5;
  --primary-bg: rgba(40, 116, 240, 0.08);
  --orange: #FB641B;
  --green: #26A541;
  --green-l: #e8f5eb;
  --amber: #d97706;
  --amber-l: #fef3c7;
  --red: #c0392b;
  --red-l: #fdecea;
  --blue: #2874F0;
  --blue-l: #e8f0fe;
  --purple: #7c3aed;
  --teal: #0d9488;

  --bg: #f0f4ff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-l: #c8d6f0;

  --text: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-inv: #ffffff;

  --sidebar-bg: #ffffff;
  --header-bg: #ffffff;
  --chart-grid: rgba(203, 213, 225, 0.8);
  --chart-tick: #64748b;
  --tooltip-bg: #ffffff;
  --tooltip-border: #e2e8f0;

  /* Aliases kept for shared component compatibility */
  --indigo: #2874F0;
  --indigo-d: #1a5dc8;
  --indigo-l: #4f8ef5;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --primary: #4f8ef5;
  --primary-d: #2874F0;
  --primary-l: #93c5fd;
  --primary-bg: rgba(79, 142, 245, 0.12);
  --orange: #fb923c;
  --green: #10b981;
  --green-l: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-l: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-l: rgba(239, 68, 68, 0.15);
  --blue: #3b82f6;
  --blue-l: rgba(59, 130, 246, 0.15);
  --purple: #8b5cf6;
  --teal: #14b8a6;

  --bg: #0f1117;
  --bg-2: #161b27;
  --bg-3: #1e2535;
  --bg-card: #1a2033;
  --border: #2a3550;
  --border-l: #3a4d70;

  --text: #f1f5f9;
  --text-2: #b8c8d8;
  --text-3: #7a90a8;
  --text-inv: #0f1117;

  --sidebar-bg: #161b27;
  --header-bg: #161b27;
  --chart-grid: rgba(42, 53, 80, 0.6);
  --chart-tick: #7a90a8;
  --tooltip-bg: #1e2535;
  --tooltip-border: #2a3550;

  --indigo: #4f8ef5;
  --indigo-d: #2874F0;
  --indigo-l: #93c5fd;
}

/* ── Shared tokens ── */
:root {
  --sidebar-w: 256px;
  --sidebar-w-col: 64px;
  --header-h: 58px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(40, 116, 240, 0.06);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

select,
input,
textarea {
  font-family: inherit;
}

canvas {
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--border-l);
  border-radius: 4px;
}

*,
*::before,
*::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: width var(--transition), background var(--transition);
  box-shadow: 2px 0 12px rgba(40, 116, 240, 0.05);
}

.sidebar.collapsed {
  width: var(--sidebar-w-col);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
  gap: 8px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

/* Flipkart Logo Box */
.flipkart-logo-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f0c419, #FB641B);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(251, 100, 27, 0.35);
}

.flipkart-logo-box svg {
  width: 22px;
  height: 22px;
}

.logo-brand {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.logo-text {
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  color: var(--primary);
  line-height: 1;
}

.logo-portal {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.sidebar.collapsed .logo-brand,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .help-text,
.sidebar.collapsed .admin-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-toggle,
.header-toggle-btn {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 6px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
}

.sidebar-toggle svg,
.header-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-toggle:hover,
.header-toggle-btn:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 6px;
}

.nav-group {
  padding: 4px 0;
}

.nav-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 18px 4px;
  display: block;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: all 0.15s;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-text {
  flex: 1;
  line-height: 1.3;
}

.nav-badge {
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.nav-badge.urgent {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}

[data-theme="dark"] .nav-badge.urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 10px 10px 12px;
}

.help-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  margin-bottom: 8px;
  cursor: pointer;
  overflow: hidden;
}

.help-card:hover {
  background: rgba(40, 116, 240, 0.12);
}

.help-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}

.help-icon svg {
  width: 100%;
  height: 100%;
}

.help-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1px;
}

.help-text strong {
  font-size: 0.76rem;
  color: var(--text);
  font-weight: 700;
}

.help-text span {
  font-size: 0.68rem;
  color: var(--text-2);
}

.help-phone {
  font-size: 0.68rem;
  color: var(--primary) !important;
  font-weight: 500;
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
}

.admin-profile-card:hover {
  background: var(--bg-3);
}

.admin-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid rgba(40, 116, 240, 0.3);
}

.admin-info {
  flex: 1;
  overflow: hidden;
}

.admin-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  white-space: nowrap;
}

.admin-role {
  font-size: 0.68rem;
  color: var(--text-3);
  display: block;
}

.admin-menu-btn {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 4px;
  display: flex;
}

.admin-menu-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.main-wrapper.sidebar-collapsed {
  margin-left: var(--sidebar-w-col);
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(40, 116, 240, 0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.header-subtitle {
  font-size: 0.68rem;
  color: var(--text-3);
  display: block;
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-last-updated {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  padding: 0 8px;
}

.header-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-btn svg {
  width: 16px;
  height: 16px;
}

.header-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-bg);
}

.header-btn:active {
  transform: scale(0.95);
}

.notif-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #c0392b;
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 20px;
  border: 2px solid var(--header-bg);
  min-width: 16px;
  text-align: center;
}

/* Theme Toggle */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.theme-icon {
  display: flex;
  align-items: center;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
}

[data-theme="dark"] .light-icon,
[data-theme="dark"] .light-label {
  display: none;
}

[data-theme="dark"] .dark-icon,
[data-theme="dark"] .dark-label {
  display: flex;
}

[data-theme="light"] .dark-icon,
[data-theme="light"] .dark-label {
  display: none;
}

[data-theme="light"] .light-icon,
[data-theme="light"] .light-label {
  display: flex;
}

/* Download Button */
.header-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(40, 116, 240, 0.3);
}

.header-download-btn svg {
  width: 14px;
  height: 14px;
}

.header-download-btn:hover {
  background: var(--primary-d);
  transform: translateY(-1px);
}

.header-download-btn:active {
  transform: scale(0.97);
}

/* ============================================================
   PAGE CONTAINER & CONTENT
   ============================================================ */
.page-container {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dashboard-content {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(240, 244, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 500;
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .loading-overlay {
  background: rgba(15, 17, 23, 0.88);
}

.loading-overlay.hidden {
  display: none;
}

.loading-overlay p {
  color: var(--text-2);
  font-size: 0.88rem;
}

.spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filters-section {}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 28px;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(40, 116, 240, 0.1);
}

.filter-select option {
  background: var(--bg-3);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  gap: 12px;
}

.section-header-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* ============================================================
   ONBOARDING WORKFLOW STAGES
   ============================================================ */
.workflow-stages-wrap {
  padding: 18px 18px 8px;
  overflow-x: auto;
}

.workflow-steps {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
  padding-bottom: 4px;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 72px;
  max-width: 90px;
  position: relative;
}

.step-top {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.step-line-left,
.step-line-right {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.step-line-left.filled,
.step-line-right.filled {
  background: var(--primary);
}

.step-line-left.hidden,
.step-line-right.hidden {
  visibility: hidden;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: all 0.3s;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-3);
}

.workflow-step.completed .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.workflow-step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(40, 116, 240, 0.2);
}

.step-icon-row {
  margin-top: 8px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon-row svg {
  width: 15px;
  height: 15px;
}

.workflow-step.completed .step-icon-row,
.workflow-step.active .step-icon-row {
  color: var(--primary);
}

.step-label {
  font-size: 0.6rem;
  color: var(--text-3);
  text-align: center;
  margin-top: 5px;
  line-height: 1.3;
  max-width: 72px;
}

.workflow-step.completed .step-label,
.workflow-step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

/* Overall Progress */
.overall-progress-wrap {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.overall-progress-label {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

.overall-progress-bar-track {
  flex: 1;
  min-width: 200px;
  height: 8px;
  background: var(--bg-3);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.overall-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-l));
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-shrink: 0;
}

.legend-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-2);
}

.legend-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ============================================================
   THREE-PANEL ROW
   ============================================================ */
.three-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* Partner Summary */
.partner-summary-inner {
  padding: 14px 16px;
}

.partner-avatar-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.partner-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(40, 116, 240, 0.15) 100%);
  border: 2px solid var(--border-l);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

.partner-avatar-big svg {
  width: 26px;
  height: 26px;
}

.partner-name-block {}

.partner-name-big {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.partner-id-small {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 2px;
}

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

.partner-info-table tr td {
  padding: 5px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.partner-info-table tr:last-child td {
  border-bottom: none;
}

.partner-info-table .pi-label {
  color: var(--text-3);
  font-weight: 500;
  width: 44%;
  white-space: nowrap;
}

.partner-info-table .pi-value {
  color: var(--text);
  font-weight: 600;
  padding-left: 8px;
}

/* Document Checklist */
.doc-checklist-inner {
  padding: 14px 16px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.doc-table th {
  background: var(--bg-3);
  padding: 7px 10px;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.doc-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table tr:hover td {
  background: var(--bg-3);
}

.doc-progress-wrap {
  margin-top: 12px;
}

.doc-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  color: var(--text-2);
  margin-bottom: 5px;
  font-weight: 500;
}

.doc-progress-bar-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 10px;
  overflow: hidden;
}

.doc-progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--primary);
}

/* Approval Timeline */
.approval-timeline-inner {
  padding: 14px 16px;
}

.appr-timeline {
  display: flex;
  flex-direction: column;
}

.appr-item {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  position: relative;
}

.appr-item:last-child {
  padding-bottom: 0;
}

.appr-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.appr-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-card);
}

.appr-dot.done {
  background: var(--green);
  border-color: var(--green);
}

.appr-dot.pending {
  background: var(--bg-card);
  border-color: var(--border-l);
}

.appr-dot svg {
  width: 11px;
  height: 11px;
  color: white;
}

.appr-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
  min-height: 12px;
}

.appr-item:last-child .appr-line {
  display: none;
}

.appr-content {
  flex: 1;
  padding-top: 1px;
}

.appr-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
}

.appr-meta {
  font-size: 0.66rem;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.appr-actor {
  color: var(--primary);
  font-weight: 500;
}

/* ============================================================
   FOUR STATUS CARDS ROW
   ============================================================ */
.status-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.status-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.status-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-card-icon svg {
  width: 15px;
  height: 15px;
}

.status-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.status-card-body {
  padding: 12px 14px;
}

.status-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.status-pill.in-progress {
  background: var(--amber-l);
  color: var(--amber);
}

.status-pill.pending {
  background: var(--amber-l);
  color: var(--amber);
}

.status-pill.not-created {
  background: var(--red-l);
  color: var(--red);
}

.status-pill.completed {
  background: var(--green-l);
  color: var(--green);
}

.status-pill.verified {
  background: var(--blue-l);
  color: var(--primary);
}

[data-theme="dark"] .status-pill.in-progress {
  background: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .status-pill.pending {
  background: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .status-pill.not-created {
  background: rgba(192, 57, 43, 0.15);
}

[data-theme="dark"] .status-pill.completed {
  background: rgba(38, 165, 65, 0.15);
}

[data-theme="dark"] .status-pill.verified {
  background: rgba(40, 116, 240, 0.15);
}

.status-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
}

.status-info-row:last-of-type {
  border-bottom: none;
}

.si-label {
  color: var(--text-3);
}

.si-value {
  color: var(--text);
  font-weight: 600;
}

.si-value.red {
  color: var(--red);
}

.si-value.amber {
  color: var(--amber);
}

.si-value.green {
  color: var(--green);
}

.status-card-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.status-view-btn {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
  padding: 4px 0;
}

.status-view-btn:hover {
  text-decoration: underline;
}

.status-view-btn svg {
  width: 12px;
  height: 12px;
}

/* Recent Remarks Card */
.remarks-card-inner {
  padding: 12px 14px;
}

.remark-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.remark-item:last-of-type {
  margin-bottom: 0;
}

.remark-item:hover {
  border-color: var(--border-l);
}

.remark-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  flex-shrink: 0;
}

.remark-body {
  flex: 1;
}

.remark-text {
  font-size: 0.74rem;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 3px;
}

.remark-meta {
  font-size: 0.64rem;
  color: var(--text-3);
}

.view-all-remarks-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  background: var(--primary-bg);
  border: 1px solid var(--border-l);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
}

.view-all-remarks-btn:hover {
  background: rgba(40, 116, 240, 0.12);
}

/* ============================================================
   MASTER TABLE PAGES
   ============================================================ */
.master-table-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.master-page-header {}

.master-page-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.master-page-subtitle {
  font-size: 0.78rem;
  color: var(--text-3);
}

.master-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.table-search-inp {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
}

.table-search-inp:focus {
  border-color: var(--primary);
}

.table-search-inp::placeholder {
  color: var(--text-3);
}

.master-filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 28px 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  cursor: pointer;
}

.master-filter-select:focus {
  border-color: var(--primary);
}

.export-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.export-btn svg {
  width: 13px;
  height: 13px;
}

.export-btn:hover {
  background: var(--primary-d);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  background: var(--bg-3);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: var(--primary);
}

.sort-icon {
  margin-left: 3px;
  opacity: 0.5;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(40, 116, 240, 0.03);
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.active,
.status-badge.verified,
.status-badge.approved,
.status-badge.cleared,
.status-badge.activated {
  background: var(--green-l);
  color: var(--green);
}

.status-badge.active::before,
.status-badge.verified::before,
.status-badge.approved::before,
.status-badge.cleared::before,
.status-badge.activated::before {
  background: var(--green);
}

[data-theme="dark"] .status-badge.active,
[data-theme="dark"] .status-badge.verified,
[data-theme="dark"] .status-badge.approved,
[data-theme="dark"] .status-badge.cleared,
[data-theme="dark"] .status-badge.activated {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-badge.pending,
.status-badge.in-progress {
  background: var(--amber-l);
  color: var(--amber);
}

.status-badge.pending::before,
.status-badge.in-progress::before {
  background: var(--amber);
}

[data-theme="dark"] .status-badge.pending,
[data-theme="dark"] .status-badge.in-progress {
  background: rgba(217, 119, 6, 0.15);
  color: #f59e0b;
}

.status-badge.rejected,
.status-badge.failed,
.status-badge.not-created {
  background: var(--red-l);
  color: var(--red);
}

.status-badge.rejected::before,
.status-badge.failed::before,
.status-badge.not-created::before {
  background: var(--red);
}

[data-theme="dark"] .status-badge.rejected,
[data-theme="dark"] .status-badge.failed,
[data-theme="dark"] .status-badge.not-created {
  background: rgba(192, 57, 43, 0.15);
  color: #ef4444;
}

.status-badge.review {
  background: var(--blue-l);
  color: var(--primary);
}

.status-badge.review::before {
  background: var(--primary);
}

[data-theme="dark"] .status-badge.review {
  background: rgba(40, 116, 240, 0.15);
  color: #4f8ef5;
}

.check-icon {
  color: var(--green);
}

.cross-icon {
  color: var(--red);
}

.dash-icon {
  color: var(--text-3);
}

.action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
}

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

.action-btn.primary-action {
  background: var(--primary-bg);
  border-color: var(--border-l);
  color: var(--primary);
}

.action-btn.primary-action:hover {
  background: rgba(40, 116, 240, 0.15);
}

/* Table pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-btns {
  display: flex;
  gap: 3px;
}

.page-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn.active,
.page-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

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

/* User / partner cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ucell-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.8rem;
}

.ucell-sub {
  font-size: 0.68rem;
  color: var(--text-3);
}

/* Priority badges */
.priority-high {
  color: #c0392b;
  font-weight: 700;
  font-size: 0.72rem;
}

.priority-medium {
  color: var(--amber);
  font-weight: 700;
  font-size: 0.72rem;
}

.priority-low {
  color: var(--green);
  font-weight: 700;
  font-size: 0.72rem;
}

/* ============================================================
   KPI CARDS (shared from other pages kept for analytics/reports)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: fadeUp 0.4s ease both;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-l);
  box-shadow: 0 8px 24px rgba(40, 116, 240, 0.1);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kpi-color);
  background: color-mix(in srgb, var(--kpi-color) 12%, transparent);
}

.kpi-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.kpi-trend {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.kpi-trend.up {
  background: var(--green-l);
  color: var(--green);
}

.kpi-trend.down {
  background: var(--red-l);
  color: var(--red);
}

[data-theme="dark"] .kpi-trend.up {
  background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .kpi-trend.down {
  background: rgba(239, 68, 68, 0.15);
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-2);
  margin-bottom: 10px;
}

.kpi-sparkline {
  opacity: 0.8;
}

/* Charts */
.charts-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.charts-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  flex: 1;
  box-shadow: var(--shadow-card);
}

.chart-card.wide {
  flex: 2;
  min-width: 300px;
}

.chart-card.narrow {
  flex: 1;
  min-width: 220px;
}

.chart-card.medium {
  flex: 1;
  min-width: 260px;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.chart-subtitle {
  font-size: 0.7rem;
  color: var(--text-3);
}

.chart-wrap {
  position: relative;
  height: 200px;
}

.chart-wrap.h240 {
  height: 240px;
}

.chart-wrap.donut-wrap {
  height: 170px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-2);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
}

.legend-val {
  font-weight: 600;
  color: var(--text);
}

/* Reports */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.4s ease both;
  box-shadow: var(--shadow-card);
}

.report-card:hover {
  border-color: var(--border-l);
  transform: translateY(-2px);
}

.report-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.report-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.report-card-meta {
  font-size: 0.72rem;
  color: var(--text-3);
}

.report-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.report-size {
  font-size: 0.68rem;
  color: var(--text-3);
}

.download-btn {
  background: var(--primary-bg);
  border: 1px solid var(--border-l);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.download-btn svg {
  width: 12px;
  height: 12px;
}

.download-btn:hover {
  background: rgba(40, 116, 240, 0.15);
}

/* Settings */
.settings-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.settings-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.settings-section-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.settings-section-header p {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 2px;
}

.settings-section-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.settings-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
}

.settings-input:focus {
  border-color: var(--primary);
}

.settings-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.settings-row .settings-field {
  flex: 1;
  min-width: 180px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.toggle-desc {
  font-size: 0.72rem;
  color: var(--text-3);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all var(--transition);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-3);
  transition: all var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translate(18px, -50%);
  background: white;
}

.settings-save-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(40, 116, 240, 0.3);
}

.settings-save-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.theme-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-option {
  flex: 1;
  min-width: 130px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.theme-option:hover {
  border-color: var(--primary);
}

.theme-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.theme-preview {
  width: 100%;
  height: 52px;
  border-radius: 6px;
  display: flex;
  overflow: hidden;
}

.theme-preview-dark {
  background: linear-gradient(135deg, #0f1117 40%, #2874F0 100%);
}

.theme-preview-light {
  background: linear-gradient(135deg, #f8fafc 40%, #2874F0 100%);
}

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

.theme-option-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-option.selected .theme-option-check {
  background: var(--primary);
  border-color: var(--primary);
}

/* ============================================================
   PORTAL FOOTER
   ============================================================ */
.portal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-l);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.25s ease;
  pointer-events: all;
  min-width: 240px;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--green);
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.info {
  border-left: 3px solid var(--primary);
}

.toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   ANALYTICS STATS
   ============================================================ */
.analytics-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.analytics-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.analytics-stat .val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.analytics-stat .lbl {
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: 2px;
}

.analytics-stat .chg {
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 4px;
}

.chg.up {
  color: var(--green);
}

.chg.down {
  color: var(--red);
}

/* Funnel */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.funnel-bar-wrap {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
}

.funnel-bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: white;
  min-width: 50px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-label {
  font-size: 0.72rem;
  color: var(--text-2);
  min-width: 130px;
  white-space: nowrap;
}

.funnel-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  min-width: 48px;
  text-align: right;
}

/* Performance bars */
.perf-metrics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.perf-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perf-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 4px;
}

.perf-val {
  font-weight: 600;
  color: var(--text);
}

.perf-bar-track {
  height: 5px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1300px) {
  .three-panel-row {
    grid-template-columns: 1fr 1fr;
  }

  .status-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {
  .status-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: var(--sidebar-w-col);
  }

  .sidebar .logo-brand,
  .sidebar .nav-text,
  .sidebar .nav-label,
  .sidebar .nav-badge,
  .sidebar .help-text,
  .sidebar .admin-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .main-wrapper {
    margin-left: var(--sidebar-w-col);
  }

  .three-panel-row {
    grid-template-columns: 1fr;
  }

  .status-cards-row {
    grid-template-columns: 1fr 1fr;
  }

  .charts-row {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .top-header {
    padding: 0 10px;
    gap: 6px;
  }

  .dashboard-content {
    padding: 10px;
    gap: 10px;
  }

  .header-last-updated {
    display: none;
  }

  .theme-toggle-btn .theme-label {
    display: none;
  }

  .status-cards-row {
    grid-template-columns: 1fr;
  }

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

/* ============================================================
   DETAIL MODAL SYSTEM
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-l);
  border-radius: var(--radius);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h3 {
  font-size: 0.95rem;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 6px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-2);
}

.modal-action-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.15s;
}

.modal-action-btn:hover {
  background: var(--primary-d);
}

/* Modal details content styles */
.detail-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-stat-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.detail-stat-box .val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.detail-stat-box .lbl {
  font-size: 0.65rem;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.detail-alert-box {
  display: flex;
  gap: 10px;
  background: var(--primary-bg);
  border: 1px solid var(--border-l);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-2);
}

.detail-alert-box svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-2);
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.checklist-item.verified {
  border-left: 3px solid var(--green);
}

.checklist-item.pending {
  border-left: 3px solid var(--amber);
}

.contract-preview {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-2);
  height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.4;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   CRUD PAGES ADDITIONAL STYLES
   ============================================================ */
.crud-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.crud-title-block h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.crud-title-block p {
  font-size: 0.76rem;
  color: var(--text-3);
  margin-top: 2px;
}

.crud-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.15s;
}

.crud-btn:hover {
  background: var(--primary-d);
  transform: translateY(-1px);
}

.crud-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.crud-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crud-kpi-card .lbl {
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.crud-kpi-card .val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
}

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(40, 116, 240, 0.1);
}

/* Table Button Tweaks */
.action-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.crud-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.crud-action-btn:hover {
  background: var(--bg-3);
}

.crud-action-btn.edit:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.crud-action-btn.delete:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-l);
}

.mobile-logo-wrap {
  display: none;
}

.mobile-header-logo {
  width: 30px !important;
  height: 30px !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  .mobile-logo-wrap {
    display: flex;
    align-items: center;
    margin-right: 2px;
  }
}