/* ═══════════════════════════════════════════════════
   ADMINPRO — Complete Design System
   Version 1.0 | HTML + CSS + JS + PHP Ready
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap');
@import './table-enhancer.css?v=11dded1752743039';
@import './component-shapes.css?v=20261106-component-shapes-2';

/* ══ CSS VARIABLES — DARK THEME ══ */
:root,
[data-theme="dark"] {
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --brand-light: rgba(99,102,241,0.12);
  --brand-glow: rgba(99,102,241,0.3);
  --cyan: #06b6d4;
  --cyan-light: rgba(6,182,212,0.12);
  --success: #10b981;
  --success-light: rgba(16,185,129,0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,0.12);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,0.12);
  --info: #06b6d4;
  --info-light: rgba(6,182,212,0.12);

  --bg-base: #0d1117;
  --bg-surface: #161b27;
  --bg-elevated: #1c2333;
  --bg-hover: #212840;
  --bg-active: #252d45;
  --bg-overlay: rgba(0,0,0,0.6);

  --sidebar-bg: #111827;
  --sidebar-border: rgba(255,255,255,0.10);
  --sidebar-item-hover: rgba(99,102,241,0.1);
  --sidebar-item-active: rgba(99,102,241,0.15);

  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --text-primary: #f0f2f7;
  --text-secondary: #aab4c3;
  --text-muted: #9ca6b5;
  --text-inverse: #0d1117;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-brand: 0 4px 20px rgba(99,102,241,0.35);

  --radius-sm: var(--shape-small);
  --radius-md: var(--shape-control);
  --radius-lg: var(--shape-surface);
  --radius-xl: var(--shape-overlay);
  --radius-full: var(--shape-pill);

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;

  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* Opt-in near-black surfaces for the Onyx dark palette. */
:root[data-theme="dark"][data-dark-color="onyx"] {
  --bg-base: #050607;
  --bg-surface: #0b0d0f;
  --bg-elevated: #111416;
  --bg-hover: #191d20;
  --bg-active: #22272b;
  --sidebar-bg: #080a0b;
  --sidebar-border: rgba(255,255,255,0.10);
  --sidebar-item-hover: rgba(255,255,255,0.06);
  --sidebar-item-active: rgba(255,255,255,0.11);
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --text-muted: #8b95a1;
  --text-inverse: #050607;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.58);
}
/* ══ LIGHT THEME ══ */
[data-theme="light"] {
  --bg-base: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-hover: #f1f3f9;
  --bg-active: #e8ecf5;
  --bg-overlay: rgba(0,0,0,0.4);

  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(0,0,0,0.10);
  --sidebar-item-hover: rgba(99,102,241,0.07);
  --sidebar-item-active: rgba(99,102,241,0.1);

  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #667085;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --shadow-brand: 0 4px 20px rgba(99,102,241,0.25);
}

/* ══ RESET & BASE ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-sans); border: none; background: none; }
input, select, textarea { font-family: var(--font-sans); }
ul { list-style: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══ LAYOUT ══ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ══ SIDEBAR ══ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 0; gap: 0; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-collapse-toggle { display: none; }
.sidebar-mobile-toggle { display: none !important; }
.sidebar-collapse-toggle { margin-left: auto; flex-shrink: 0; }
.sidebar.collapsed .logo-icon { cursor: pointer; }
.sidebar .logo-icon:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sidebar.collapsed .sidebar-nav { scrollbar-gutter: stable both-edges; }
.sidebar.collapsed .nav-item a { justify-content: center; gap: 0; padding: 12px 0; }
.sidebar.collapsed .nav-item a .nav-icon { margin: 0; }
.sidebar.collapsed .nav-item.has-sub > a::after { display: none; }

.sidebar-logo {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  box-sizing: border-box;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--sidebar-border);
  transition: padding var(--transition-slow);
}
.logo-icon {
  width: 48px; height: 48px; flex: 0 0 48px;
  border: 0; padding: 0; cursor: default;
  background: transparent;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}
.logo-text { font-size: 1rem; line-height: 1; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.logo-text span { color: var(--brand); }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 10px 6px;
  transition: var(--transition);
}
.nav-item a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item a:hover {
  background: var(--sidebar-item-hover);
  color: var(--text-primary);
}
.nav-item.active > a {
  background: var(--sidebar-item-active);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.active > a .nav-icon { color: var(--brand); }
.nav-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.nav-label { flex: 1; transition: var(--transition); }
.nav-badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--brand-light);
  color: var(--brand);
  transition: var(--transition);
}
.nav-badge.danger { background: var(--danger-light); color: var(--danger); }
.nav-badge.success { background: var(--success-light); color: var(--success); }

/* ══════════════════════════════════════════════════════════════
   MOBILE LEGENDS STYLE NOTIFICATION RED DOT & BADGES (Task 16)
   ══════════════════════════════════════════════════════════════ */
@keyframes ml-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.nav-item a .nav-icon {
  position: relative;
}

.ml-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4d4d 0%, #dc2626 100%);
  color: #ffffff !important;
  margin-left: auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 2px 5px rgba(220, 38, 38, 0.5);
  animation: ml-pulse 2s infinite ease-in-out;
  letter-spacing: -0.2px;
  pointer-events: none;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ml-notif-dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #ef4444;
  border: 1.5px solid var(--sidebar-bg, #1a2234);
  box-shadow: 0 0 8px #ef4444;
  animation: ml-pulse 2s infinite ease-in-out;
  pointer-events: none;
}

.sidebar.collapsed .ml-notif-badge {
  display: none !important;
}
.sidebar.collapsed .ml-notif-dot.has-pending {
  display: block !important;
}

.ml-page-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-left: 10px;
  vertical-align: middle;
  line-height: 1.2;
}
.ml-page-badge .ml-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  animation: ml-pulse 1.8s infinite ease-in-out;
}


/* Submenu */
.nav-item.has-sub > a::after {
  content: '›';
  font-size: 1.1rem; line-height: 1;
  margin-left: auto;
  transition: transform var(--transition);
  color: var(--text-muted);
}
.nav-item.has-sub.open > a::after { transform: rotate(90deg); }
.nav-submenu {
  display: none;
  padding: 4px 0 4px 32px;
}
.nav-item.has-sub.open .nav-submenu { display: block; }
.nav-submenu a {
  font-size: 0.825rem;
  padding: 7px 12px;
  color: var(--text-muted);
}
.nav-submenu a:hover { color: var(--text-primary); background: var(--sidebar-item-hover); }

.user-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.825rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* ══ MAIN CONTENT ══ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ══ TOPBAR ══ */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  transition: background var(--transition-slow);
}
.topbar-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: 1.1rem;
}
.topbar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-search {
  flex: 1; max-width: 380px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 38px;
  transition: all var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.85rem;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon { color: var(--text-muted); font-size: 0.9rem; }
.search-kbd {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border);
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-page-title {
  margin: 0; min-width: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-page-title[hidden] { display: none; }
.topbar-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-badge {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-surface);
}
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

#topbar-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  cursor: pointer; box-shadow: var(--shadow-brand);
  transition: transform var(--transition);
}
#topbar-avatar:hover { transform: scale(1.05); }

/* ══ PAGE CONTENT ══ */
/* .page-content {
  flex: 1;
  padding: 28px 28px;
  width: 100%;    
  box-sizing: border-box;
  overflow-x: hidden;
} */
.page-content {
  flex: 1;
  padding: 28px 28px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;        /* ← add this */
  box-sizing: border-box; /* ← add this too */
}
.page-content.date-management-page { padding-top: 20px; }
.page-content.audit-trail-page { padding-top: 20px; }
.page-content.settings-page { padding-top: 20px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.page-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 3px; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  margin-top: 6px;
}
.breadcrumb a { color: var(--brand); }
.breadcrumb span { color: var(--text-muted); }

/* ══ CARDS ══ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 0.95rem; font-weight: 700; }
.card-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; }

/* Stat Cards */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative; overflow: hidden;
  min-height: 0;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-header { display: flex; align-items: center; justify-content: space-between; }
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.brand { background: var(--brand-light); color: var(--brand); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.stat-change {
  font-size: 0.75rem; font-weight: 600;
  display: flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: var(--radius-full);
}
.stat-change.up { background: var(--success-light); color: var(--success); }
.stat-change.down { background: var(--danger-light); color: var(--danger); }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.stat-mini-chart-wrap { height: 44px; position: relative; width: 100%; overflow: hidden; flex-shrink: 0; }
.stat-mini-chart { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ══ GRID SYSTEM ══ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3-1 { grid-template-columns: 3fr 1fr; }
.grid-cols-2-1 { grid-template-columns: 2fr 1fr; }

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  transition: all var(--transition);
  cursor: pointer; border: none; outline: none;
  white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn:not([data-tooltip])::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn:not([data-tooltip]):hover::after { background: rgba(255,255,255,0.07); }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 6px 13px; font-size: 0.78rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 26px; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 9px; }
.btn-icon-sm { padding: 6px; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 6px 24px rgba(99,102,241,0.45); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--cyan); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-outline { background: transparent; border: 1px solid var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); }
.btn-loading { pointer-events: none; opacity: 0.7; }
.btn-loading::before { content: ''; display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ══ BADGES ══ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
}
.badge-primary { background: var(--brand-light); color: var(--brand); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: var(--bg-hover); color: var(--text-secondary); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ══ FORMS ══ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.825rem; font-weight: 600; color: var(--text-secondary); }
.form-label .required { color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem; font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
}
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
  background: var(--bg-surface);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); }
.form-control.error:focus { box-shadow: 0 0 0 3px var(--danger-light); }
.form-control.success { border-color: var(--success); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); }
.form-error { font-size: 0.78rem; color: var(--danger); }
.input-group { position: relative; display: flex; }
.input-addon {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.875rem;
}
.input-addon:first-child { border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-addon:last-child { border-left: none; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; }
.input-group .form-control:first-child:not(:last-child) { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-group .form-control:last-child:not(:first-child) { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 38px; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; pointer-events: none; }

/* Select */
select.form-control { cursor: pointer; }

/* Textarea */
textarea.form-control { resize: vertical; min-height: 100px; }

/* Checkbox & Radio */
.form-check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] { display: none; }
.check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
  background: var(--bg-elevated);
}
.form-check input:checked + .check-box {
  background: var(--brand); border-color: var(--brand);
}
.form-check input:checked + .check-box::after { content: '✓'; color: #fff; font-size: 0.7rem; font-weight: 700; }
.radio-box {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
  background: var(--bg-elevated);
}
.form-check input:checked + .radio-box { border-color: var(--brand); }
.form-check input:checked + .radio-box::after { content: ''; width: 8px; height: 8px; background: var(--brand); border-radius: 50%; }
.check-label { font-size: 0.875rem; font-weight: 500; }

/* Toggle Switch */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  width: 42px; height: 24px; border-radius: var(--radius-full);
  background: var(--bg-hover); border: 1px solid var(--border);
  position: relative; transition: all var(--transition);
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted); top: 2px; left: 2px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-track { background: var(--brand); border-color: var(--brand); }
.toggle input:checked + .toggle-track::after { background: #fff; transform: translateX(18px); }
.toggle-label { font-size: 0.875rem; font-weight: 500; }

/* Range Slider */
.range-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 99px; background: var(--border); outline: none; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); cursor: pointer; box-shadow: var(--shadow-brand); border: 2px solid var(--bg-surface); }

/* ══ TABLE ══ */
.table-wrapper { overflow-x: auto; }
.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elevated);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  padding: 11px 16px; text-align: left;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table-avatar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table-avatar-img {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.table-avatar > div:not(.table-avatar-img) {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.table-name { font-weight: 600; font-size: 0.875rem; }
.table-meta { font-size: 0.75rem; color: var(--text-muted); }
.table-actions { display: flex; gap: 6px; }
.table-check { width: 40px; }

/* ══ PAGINATION ══ */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-item {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.825rem; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent;
}
.page-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-item.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-item.disabled { opacity: 0.4; pointer-events: none; }

/* ══ MODALS ══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-slow);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-slow);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-sm .modal { max-width: 380px; }
.modal-lg .modal { max-width: 720px; }
.modal-xl .modal { max-width: 960px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 1.1rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 22px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  flex-wrap: wrap;
}
.modal-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ══ TOAST ══ */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px; width: calc(100vw - 40px);
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
}
.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before { background: var(--cyan); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--cyan); }
.toast-content { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 700; }
.toast-msg { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.toast-close { color: var(--text-muted); font-size: 0.9rem; cursor: pointer; padding: 2px; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: currentColor; opacity: 0.3;
  animation: toastProgress 4s linear forwards;
}
.toast.success .toast-progress { color: var(--success); }
.toast.error .toast-progress { color: var(--danger); }

@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(110%); } }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ══ DATE PICKER ══ */
.datepicker-wrapper { position: relative; }
.datepicker-popup {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 500; width: 296px;
  display: none;
}
.datepicker-popup.open { display: block; animation: fadeScaleIn 0.2s ease; }
.dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dp-nav { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); color: var(--text-secondary); transition: all var(--transition); cursor: pointer; }
.dp-nav:hover { background: var(--bg-hover); color: var(--text-primary); }
.dp-month-year { font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.dp-month-year:hover { color: var(--brand); }
.dp-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 6px; }
.dp-weekday { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); font-size: 0.825rem;
  cursor: pointer; transition: all var(--transition);
  color: var(--text-primary);
}
.dp-day:hover { background: var(--bg-hover); }
.dp-day.today { color: var(--brand); font-weight: 700; }
.dp-day.selected { background: var(--brand); color: #fff; }
.dp-day.other-month { color: var(--text-muted); }
.dp-day.disabled { opacity: 0.3; pointer-events: none; }
.dp-day.in-range { background: var(--brand-light); border-radius: 0; }
.dp-day.range-start, .dp-day.range-end { background: var(--brand); color: #fff; }

/* ══ DROPDOWN ══ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 400;
  display: none; overflow: hidden;
}
.dropdown-menu.open { display: block; animation: fadeScaleIn 0.18s ease; }
.dropdown-menu.right { right: 0; left: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 0.85rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-header { padding: 8px 14px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

/* ══ TABS ══ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-item {
  padding: 10px 18px; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* Pills Tabs */
.tabs-pills { border-bottom: none; gap: 6px; background: var(--bg-elevated); padding: 5px; border-radius: var(--radius-md); display: inline-flex; }
.tabs-pills .tab-item { border-radius: var(--radius-sm); border-bottom: none; padding: 7px 16px; }
.tabs-pills .tab-item.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ══ ALERTS ══ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 0.875rem;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-close { color: inherit; opacity: 0.5; cursor: pointer; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-light); border-color: rgba(16,185,129,0.25); color: var(--success); }
.alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.25); color: var(--warning); }
.alert-danger { background: var(--danger-light); border-color: rgba(239,68,68,0.25); color: var(--danger); }
.alert-info { background: var(--cyan-light); border-color: rgba(6,182,212,0.25); color: var(--cyan); }
.alert-primary { background: var(--brand-light); border-color: rgba(99,102,241,0.25); color: var(--brand); }

/* ══ PROGRESS ══ */
.progress { height: 7px; background: var(--bg-hover); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius-full); transition: width 0.6s ease; }
.progress-bar.brand { background: linear-gradient(90deg, var(--brand), var(--cyan)); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ══ AVATAR ══ */
.avatar {
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
}
.avatar-xs { width: 24px; height: 24px; font-size: 0.65rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar-xl { width: 68px; height: 68px; font-size: 1.3rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--bg-surface); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ══ TIMELINE ══ */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 16px; padding-bottom: 24px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
  margin-top: 4px; position: relative; z-index: 1;
  box-shadow: 0 0 0 3px var(--brand-light);
}
.timeline-line {
  position: absolute; left: 5px; top: 16px; bottom: 0;
  width: 1px; background: var(--border); z-index: 0;
}
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { flex: 1; }
.timeline-title { font-size: 0.875rem; font-weight: 600; }
.timeline-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.timeline-desc { font-size: 0.825rem; color: var(--text-secondary); margin-top: 6px; }

/* ══ TOOLTIP ══ */
[data-tooltip] { position: relative; }
.btn[data-tooltip] { overflow: visible; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; inset: auto auto calc(100% + 7px) 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated); color: var(--text-primary);
  font-size: 0.75rem; padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap; pointer-events: none;
  opacity: 0; z-index: 1; transition: opacity var(--transition);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
[data-tooltip]:hover::after { opacity: 1; }
.topbar [data-tooltip]:hover,
.topbar [data-tooltip]:focus-visible { z-index: 2; }

/* ══ SKELETON ══ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══ DIVIDERS ══ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.8rem; }
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══ CODE BLOCK ══ */
.code-block {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--text-primary); overflow-x: auto; line-height: 1.7;
}
code { font-family: var(--font-mono); font-size: 0.82em; background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; color: var(--brand); }

/* ══ MISC UTILITIES ══ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: 0.825rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded-full { border-radius: var(--radius-full); }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ══ ANIMATIONS ══ */
@keyframes fadeScaleIn { from { opacity: 0; transform: scale(0.95) translateY(-4px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.4s ease; }

/* Staggered card entrance */
.grid > *:nth-child(1) { animation: slideUp 0.4s ease 0.05s both; }
.grid > *:nth-child(2) { animation: slideUp 0.4s ease 0.1s both; }
.grid > *:nth-child(3) { animation: slideUp 0.4s ease 0.15s both; }
.grid > *:nth-child(4) { animation: slideUp 0.4s ease 0.2s both; }

/* ══ SIDEBAR OVERLAY (mobile) ══ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3-1 { grid-template-columns: 1fr; }
  .grid-cols-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar-mobile-toggle { display: flex !important; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 20px 16px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --topbar-height: 58px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 16px; gap: 10px; }
  .modal { border-radius: var(--radius-lg); }
  .toast-container { top: 10px; right: 10px; max-width: 320px; }
  .table th, .table td { padding: 10px 12px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
  .page-content { padding: 16px 12px; }
  .card { padding: 18px 16px; }
  .stat-card { padding: 16px; }
  .modal-body, .modal-header, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .btn-lg { padding: 10px 20px; }
}

/* ══ PRINT ══ */
@media print {
  .sidebar, .topbar, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* ═══════════════════════════════════════════════════
   LENDPRO LMS — Additional Styles
═══════════════════════════════════════════════════ */

/* ══ BADGE EXTRAS ══ */
.badge-info { background: var(--cyan-light); color: var(--cyan); }
.badge-primary { background: var(--brand-light); color: var(--brand); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

.badge-dot { display: inline-flex; align-items: center; gap: 5px; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ══ TABLE AVATAR ══ */
.table-avatar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table-avatar-img {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.table-avatar > div:not(.table-avatar-img) {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.table-name { font-size: .875rem; font-weight: 600; }
.table-meta { font-size: .75rem; color: var(--text-muted); }
.table-actions { display: flex; gap: 6px; }
.btn-icon-sm { width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: .85rem; border-radius: var(--radius-md); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

/* ══ STAT CARD COLORS ══ */
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon.brand { background: var(--brand-light); color: var(--brand); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.stat-icon.info { background: var(--cyan-light); color: var(--cyan); }

/* ══ BTN ICON ══ */
.btn-icon { width: 38px; height: 38px; padding: 0 !important; display: flex; align-items: center; justify-content: center; }

/* ══ INPUT GROUP ══ */
.input-group { display: flex; }
.input-group .form-control { border-radius: 0; flex: 1; }
.input-group .form-control:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-group .form-control:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-group-addon {
  padding: 0 12px; background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: .825rem; display: flex; align-items: center;
  white-space: nowrap;
}
.input-group-addon:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); border-right: none; }
.input-group-addon:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-left: none; }

/* ══ TOGGLE ══ */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 34px; transition: .3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: var(--text-muted);
  border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--brand); border-color: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ══ BTN VARIANTS ══ */
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; border: none; }
.btn-warning:hover { background: #d97706; }
.btn-success { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #059669; }
.btn-info { background: var(--cyan); color: #fff; border: none; }

/* ══ GRID COLUMNS ══ */
.grid-cols-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-cols-2-1 { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; }
.gap-5 { gap: 20px; }

/* ══ CREDIT SCORE ARC ══ */
.score-ring-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto 16px; }

/* ══ REQUIRED FIELD ══ */
.required { color: var(--danger); }

/* ══ PAGINATION ══ */
.pagination { display: flex; gap: 4px; }
.page-item {
  min-width: 34px; height: 34px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); cursor: pointer;
  font-size: .825rem; font-weight: 500;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); transition: all var(--transition);
}
.page-item:hover:not(.active):not(.disabled) { background: var(--bg-hover); color: var(--text-primary); }
.page-item.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-item.disabled { opacity: 0.4; cursor: not-allowed; }

/* ══ STAT CHANGE ══ */
.stat-change { font-size: .75rem; font-weight: 700; display: flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: var(--radius-full); }
.stat-change.up { background: var(--success-light); color: var(--success); }
.stat-change.down { background: var(--danger-light); color: var(--danger); }

/* ══ RESPONSIVE ══ */
@media (max-width: 1280px) {
  .grid-cols-3-1 { grid-template-columns: 1fr; }
  .grid-cols-2-1 { grid-template-columns: 1fr; }
}

.initials {
    position: relative;
    overflow: hidden;
}

.initials::after {
    content: attr(data-initials);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--cyan));
    border-radius: 50%;
}

/* ══════════════════════════════════════════════════════════════════
   TOPBAR EXCEL DESIGN TOGGLE BUTTON
   ══════════════════════════════════════════════════════════════════ */
#excelToggle {
  transition: all var(--transition);
}
#excelToggle i {
  font-size: 1.18rem;
  color: #107c41;
  transition: all var(--transition);
}
[data-theme="dark"] #excelToggle i {
  color: #22c55e;
}
#excelToggle:hover {
  background: rgba(16, 124, 65, 0.12);
}
[data-theme="dark"] #excelToggle:hover {
  background: rgba(34, 197, 94, 0.15);
}
#excelToggle.excel-active,
html[data-excel-mode="true"] #excelToggle {
  background: #107c41 !important;
  box-shadow: 0 2px 8px rgba(16, 124, 65, 0.35) !important;
}
[data-theme="dark"] #excelToggle.excel-active,
html[data-excel-mode="true"][data-theme="dark"] #excelToggle {
  background: #168249 !important;
  box-shadow: 0 2px 8px rgba(22, 130, 73, 0.45) !important;
}
#excelToggle.excel-active i,
html[data-excel-mode="true"] #excelToggle i {
  color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════════
   GLOBAL MICROSOFT EXCEL DESIGN SYSTEM (All Modules & Pages)
   ══════════════════════════════════════════════════════════════════ */
html[data-excel-mode="true"] body,
html[data-excel-mode="true"] .main-content,
html[data-excel-mode="true"] .page-content,
html[data-excel-mode="true"] table,
html[data-excel-mode="true"] button,
html[data-excel-mode="true"] input,
html[data-excel-mode="true"] select,
html[data-excel-mode="true"] textarea {
  font-family: 'Segoe UI', Calibri, Arial, sans-serif !important;
}

/* ── Light Mode Variables Override ── */
html[data-excel-mode="true"][data-theme="light"],
html[data-excel-mode="true"]:not([data-theme="dark"]):not([data-theme="light"]) {
  --brand: #107c41 !important;
  --brand-hover: #0e6b37 !important;
  --brand-light: rgba(16,124,65,0.12) !important;
  --brand-glow: rgba(16,124,65,0.25) !important;
  --shadow-brand: 0 4px 16px rgba(16,124,65,0.25) !important;
}

/* ── Dark Mode Variables Override ── */
html[data-excel-mode="true"][data-theme="dark"],
html[data-excel-mode="true"]:not([data-theme="light"]) {
  --brand: #168249 !important;
  --brand-hover: #107c41 !important;
  --brand-light: rgba(22,130,73,0.18) !important;
  --brand-glow: rgba(22,130,73,0.3) !important;
  --shadow-brand: 0 4px 16px rgba(22,130,73,0.35) !important;
}

/* ── Cards & Panels across all modules ── */
html[data-excel-mode="true"] .card,
html[data-excel-mode="true"] .stat-card {
  border-radius: var(--shape-surface) !important;
}
html[data-excel-mode="true"][data-theme="light"] .card,
html[data-excel-mode="true"][data-theme="light"] .stat-card {
  border: 1px solid #d4d4d4 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}
html[data-excel-mode="true"][data-theme="dark"] .card,
html[data-excel-mode="true"][data-theme="dark"] .stat-card,
html[data-excel-mode="true"]:not([data-theme="light"]) .card,
html[data-excel-mode="true"]:not([data-theme="light"]) .stat-card {
  background: #242424 !important;
  border: 1px solid #383838 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
}

/* ── Form inputs across all modules ── */
html[data-excel-mode="true"] .form-control,
html[data-excel-mode="true"] input[type="text"],
html[data-excel-mode="true"] input[type="date"],
html[data-excel-mode="true"] input[type="number"],
html[data-excel-mode="true"] input[type="search"],
html[data-excel-mode="true"] select {
  border-radius: var(--shape-control) !important;
}
html[data-excel-mode="true"][data-theme="light"] .form-control,
html[data-excel-mode="true"][data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
html[data-excel-mode="true"][data-theme="light"] select {
  background: #ffffff !important;
  color: #1f1f1f !important;
  border: 1px solid #ababab !important;
}
html[data-excel-mode="true"][data-theme="dark"] .form-control,
html[data-excel-mode="true"][data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-excel-mode="true"][data-theme="dark"] select,
html[data-excel-mode="true"]:not([data-theme="light"]) .form-control,
html[data-excel-mode="true"]:not([data-theme="light"]) input:not([type="checkbox"]):not([type="radio"]),
html[data-excel-mode="true"]:not([data-theme="light"]) select {
  background: #1e1e1e !important;
  color: #f1f1f1 !important;
  border: 1px solid #4a4a4a !important;
}
html[data-excel-mode="true"] .form-control:focus,
html[data-excel-mode="true"] input:focus,
html[data-excel-mode="true"] select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px var(--brand-light) !important;
}

/* ── Buttons across all modules ── */
html[data-excel-mode="true"] .btn {
  border-radius: var(--shape-control) !important;
  font-family: 'Segoe UI', Calibri, Arial, sans-serif !important;
  font-weight: 600 !important;
}
html[data-excel-mode="true"] .btn-primary {
  background: var(--brand) !important;
  border-color: #0e6b37 !important;
  color: #ffffff !important;
}
html[data-excel-mode="true"] .btn-primary:hover {
  filter: brightness(1.08) !important;
}

/* ── Tables across ALL modules & pages ── */
html[data-excel-mode="true"] table,
html[data-excel-mode="true"] .table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-family: 'Segoe UI', Calibri, Arial, sans-serif !important;
  font-size: 0.8rem !important;
}

/* Headers across all modules */
html[data-excel-mode="true"] table thead th,
html[data-excel-mode="true"] .table thead th,
html[data-excel-mode="true"] .table th {
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  padding: 7px 10px !important;
  letter-spacing: 0.01em !important;
}
html[data-excel-mode="true"][data-theme="light"] table thead th,
html[data-excel-mode="true"][data-theme="light"] .table thead th,
html[data-excel-mode="true"][data-theme="light"] .table th {
  background: #f3f2f1 !important;
  color: #242424 !important;
  border-right: 1px solid #d4d4d4 !important;
  border-bottom: 2px solid #a6a6a6 !important;
}
html[data-excel-mode="true"][data-theme="dark"] table thead th,
html[data-excel-mode="true"][data-theme="dark"] .table thead th,
html[data-excel-mode="true"][data-theme="dark"] .table th,
html[data-excel-mode="true"]:not([data-theme="light"]) table thead th,
html[data-excel-mode="true"]:not([data-theme="light"]) .table thead th,
html[data-excel-mode="true"]:not([data-theme="light"]) .table th {
  background: #2d2d2d !important;
  color: #f1f1f1 !important;
  border-right: 1px solid #3c3c3c !important;
  border-bottom: 2px solid #555555 !important;
}

/* Cells across all modules */
html[data-excel-mode="true"] table tbody td,
html[data-excel-mode="true"] .table tbody td,
html[data-excel-mode="true"] .table td {
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
}
html[data-excel-mode="true"][data-theme="light"] table tbody td,
html[data-excel-mode="true"][data-theme="light"] .table tbody td,
html[data-excel-mode="true"][data-theme="light"] .table td {
  background: #ffffff !important;
  color: #1f1f1f !important;
  border-right: 1px solid #e0e0e0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}
html[data-excel-mode="true"][data-theme="dark"] table tbody td,
html[data-excel-mode="true"][data-theme="dark"] .table tbody td,
html[data-excel-mode="true"][data-theme="dark"] .table td,
html[data-excel-mode="true"]:not([data-theme="light"]) table tbody td,
html[data-excel-mode="true"]:not([data-theme="light"]) .table tbody td,
html[data-excel-mode="true"]:not([data-theme="light"]) .table td {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  border-right: 1px solid #333333 !important;
  border-bottom: 1px solid #333333 !important;
}

/* Row hovers across all modules */
html[data-excel-mode="true"][data-theme="light"] table tbody tr:hover td,
html[data-excel-mode="true"][data-theme="light"] .table tbody tr:hover td {
  background: #e8f4ec !important;
}
html[data-excel-mode="true"][data-theme="dark"] table tbody tr:hover td,
html[data-excel-mode="true"][data-theme="dark"] .table tbody tr:hover td,
html[data-excel-mode="true"]:not([data-theme="light"]) table tbody tr:hover td,
html[data-excel-mode="true"]:not([data-theme="light"]) .table tbody tr:hover td {
  background: #1f3627 !important;
}

/* Table Footers across all modules */
html[data-excel-mode="true"][data-theme="light"] table tfoot th,
html[data-excel-mode="true"][data-theme="light"] .table tfoot th,
html[data-excel-mode="true"][data-theme="light"] table tfoot td,
html[data-excel-mode="true"][data-theme="light"] .table tfoot td {
  background: #f8f9fa !important;
  color: #1f1f1f !important;
  font-weight: 700 !important;
  border-top: 1px solid #000000 !important;
  border-bottom: 3px double #000000 !important;
  border-right: 1px solid #d4d4d4 !important;
}
html[data-excel-mode="true"][data-theme="dark"] table tfoot th,
html[data-excel-mode="true"][data-theme="dark"] .table tfoot th,
html[data-excel-mode="true"][data-theme="dark"] table tfoot td,
html[data-excel-mode="true"][data-theme="dark"] .table tfoot td,
html[data-excel-mode="true"]:not([data-theme="light"]) table tfoot th,
html[data-excel-mode="true"]:not([data-theme="light"]) .table tfoot th,
html[data-excel-mode="true"]:not([data-theme="light"]) table tfoot td,
html[data-excel-mode="true"]:not([data-theme="light"]) .table tfoot td {
  background: #282828 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-top: 1px solid #777777 !important;
  border-bottom: 3px double #777777 !important;
  border-right: 1px solid #3c3c3c !important;
}

/* Badges across all modules */
html[data-excel-mode="true"] .badge,
html[data-excel-mode="true"] .nav-badge {
  border-radius: var(--shape-small) !important;
  border: 1px solid rgba(0,0,0,0.12) !important;
  font-weight: 600 !important;
}
html[data-excel-mode="true"][data-theme="dark"] .badge,
html[data-excel-mode="true"][data-theme="dark"] .nav-badge,
html[data-excel-mode="true"]:not([data-theme="light"]) .badge,
html[data-excel-mode="true"]:not([data-theme="light"]) .nav-badge {
  border: 1px solid rgba(255,255,255,0.15) !important;
}

/* Sidebar active navigation item in Excel mode */
html[data-excel-mode="true"][data-theme="light"] .nav-item.active a,
html[data-excel-mode="true"][data-theme="light"] .nav-item a:hover {
  background: rgba(16,124,65,0.08) !important;
  color: #107c41 !important;
}
html[data-excel-mode="true"][data-theme="light"] .nav-item.active a .nav-icon {
  color: #107c41 !important;
}
html[data-excel-mode="true"][data-theme="dark"] .nav-item.active a,
html[data-excel-mode="true"][data-theme="dark"] .nav-item a:hover,
html[data-excel-mode="true"]:not([data-theme="light"]) .nav-item.active a,
html[data-excel-mode="true"]:not([data-theme="light"]) .nav-item a:hover {
  background: rgba(22,130,73,0.15) !important;
  color: #22c55e !important;
}
html[data-excel-mode="true"][data-theme="dark"] .nav-item.active a .nav-icon,
html[data-excel-mode="true"]:not([data-theme="light"]) .nav-item.active a .nav-icon {
  color: #22c55e !important;
}

/* Hide decorative title indicator; keep the pending count pill intact. */
.ml-page-badge .ml-dot{display:none!important}

/* Lending workflow typography: compact, consistent roles for the eight review pages. */
body:has(#prereg-table),
body:has(#registry-table),
body:has(.ll-page),
body:has(#risk-assessment-table),
body:has(#credit-investigation-table),
body:has(#loan-process-table),
body:has(#loan-approval-table),
body:has(.loan-controls-page),
body:has(#loan-release-table) {
  --workflow-title-size: 1.375rem;
  --workflow-title-line: 1.22;
  --workflow-title-weight: 700;
  --workflow-body-size: 0.8125rem;
  --workflow-body-line: 1.45;
  --workflow-meta-size: 0.75rem;
}
body:has(#prereg-table) .page-header,
body:has(#registry-table) .page-header,
body:has(.ll-page) .page-header,
body:has(#risk-assessment-table) .page-header,
body:has(#credit-investigation-table) .page-header,
body:has(#loan-process-table) .page-header,
body:has(#loan-approval-table) .page-header,
body:has(.loan-controls-page) .page-header,
body:has(#loan-release-table) .page-header {
  margin-bottom: 20px;
  gap: 14px;
}
body:has(#prereg-table) .page-title,
body:has(#registry-table) .page-title,
body:has(.ll-page) .page-title,
body:has(#risk-assessment-table) .page-title,
body:has(#credit-investigation-table) .page-title,
body:has(#loan-process-table) .page-title,
body:has(#loan-approval-table) .page-title,
body:has(.loan-controls-page) .page-title,
body:has(#loan-release-table) .page-title {
  font-size: var(--workflow-title-size);
  line-height: var(--workflow-title-line);
  font-weight: var(--workflow-title-weight);
  letter-spacing: -0.025em;
}
body:has(#prereg-table) .page-subtitle,
body:has(#registry-table) .page-subtitle,
body:has(.ll-page) .page-subtitle,
body:has(#risk-assessment-table) .page-subtitle,
body:has(#credit-investigation-table) .page-subtitle,
body:has(#loan-process-table) .page-subtitle,
body:has(#loan-approval-table) .page-subtitle,
body:has(.loan-controls-page) .page-subtitle,
body:has(#loan-release-table) .page-subtitle {
  margin-top: 4px;
  font-size: var(--workflow-body-size);
  line-height: 1.5;
}
body:has(#prereg-table) .breadcrumb,
body:has(#registry-table) .breadcrumb,
body:has(.ll-page) .breadcrumb,
body:has(#risk-assessment-table) .breadcrumb,
body:has(#credit-investigation-table) .breadcrumb,
body:has(#loan-process-table) .breadcrumb,
body:has(#loan-approval-table) .breadcrumb,
body:has(.loan-controls-page) .breadcrumb,
body:has(#loan-release-table) .breadcrumb {
  font-size: var(--workflow-meta-size);
  line-height: 1.4;
}

/* The legacy loan list uses regular DOM tables rather than lms-data-table. */
body:has(.ll-page) .ll-page .table {
  font-size: var(--workflow-body-size);
  line-height: var(--workflow-body-line);
  font-variant-numeric: tabular-nums;
}
body:has(.ll-page) .ll-page .table th {
  padding: 9px 12px;
  font-size: 0.6875rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.035em;
}
body:has(.ll-page) .ll-page .table td {
  padding: 10px 12px;
  font-size: var(--workflow-body-size);
  line-height: var(--workflow-body-line);
}

/* Secondary IDs in legacy loan-list search results and detail rows. */
body:has(.ll-page) .ll-page .ll-nl-sug-code,
body:has(.ll-page) .ll-page .ll-nl-cn {
  font-size: 0.6875rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

/* Lending list navigation shares the workflow type and spacing tokens. */
.loan-controls-page{width:100%;min-width:0;font-size:var(--workflow-body-size);line-height:var(--workflow-body-line)}
.loan-controls-page .page-header p{margin-bottom:0;max-width:65ch}
.loan-controls-page #lr-message:empty,.loan-controls-page #lr-setup:empty{display:none}
.loan-controls-page .lr-note,.loan-controls-page #lr-setup .lr-panel{padding:16px;margin-bottom:16px;border:1px solid var(--border);border-radius:8px;background:var(--bg-surface);font-size:var(--workflow-body-size)}
.loan-controls-page .lr-note.error{color:var(--danger)}

/* Keep the native refund dialog centered after the global margin reset. */
dialog.ct-refund-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
}

/* Emphasize the collection amount above its refund action. */
.ct-table .ct-use-refund {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
  width: fit-content;
  min-width: 0;
  min-height: 0;
  margin-top: 3px;
  padding: 2px 5px;
  font-size: .6rem;
  font-weight: 600;
  line-height: 1.2;
}
.ct-table .ct-use-refund:hover {
  background: #166534;
  border-color: #166534;
}
.ct-table .ct-use-refund:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.ct-table .ct-pending-collection-input {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}
.ct-table .ct-cell-note .ct-refund-credit {
  max-width: none;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-left: 2px solid currentColor;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ct-table th[data-column-id="notes"],
.ct-table .ct-cell-note {
  min-width: 360px;
  width: 380px;
  max-width: none;
}
.ct-table .ct-refund-summary {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.5;
}
.ct-table .ct-refund-references {
  display: block;
  margin-top: 3px;
  font-size: .66rem;
  line-height: 1.4;
  color: var(--text-secondary);
}
.ct-hidden-columns {
  border-color: var(--brand);
  color: var(--text-primary);
}
.ct-column-visible:has(input:disabled) {
  color: var(--text-secondary);
  cursor: not-allowed;
}
.ct-column-visibility-help {
  margin: 0;
  padding: 8px 12px;
  font-size: .75rem;
  line-height: 1.4;
  color: var(--text-secondary);
}
.ct-table .ct-funded-collection {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}
.ct-table .ct-use-refund:disabled {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.ct-table .ct-refund-details {
  display: block;
  width: fit-content;
  margin: 4px 0 0 auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: .65rem;
  text-decoration: underline;
  cursor: pointer;
}
.ct-refund-dialog .ct-refund-transfer {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}
.ct-refund-transfer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.ct-refund-transfer-label {
  display: block;
  margin-bottom: 3px;
  font-size: .7rem;
  color: var(--text-secondary);
}
.ct-refund-transfer header strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.ct-refund-transfer dl {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ct-refund-transfer dt {
  margin-bottom: 5px;
  font-size: .7rem;
  color: var(--text-secondary);
}
.ct-refund-transfer dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ct-refund-transfer dd strong,
.ct-refund-transfer dd span {
  display: block;
  font-size: .76rem;
  line-height: 1.5;
}
.ct-refund-transfer dd span {
  margin-top: 3px;
  font-size: .68rem;
  color: var(--text-secondary);
}
@media (max-width: 520px) {
  .ct-refund-transfer dl { grid-template-columns: 1fr; }
}
.ct-refund-proof { min-width:150px;max-width:240px; }
.ct-refund-proof-item { display:grid;gap:6px;padding:6px 0;border-bottom:1px solid var(--border); }
.ct-refund-proof-item:last-child { border-bottom:0; }
.ct-refund-proof-item>a { display:flex;align-items:center;gap:7px;min-width:0;color:var(--text-primary);text-decoration:none; }
.ct-refund-proof-item>a img { width:38px;height:38px;flex:0 0 38px;object-fit:cover;border:1px solid var(--border);border-radius:5px; }
.ct-refund-proof-item>a span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.68rem; }
.ct-refund-proof-item .btn { justify-self:start;padding:3px 7px;font-size:.65rem; }
.ct-refund-proof-upload { display:grid;gap:7px;margin-top:12px;padding:10px;border:1px solid var(--border);border-radius:8px;background:var(--bg-elevated); }
.ct-refund-proof-upload>strong { font-size:.78rem; }
.ct-refund-proof-upload>p { margin:0;color:var(--text-secondary);font-size:.72rem;line-height:1.45; }
.ct-refund-proof-upload>input { font-size:.72rem; }
.ct-refund-proof-status { min-height:1em;color:var(--text-muted);font-size:.7rem; }
.ct-refund-proof-list { display:flex;gap:5px;flex-wrap:wrap; }
.ct-refund-proof-list>label { display:flex;align-items:center;gap:5px;max-width:100%;padding:3px 6px;border-radius:999px;background:var(--bg-surface);font-size:.66rem; }
.ct-refund-proof-list>label span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
