/* ============================================================
   ENTERPRISE DATATABLE — QRS ERP
   Aesthetic: Corporate Professional
   Primary: Deep Blue / Slate Gray
   Accent (active/selected only): Purple
   Font: Inter + JetBrains Mono
   ============================================================ */

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

/* ═══════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════ */
:root {
  /* ── Corporate Blue — main UI color ── */
  --blue-50:   #eff6ff;
  --blue-100:  #dbeafe;
  --blue-200:  #bfdbfe;
  --blue-300:  #93c5fd;
  --blue-400:  #60a5fa;
  --blue-500:  #3b82f6;
  --blue-600:  #2563eb;
  --blue-700:  #1d4ed8;
  --blue-800:  #1e40af;
  --blue-900:  #1e3a8a;

  /* ── Slate Gray — typography & borders ── */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* ── Purple — ONLY for active / selected states ── */
  --purple-50:     #f5f3ff;
  --purple-100:    #ede9fe;
  --purple-200:    #ddd6fe;
  --purple-500:    #8b5cf6;
  --purple-600:    #7c3aed;
  --purple-700:    #6d28d9;
  --purple-border: rgba(124, 58, 237, 0.2);
  --purple-light:  rgba(124, 58, 237, 0.06);

  /* ── Semantic Colors ── */
  --white:       #ffffff;
  --green-50:    #f0fdf4;
  --green-100:   #dcfce7;
  --green-600:   #16a34a;
  --green-700:   #15803d;
  --amber-50:    #fffbeb;
  --amber-100:   #fef3c7;
  --amber-600:   #d97706;
  --amber-700:   #b45309;
  --red-50:      #fef2f2;
  --red-100:     #fee2e2;
  --red-500:     #ef4444;
  --red-600:     #dc2626;

  /* ── Aliases ── */
  --primary:        var(--blue-700);
  --primary-dark:   var(--blue-800);
  --primary-light:  var(--blue-50);
  --primary-border: var(--blue-200);

  /* ── Typography ── */
  --font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.05);
  --shadow-lg: 0 8px 24px rgba(15,23,42,0.1),  0 4px 8px rgba(15,23,42,0.06);

  /* ── Borders ── */
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  /* ── Radius ── */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ── Transitions ── */
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.15s;
}

/* ═══════════════════════════════════════════
   CONTAINER
═══════════════════════════════════════════ */
.container {
  background: var(--slate-100);
  font-family: var(--font);
  min-height: 100vh;
  color: var(--slate-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: linear-gradient(135deg, #2d0060 0%, #5a0099 35%, #7c00cc 65%, #9810e0 100%);
  color: white;
  box-shadow: 0 2px 12px rgba(90,0,153,0.4);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.header::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 320px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03));
  pointer-events: none;
}

.headerLeft { flex: 1; position: relative; z-index: 1; }

.title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: white;
  letter-spacing: -0.3px;
  line-height: 1.2;
  padding-left: 14px;
  border-left: 3.5px solid rgba(255,255,255,0.5);
}

.subtitle {
  font-size: 0.825rem;
  margin: 0;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  padding-left: 14px;
}

.headerRight {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  align-items: center;
}

.btnPrimary {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  font-family: var(--font);
  white-space: nowrap;
  background: white;
  color: #5a0099;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btnPrimary:hover { background: #f5f0ff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.btnPrimary:active { transform: translateY(0); }

.btnSecondary {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font);
  white-space: nowrap;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
}
.btnSecondary:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.38); transform: translateY(-1px); }

.icon { font-size: 0.95rem; }

/* ═══════════════════════════════════════════
   TOOLBAR
═══════════════════════════════════════════ */
.toolbar {
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.toolbarTop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.searchBox {
  position: relative;
  flex: 1;
  max-width: 700px;
}

.searchIcon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--slate-400);
  pointer-events: none;
}

.searchInput {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  outline: none;
  transition: all var(--duration) var(--ease);
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: var(--font);
  box-sizing: border-box;
}
.searchInput::placeholder { color: var(--slate-400); }
.searchInput:hover { border-color: var(--slate-300); background: var(--white); }
.searchInput:focus {
  border-color: #0d7a45;
  box-shadow: 0 0 0 3px rgba(13,122,69,0.1);
  background: var(--white);
}

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

.btnIcon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500);
}
.btnIcon:hover { border-color: #0d7a45; background: #f0fdf4; color: #0d7a45; }

.toolbarFilters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filterGroup    { display: flex; align-items: center; gap: 7px; }

.filterLabel {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--slate-600);
  white-space: nowrap;
}

.filterSelect {
  padding: 8px 28px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  background: var(--white);
  cursor: pointer;
  outline: none;
  min-width: 138px;
  height: 36px;
  transition: all var(--duration) var(--ease);
  color: var(--slate-700);
  font-weight: 400;
  font-family: var(--font);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.filterSelect:hover  { border-color: #0d7a45; background-color: var(--white); }
.filterSelect:focus  { border-color: #0d7a45; box-shadow: 0 0 0 3px rgba(13,122,69,0.1); background-color: var(--white); }

.clearFiltersBtn {
  margin-left: auto;
  white-space: nowrap;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--red-500);
  background: transparent;
  color: var(--red-500);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
}
.clearFiltersBtn:hover { background: var(--red-50); border-color: var(--red-600); color: var(--red-600); }

/* ═══════════════════════════════════════════
   STATS BAR
═══════════════════════════════════════════ */
.statsBar {
  display: flex;
  background: var(--border);
  padding: 0 36px;
  overflow-x: auto;
  scrollbar-width: none;
}
.statsBar::-webkit-scrollbar { display: none; }

.stat {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all var(--duration) var(--ease);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.stat:last-child { border-right: none; }

.stat::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--blue-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease);
}
.stat:hover { background: var(--blue-50); }
.stat:hover::after { transform: scaleX(1); }

.statLabel { font-size: 0.65rem; color: var(--slate-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; display: block; }
.statValue { font-size: 1.5rem; font-weight: 700; color: var(--blue-800); font-family: var(--font-mono); line-height: 1; display: block; letter-spacing: -0.8px; }

/* ═══════════════════════════════════════════
   TABLE WRAPPER
═══════════════════════════════════════════ */
.tableWrapper {
  background: var(--white);
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tableWrapper::-webkit-scrollbar { height: 4px; }
.tableWrapper::-webkit-scrollbar-track { background: var(--slate-100); }
.tableWrapper::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 2px; }
.tableWrapper::-webkit-scrollbar-thumb:hover { background: var(--blue-400); }

/* ═══════════════════════════════════════════
   TABLE
═══════════════════════════════════════════ */
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-family: var(--font);
}

.table thead {
  background: var(--slate-50);
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 5;
}

.table th,
.th {
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--slate-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: color var(--duration) var(--ease);
  font-family: var(--font);
}
.table th:hover { color: var(--blue-700); }
.table th:first-child { padding-left: 18px; }
.table th:last-child  { padding-right: 18px; }

.thContent { display: flex; align-items: center; gap: 5px; }
.sortIcon  { font-size: 9px; color: var(--slate-300); transition: color var(--duration); }
.table th:hover .sortIcon { color: var(--blue-500); }

/* ── Special Columns ── */
.expandCol,
.checkboxCol {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  text-align: center !important;
  padding: 10px !important;
  cursor: default !important;
}
.expandCol:hover,
.checkboxCol:hover { background: transparent !important; color: inherit !important; }

.actionsCol {
  width: 120px !important;
  min-width: 120px !important;
  text-align: center !important;
  padding: 10px 12px !important;
  cursor: default !important;
}
.actionsCol:hover { background: transparent !important; color: inherit !important; }

.checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--purple-600);
  border-radius: 3px;
}

.expandCell { text-align: center; padding: 10px 8px !important; width: 42px; }

.expandBtn {
  background: transparent;
  border: 1px solid var(--slate-200);
  color: var(--slate-400);
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}
.expandBtn:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-700); }

.expandIcon { transition: transform 0.2s var(--ease); }
.expanded   { transform: rotate(90deg) !important; }

/* ── Body Rows ── */
.table tbody tr {
  background: var(--white);
  border-bottom: 1px solid var(--slate-100);
  transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.table tbody tr:last-child { border-bottom: none; }

/* ✅ Pure white rows + colored left border on hover */
.table tbody tr:hover {
  background: var(--blue-50) !important;
  box-shadow: inset 3px 0 0 var(--blue-600);
}

.tableRow { transition: background-color var(--duration) var(--ease); }

/* ✅ Purple ONLY for selected row */
.selectedRow {
  background: var(--purple-50) !important;
  box-shadow: inset 3px 0 0 var(--purple-600) !important;
}
.selectedRow:hover {
  background: var(--purple-100) !important;
  box-shadow: inset 3px 0 0 var(--purple-600) !important;
}

.table td {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--slate-700);
  vertical-align: middle;
  white-space: nowrap;
  border: none;
  line-height: 1.4;
}
.table td:first-child { padding-left: 18px; }
.table td:last-child  { padding-right: 18px; }

.idCell     { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--slate-400); letter-spacing: 0.3px; }
.nameCell   { font-weight: 500; color: var(--slate-900); max-width: 220px; overflow: hidden; text-overflow: ellipsis; min-width: 140px; letter-spacing: -0.2px; font-size: 12.5px; }
.amountText { font-weight: 600; color: var(--slate-800); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: -0.2px; }

/* ═══════════════════════════════════════════
   TAGS & BADGES
═══════════════════════════════════════════ */
.departmentTag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: var(--font);
}

.statusDot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

.statusProgress  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.statusProgress .statusDot  { background: #3b82f6; }
.statusCompleted { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.statusCompleted .statusDot { background: #16a34a; }
.statusReview    { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.statusReview .statusDot    { background: #f59e0b; }
.statusPlanning  { background: var(--slate-50); color: var(--slate-500); border-color: var(--slate-200); }
.statusPlanning .statusDot  { background: var(--slate-400); }
.statusPending   { background: var(--purple-50); color: var(--purple-600); border-color: var(--purple-200); }
.statusPending .statusDot   { background: var(--purple-600); }
.statusDraft     { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.statusDraft .statusDot     { background: #ef4444; }
.statusCancelled { background: var(--slate-50); color: var(--slate-400); border-color: var(--slate-200); }
.statusCancelled .statusDot { background: var(--slate-300); }

.statusPill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; font-family: var(--font); }
.pillPENDING   { background: #fffbeb; color: #b45309;  border: 1px solid #fde68a; }
.pillPAID      { background: #f0fdf4; color: #15803d;  border: 1px solid #bbf7d0; }
.pillOVERDUE   { background: #fef2f2; color: #dc2626;  border: 1px solid #fecaca; }
.pillCANCELLED { background: var(--slate-50); color: var(--slate-500); border: 1px solid var(--slate-200); }
.pillONHOLD,
.pillHOLD      { background: var(--purple-50); color: var(--purple-600); border: 1px solid var(--purple-200); }

tr.statusCompleted { background-color: rgba(22,163,74,0.02) !important; }
tr.statusProgress  { background-color: rgba(37,99,235,0.02) !important; }
tr.statusReview    { background-color: rgba(217,119,6,0.02) !important; }
tr.statusPlanning  { background-color: var(--slate-50) !important; }

/* ═══════════════════════════════════════════
   PROGRESS
═══════════════════════════════════════════ */
.progressContainer { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.progressBar       { flex: 1; height: 5px; background: var(--slate-200); border-radius: 3px; overflow: hidden; }
.progressFill      { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--blue-400)); border-radius: 3px; transition: width 0.5s var(--ease); }
.progressText      { font-size: 11.5px; font-weight: 600; color: var(--slate-700); font-family: var(--font-mono); min-width: 38px; text-align: right; }
.progressSection   { background: var(--blue-50); border: 1px solid var(--blue-200); border-radius: var(--radius-md); padding: 12px 15px; margin-bottom: 16px; }
.progressHeader    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.progressLabel     { font-size: 13px; font-weight: 600; color: var(--slate-700); }
.progressPercent   { font-size: 13px; font-weight: 700; color: var(--blue-700); font-family: var(--font-mono); }
.progressTrack     { height: 6px; background: var(--slate-200); border-radius: 3px; overflow: hidden; }

/* ═══════════════════════════════════════════
   ACTION BUTTONS
═══════════════════════════════════════════ */
.actionsCell { text-align: center !important; padding: 8px 10px !important; }

.actionGroup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.actionBtn {
  background: transparent; border: 1px solid var(--slate-200); font-size: 13px; color: var(--slate-400);
  cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; transition: all var(--duration) var(--ease);
}
.actionBtn:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-700); }

.actionBtnView {
  background: transparent; border: none; color: var(--blue-500); cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; transition: all var(--duration) var(--ease);
}
.actionBtnView:hover { background: var(--blue-50); color: var(--blue-700); transform: scale(1.1); }

.actionBtnEdit {
  background: transparent; border: none; color: #d97706; cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; transition: all var(--duration) var(--ease);
}
.actionBtnEdit:hover { background: #fffbeb; color: #b45309; transform: scale(1.1); }

.actionBtnDelete {
  background: transparent; border: none; color: #ef4444; cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; transition: all var(--duration) var(--ease);
}
.actionBtnDelete:hover { background: #fef2f2; color: #dc2626; transform: scale(1.1); }

/* ═══════════════════════════════════════════
   EXPANDED ROW
═══════════════════════════════════════════ */
.expandedRow { background: var(--slate-50) !important; }
.expandedRow:hover { background: var(--slate-50) !important; box-shadow: none !important; }
.expandedRow > td { padding: 0 !important; border-right: none !important; }

.expandedContent {
  padding: 16px 24px;
  animation: expandIn 0.2s var(--ease);
}

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

/* ═══════════════════════════════════════════
   DETAIL PANEL
═══════════════════════════════════════════ */
.detailPanel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  border-top: 2px solid var(--blue-600);
}

.panelHeader {
  font-size: 13.5px; font-weight: 700; color: var(--slate-900);
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px;
}
.panelHeader::before { content: ''; width: 3px; height: 15px; background: var(--blue-600); border-radius: 2px; flex-shrink: 0; }

.panelSection { margin-bottom: 16px; }

.sectionTitle { font-size: 10px; text-transform: uppercase; color: var(--slate-500); letter-spacing: 0.7px; margin-bottom: 10px; font-weight: 600; }

.sectionTitleText {
  font-size: 11px; font-weight: 700; color: var(--blue-700);
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--blue-100);
  display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.6px;
}

.sectionTitleWithIcon { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--blue-700); margin-bottom: 12px; }
.sectionTitleWithIcon svg { color: var(--blue-600); }

.definitionGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }

.definitionItem {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  background: var(--slate-50); border-radius: var(--radius-sm);
  border: 1px solid var(--slate-100); font-size: 12.5px;
  transition: border-color var(--duration) var(--ease);
}
.definitionItem:hover { border-color: var(--blue-200); }
.definitionItem svg { color: var(--blue-500); flex-shrink: 0; width: 14px; height: 14px; opacity: 0.8; }

.label { color: var(--slate-500); font-size: 10.5px; font-weight: 600; min-width: 88px; text-transform: uppercase; letter-spacing: 0.3px; }
.value { color: var(--slate-900); font-weight: 600; flex: 1; font-size: 12.5px; }
.fullRow { grid-column: span 2; }

.panelActions {
  display: flex; gap: 7px; justify-content: flex-end;
  padding-top: 14px; border-top: 1px solid var(--border);
  margin-top: 16px; flex-wrap: wrap;
}

.primaryBtn {
  padding: 7px 15px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: var(--font); display: inline-flex; align-items: center;
  gap: 5px; transition: all var(--duration) var(--ease); border: none;
  background: var(--blue-700); color: white; box-shadow: 0 1px 4px rgba(30,64,175,0.2);
}
.primaryBtn:hover { background: var(--blue-800); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(30,64,175,0.28); }

.secondaryBtn {
  padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: var(--font); display: inline-flex; align-items: center;
  gap: 5px; transition: all var(--duration) var(--ease);
  background: var(--white); color: var(--slate-700); border: 1px solid var(--border);
}
.secondaryBtn:hover { background: var(--slate-50); border-color: var(--blue-300); color: var(--blue-700); }

.dangerBtn {
  padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: var(--font); display: inline-flex; align-items: center;
  gap: 5px; transition: all var(--duration) var(--ease);
  background: var(--white); color: var(--red-500); border: 1px solid var(--red-100);
}
.dangerBtn:hover { background: var(--red-50); border-color: var(--red-500); }

.invoiceBtn {
  padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: var(--font); display: inline-flex; align-items: center;
  gap: 5px; transition: all var(--duration) var(--ease);
  background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-200);
}
.invoiceBtn:hover { background: var(--blue-100); border-color: var(--blue-400); }

/* ═══════════════════════════════════════════
   EXPANDED ITEMS
═══════════════════════════════════════════ */
.expandedGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }

.expandedItem { padding: 12px 14px; background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--border); transition: all var(--duration) var(--ease); }
.expandedItem:hover { border-color: var(--blue-300); box-shadow: var(--shadow-xs); }

.expandedLabel { font-size: 10px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.expandedValue { font-size: 12.5px; color: var(--slate-900); font-weight: 600; line-height: 1.5; }
.expandedDescription { padding: 12px 14px; background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; font-size: 12.5px; color: var(--slate-700); line-height: 1.6; }
.expandedActions { display: flex; gap: 7px; flex-wrap: wrap; }

.expandedBtn {
  padding: 6px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--slate-700); font-family: var(--font);
  display: inline-flex; align-items: center; gap: 5px;
  transition: all var(--duration) var(--ease);
}
.expandedBtn:hover { border-color: var(--blue-400); color: var(--blue-700); background: var(--blue-50); }

/* ═══════════════════════════════════════════
   ERROR STATE
═══════════════════════════════════════════ */
.errorContainer {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 220px; padding: 48px 40px; background: var(--white);
  border-radius: var(--radius-lg); margin: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.errorIcon    { font-size: 36px; margin-bottom: 12px; }
.errorTitle   { font-size: 15px; font-weight: 700; color: var(--red-600); margin: 0 0 6px; letter-spacing: -0.2px; }
.errorMessage { font-size: 13px; color: var(--slate-500); margin: 0 0 18px; text-align: center; line-height: 1.5; }
.errorButton  {
  padding: 9px 20px; background: var(--blue-700); color: white; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all var(--duration) var(--ease);
  box-shadow: 0 2px 6px rgba(30,64,175,0.2);
}
.errorButton:hover { background: var(--blue-800); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,64,175,0.28); }

/* ═══════════════════════════════════════════
   PAYMENT SUMMARY
═══════════════════════════════════════════ */
.paymentSummaryGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }

.summaryCard {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
  transition: all var(--duration) var(--ease);
}
.summaryCard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.summaryIconBox { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.iconPurple { background: linear-gradient(135deg, var(--blue-600), var(--blue-800)); }
.iconGreen  { background: linear-gradient(135deg, #10b981, #059669); }
.iconOrange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.iconRed    { background: linear-gradient(135deg, #ef4444, #dc2626); }

.summaryInfo   { display: flex; flex-direction: column; gap: 2px; }
.summaryLabel  { font-size: 10.5px; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.5px; }
.summaryAmount { font-size: 16px; font-weight: 700; color: var(--slate-900); font-family: var(--font-mono); letter-spacing: -0.5px; }

.textGreen  { color: var(--green-600) !important; }
.textOrange { color: #b45309          !important; }
.textRed    { color: var(--red-600)   !important; }

/* ═══════════════════════════════════════════
   DETAIL TABLE
═══════════════════════════════════════════ */
.tableContainer { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }

.detailTable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.detailTable thead { background: var(--slate-50); }
.detailTable thead tr { border-bottom: 1px solid var(--border); }
.detailTable th {
  padding: 8px 12px; text-align: left; font-weight: 600; color: var(--slate-500);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--slate-50); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-family: var(--font);
}
.detailTable td { padding: 9px 12px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); font-size: 12.5px; font-weight: 400; vertical-align: middle; }
.detailTable tbody tr:last-child td { border-bottom: none; }
.detailTable tbody tr:hover { background: var(--blue-50); box-shadow: inset 2px 0 0 var(--blue-500); }

.rowPaid    { background: var(--green-50)  !important; }
.rowOverdue { background: var(--red-50)    !important; }
.rowHold    { background: var(--amber-50)  !important; }

.serviceName { font-weight: 600; color: var(--slate-900); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dateWithIcon { display: flex; align-items: center; gap: 5px; color: var(--slate-600); font-size: 12.5px; }
.dateWithIcon svg { color: var(--slate-400); width: 13px; height: 13px; }
.overdueTag { font-size: 9px; font-weight: 700; color: var(--red-600); background: var(--red-50); border: 1px solid var(--red-100); padding: 1px 5px; border-radius: 3px; text-transform: uppercase; margin-left: 5px; letter-spacing: 0.3px; }
.noteWithIcon { display: flex; align-items: center; gap: 5px; }
.holdIcon  { color: #d97706; }
.noteText  { color: var(--slate-500); font-size: 12px; font-weight: 500; }

.emptyState { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; color: var(--slate-400); gap: 8px; }
.emptyState svg  { opacity: 0.25; }
.emptyState span { font-size: 12.5px; font-weight: 500; }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px; background: var(--white);
  border: 1px solid var(--border); border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap; gap: 10px;
}

.paginationLeft  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.paginationText  { font-size: 0.775rem; color: var(--slate-500); font-weight: 400; }
.paginationText strong { color: var(--slate-800); font-weight: 700; }

.rowsPerPage {
  padding: 6px 26px 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.8rem;
  background: var(--white); cursor: pointer; outline: none;
  font-weight: 600; color: var(--slate-700);
  transition: all var(--duration) var(--ease);
  appearance: none; -webkit-appearance: none; font-family: var(--font);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.rowsPerPage:hover { border-color: var(--slate-300); background-color: var(--slate-50); }
.rowsPerPage:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); background-color: var(--white); }

.paginationRight { display: flex; align-items: center; gap: 3px; }

.pageBtn {
  min-width: 30px; height: 30px; padding: 0 7px;
  border: 1px solid var(--border); background: var(--white);
  border-radius: var(--radius-sm); font-size: 0.775rem; font-weight: 500;
  cursor: pointer; transition: all var(--duration) var(--ease);
  color: var(--slate-600); display: inline-flex; align-items: center;
  justify-content: center; user-select: none; font-family: var(--font);
}
.pageBtn:hover:not(:disabled):not(.activePageBtn) {
  border-color: var(--blue-400); background: var(--blue-50); color: var(--blue-700);
}
.pageBtn:active:not(:disabled) { transform: scale(0.97); }
.pageBtn:disabled { opacity: 0.35; cursor: not-allowed; background: var(--slate-50); border-color: var(--slate-100); }

/* ✅ Active pagination button uses PURPLE — selected/active state */
.activePageBtn {
  background: var(--purple-600);
  color: white;
  border-color: var(--purple-600);
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(124,58,237,0.28);
}
.activePageBtn:hover {
  background: var(--purple-700);
  border-color: var(--purple-700);
  box-shadow: 0 2px 10px rgba(124,58,237,0.36);
}

.pageEllipsis { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: var(--slate-400); font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; user-select: none; }

/* ═══════════════════════════════════════════
   ANIMATIONS & UTILITIES
═══════════════════════════════════════════ */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — COMPLETE MEDIA QUERIES
═══════════════════════════════════════════ */

/* ── Large Desktop (≥ 1440px) ── */
@media (min-width: 1440px) {
  .header          { padding: 26px 56px; }
  .toolbar         { padding: 18px 48px; }
  .pagination      { padding: 14px 48px; }
  .expandedContent { padding: 22px 40px; }
  .table th        { padding: 10px 16px; }
  .table td        { padding: 12px 16px; }
  .title           { font-size: 1.75rem; }
  .paymentSummaryGrid { gap: 16px; }
}

/* ── Standard Desktop (1025px – 1439px) ── */
@media (min-width: 1025px) and (max-width: 1439px) {
  .header     { padding: 22px 36px; }
  .toolbar    { padding: 16px 28px; }
  .pagination { padding: 12px 28px; }
}

/* ── Tablet Landscape (≤ 1024px) ── */
@media (max-width: 1024px) {
  .header          { padding: 20px 24px; }
  .toolbar         { padding: 14px 20px; }
  .pagination      { padding: 11px 18px; }
  .expandedContent { padding: 16px 20px; }
  .paymentSummaryGrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .definitionGrid     { grid-template-columns: 1fr; gap: 6px; }
  .fullRow            { grid-column: span 1; }
  .table td { padding: 10px 13px; font-size: 12.5px; }
  .table th { padding: 10px 13px; }
  .summaryAmount { font-size: 14px; }
  .statValue     { font-size: 1.5rem; }
  .searchBox     { max-width: 360px; }
  .title         { font-size: 1.5rem; }
}

/* ── Tablet Portrait (≤ 768px) ── */
@media (max-width: 768px) {
  .header { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px; }
  .title    { font-size: 1.35rem; }
  .subtitle { font-size: 0.825rem; }
  .headerRight { width: 100%; gap: 8px; }
  .btnPrimary,
  .btnSecondary { flex: 1; justify-content: center; padding: 9px 12px; font-size: 0.85rem; }

  .toolbar          { padding: 12px 16px; position: static; }
  .toolbarTop       { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 10px; }
  .toolbarFilters   { flex-direction: column; align-items: stretch; gap: 7px; }
  .filterGroup      { flex-direction: column; align-items: flex-start; gap: 4px; }
  .filterSelect     { width: 100%; min-width: unset; }
  .clearFiltersBtn  { margin-left: 0; justify-content: center; width: 100%; }
  .toolbarActions   { justify-content: flex-end; }
  .searchBox        { max-width: 100%; }

  .statsBar  { padding: 0 16px; flex-wrap: wrap; }
  .stat      { min-width: calc(50% - 1px); flex: none; padding: 14px 16px; }
  .statValue { font-size: 1.4rem; }

  .tableWrapper    { border-radius: var(--radius-sm); }
  .expandedContent { padding: 14px 16px; }
  .expandedGrid    { grid-template-columns: 1fr; }
  .expandedActions { flex-direction: column; }
  .expandedBtn     { justify-content: center; }
  .detailPanel     { padding: 16px; }

  .panelActions { flex-wrap: wrap; }
  .primaryBtn, .secondaryBtn,
  .dangerBtn, .invoiceBtn { flex: 1; justify-content: center; min-width: 100px; }

  .paymentSummaryGrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summaryCard        { padding: 11px 13px; }
  .summaryIconBox     { width: 32px; height: 32px; }
  .summaryAmount      { font-size: 13px; }

  .pagination {
    flex-direction: column; align-items: stretch;
    gap: 10px; padding: 11px 14px; border-radius: 0;
  }
  .paginationLeft  { justify-content: space-between; }
  .paginationRight { justify-content: center; flex-wrap: wrap; gap: 3px; }

  .definitionGrid { grid-template-columns: 1fr; }
  .fullRow        { grid-column: span 1; }
  .table th { font-size: 10px; padding: 9px 11px; }
  .table td { padding: 9px 11px; font-size: 12px; }
  .actionBtnView, .actionBtnEdit, .actionBtnDelete { width: 28px; height: 28px; }
}

/* ── Mobile Large (≤ 576px) ── */
@media (max-width: 576px) {
  .header   { padding: 14px; }
  .title    { font-size: 1.2rem; }
  .toolbar  { padding: 10px 12px; }
  .table th { font-size: 9.5px; padding: 8px 10px; }
  .table td { padding: 8px 10px; font-size: 11.5px; min-width: 80px; }
  .actionBtnView, .actionBtnEdit, .actionBtnDelete { width: 25px; height: 25px; }
  .pageBtn { min-width: 28px; height: 28px; font-size: 0.78rem; }
  .paymentSummaryGrid { grid-template-columns: 1fr; }
  .statsBar { flex-direction: column; padding: 0; }
  .stat     { min-width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .detailPanel { padding: 14px; }
}

/* ── Mobile Small (≤ 420px) ── */
@media (max-width: 420px) {
  .header { padding: 12px; }
  .title  { font-size: 1.05rem; }
  .btnPrimary, .btnSecondary { padding: 8px 10px; font-size: 0.82rem; }
  .searchInput  { padding: 8px 10px 8px 34px; font-size: 0.83rem; }
  .filterSelect { padding: 7px 22px 7px 9px; font-size: 0.78rem; }
  .clearFiltersBtn { font-size: 0.78rem; padding: 6px 11px; }
  .table th { padding: 7px 8px; font-size: 9px; }
  .table td { padding: 7px 8px; font-size: 11px; }
  .pageBtn      { min-width: 26px; height: 26px; font-size: 0.75rem; }
  .rowsPerPage  { font-size: 0.75rem; }
  .expandedContent { padding: 10px 12px; }
  .value           { font-size: 12px; }
  .panelHeader     { font-size: 13px; }
}

/* ── Print ── */
@media print {
  .toolbar, .actionsCell, .panelActions,
  .expandBtn, .pagination,
  .header::after, .header::before { display: none !important; }
  .header { background: var(--blue-900) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; padding: 14px 22px; }
  .tableWrapper { border: 1px solid var(--border); box-shadow: none; border-radius: 0; }
  .table thead  { position: static; }
  .table td, .table th { border-bottom: 1px solid var(--slate-200) !important; }
  .container { background: white; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  :global(*),
  :global(*::before),
  :global(*::after) {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}