/* ============================================================
   PAK INSTALLMENT ERP — Professional UI/UX Design System
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --dark: #0f172a;
  --sidebar-bg: #0f172a;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --card-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: var(--topbar-height);
}
.sidebar-brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.sidebar-brand-text { overflow: hidden; }
.sidebar-brand-name {
  font-size: 14px; font-weight: 700;
  color: #fff; white-space: nowrap;
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: 11px; color: #64748b;
  white-space: nowrap;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600;
  color: #475569; text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 20px 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: #94a3b8;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
  position: relative;
  white-space: nowrap;
}
.sidebar-item:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}
.sidebar-item.active {
  color: #fff;
  background: rgba(79,70,229,.2);
}
.sidebar-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 0 2px 2px 0;
}
.sidebar-item-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-item-text { font-size: 13.5px; font-weight: 500; }
.sidebar-item-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 10px;
  font-weight: 600;
}
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.sidebar-user-role { font-size: 11px; color: #64748b; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 900;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.topbar-toggle {
  width: 36px; height: 36px;
  border: none; background: #f8fafc;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 18px;
  transition: var(--transition);
}
.topbar-toggle:hover { background: #f1f5f9; color: var(--primary); }
.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb h1 {
  font-size: 18px; font-weight: 700; color: #0f172a;
  line-height: 1;
}
.topbar-breadcrumb p { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px;
  border: none; background: #f8fafc;
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 16px;
  transition: var(--transition); position: relative;
}
.topbar-btn:hover { background: #f1f5f9; color: var(--primary); }
.topbar-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid #fff;
}
.topbar-date {
  font-size: 12px; color: #94a3b8;
  padding: 6px 12px;
  background: #f8fafc; border-radius: 8px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
  transition: var(--transition);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f1f5f9;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.stat-card-value {
  font-size: 26px; font-weight: 800;
  color: #0f172a; line-height: 1;
  margin-bottom: 4px;
}
.stat-card-label {
  font-size: 12px; color: #94a3b8;
  font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-card-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  margin-top: 8px;
}
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }
.stat-card-bg {
  position: absolute; right: -10px; bottom: -10px;
  font-size: 80px; opacity: .04; line-height: 1;
}
.stat-card.green .stat-card-icon { background: #d1fae5; color: var(--success); }
.stat-card.blue .stat-card-icon { background: #dbeafe; color: var(--info); }
.stat-card.orange .stat-card-icon { background: #fef3c7; color: var(--warning); }
.stat-card.red .stat-card-icon { background: #fee2e2; color: var(--danger); }
.stat-card.purple .stat-card-icon { background: #ede9fe; color: var(--primary); }
.stat-card.cyan .stat-card-icon { background: #cffafe; color: var(--secondary); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h5, .card-header h6 {
  font-size: 15px; font-weight: 700;
  color: #0f172a; margin: 0;
}
.card-body { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid #f1f5f9;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table { margin: 0; }
.table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  border-top: none;
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  color: #334155;
  font-size: 13.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbff; }
.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.table-striped tbody tr:nth-of-type(odd):hover { background: #fafbff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  letter-spacing: .02em;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #ede9fe; color: #4338ca; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.bg-success { background: #d1fae5 !important; color: #065f46 !important; }
.bg-danger { background: #fee2e2 !important; color: #991b1b !important; }
.bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.bg-info { background: #dbeafe !important; color: #1e40af !important; }
.bg-primary { background: #ede9fe !important; color: #4338ca !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 8px;
  border: none; cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
  line-height: 1.4;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #312e81);
  box-shadow: 0 6px 16px rgba(79,70,229,.4);
  transform: translateY(-1px); color: #fff;
}
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 16px rgba(16,185,129,.4);
  transform: translateY(-1px); color: #fff;
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.3);
}
.btn-danger:hover { transform: translateY(-1px); color: #fff; }
.btn-secondary {
  background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0;
}
.btn-secondary:hover { background: #e2e8f0; color: #334155; }
.btn-outline-primary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  font-size: 12px; font-weight: 600;
  color: #475569; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-control, .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #334155;
  background: #fff;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  outline: none;
}
.form-control::placeholder { color: #cbd5e1; }
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: #94a3b8; font-size: 16px; z-index: 1;
}
.input-group .form-control { padding-left: 38px; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  border: none; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }
.alert-light { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-bg-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-bg-shapes .shape {
  position: absolute; border-radius: 50%;
  background: linear-gradient(135deg, rgba(79,70,229,.15), rgba(6,182,212,.1));
  filter: blur(60px);
}
.login-bg-shapes .shape-1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.login-bg-shapes .shape-2 { width: 300px; height: 300px; bottom: -80px; right: -80px; }
.login-bg-shapes .shape-3 { width: 200px; height: 200px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.login-card {
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,.5);
  position: relative; z-index: 1;
}
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
}
.login-title {
  font-size: 24px; font-weight: 800;
  color: #fff; text-align: center; margin-bottom: 4px;
}
.login-subtitle {
  font-size: 13px; color: #94a3b8;
  text-align: center; margin-bottom: 28px;
}
.login-card .form-label { color: #94a3b8; }
.login-card .form-control {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: #fff;
}
.login-card .form-control:focus {
  background: rgba(255,255,255,.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}
.login-card .form-control::placeholder { color: #475569; }
.login-card .input-icon { color: #475569; }
.login-btn {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(79,70,229,.4);
  margin-top: 8px;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,.5);
}
.login-footer { text-align: center; margin-top: 20px; color: #475569; font-size: 12px; }

/* ============================================================
   DATATABLES OVERRIDE
   ============================================================ */
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 7px 12px; font-size: 13px;
  transition: var(--transition);
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  outline: none;
}
.dataTables_wrapper .dataTables_length select {
  border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 6px 10px; font-size: 13px;
}
.dataTables_wrapper .dataTables_info { font-size: 12px; color: #94a3b8; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important; font-size: 12px !important;
  padding: 4px 10px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: var(--primary) !important;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
  height: 6px; border-radius: 3px;
  background: #f1f5f9; overflow: hidden;
}
.progress-bar {
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .6s ease;
}

/* ============================================================
   QUICK ACTION CARDS
   ============================================================ */
.quick-action {
  background: #fff; border-radius: 12px;
  padding: 16px; text-align: center;
  border: 1.5px solid #f1f5f9;
  cursor: pointer; transition: var(--transition);
  display: block;
}
.quick-action:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(79,70,229,.12);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: 10px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.quick-action-label { font-size: 12px; font-weight: 600; color: #475569; }

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container { position: relative; }
canvas { max-width: 100%; }

/* ============================================================
   RECENT ACTIVITY
   ============================================================ */
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-title { font-size: 13px; font-weight: 600; color: #334155; }
.activity-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ============================================================
   PAYMENT MODAL CARD
   ============================================================ */
.payment-panel {
  background: linear-gradient(135deg, #f8faff, #fff);
  border: 1.5px solid #e0e7ff;
  border-radius: 16px; padding: 24px;
  margin-top: 20px;
}
.payment-panel-title {
  font-size: 16px; font-weight: 700;
  color: #0f172a; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 576px) {
  .main-content { padding: 16px; }
  .stat-card-value { font-size: 22px; }
  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
}

/* ============================================================
   QUICK ACTIONS BAR (Top of Dashboard)
   ============================================================ */
/* ── Quick Actions Bar ─────────────────────────────────────── */
.quick-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 50%, #f1f5f9 100%);
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.quick-actions-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981, #f59e0b, #ef4444);
  border-radius: 18px 18px 0 0;
}

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: .02em;
  border: none;
  cursor: pointer;
}
.qa-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}
.qa-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,.2);
  color: #fff;
}
.qa-btn:active {
  transform: translateY(-1px) scale(.98);
}
.qa-btn i {
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  flex-shrink: 0;
  transition: all .3s;
}
.qa-btn:hover i {
  background: rgba(255,255,255,.3);
  transform: scale(1.1);
}
.qa-btn span {
  display: inline;
  position: relative;
  z-index: 1;
}

.qa-customer { background: linear-gradient(135deg, #4f46e5, #6366f1); box-shadow: 0 4px 15px rgba(79,70,229,.35); }
.qa-sale { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 4px 15px rgba(16,185,129,.35); }
.qa-payment { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 4px 15px rgba(245,158,11,.35); }
.qa-inventory { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 4px 15px rgba(59,130,246,.35); }
.qa-supplier { background: linear-gradient(135deg, #06b6d4, #22d3ee); box-shadow: 0 4px 15px rgba(6,182,212,.35); }
.qa-expense { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 4px 15px rgba(239,68,68,.35); }
.qa-approve { background: linear-gradient(135deg, #8b5cf6, #a78bfa); box-shadow: 0 4px 15px rgba(139,92,246,.35); animation: pulse-approve 2.5s infinite; }

@keyframes pulse-approve {
  0%, 100% { box-shadow: 0 4px 15px rgba(139,92,246,.35), 0 0 0 0 rgba(139,92,246,.4); }
  50% { box-shadow: 0 4px 25px rgba(139,92,246,.45), 0 0 0 10px rgba(139,92,246,0); }
}

.qa-btn .qa-badge {
  background: #fff;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 20px;
  line-height: 1.4;
  margin-left: 2px;
}

@media (max-width: 768px) {
  .quick-actions-bar { padding: 14px 16px; gap: 8px; }
  .qa-btn { padding: 9px 14px 9px 11px; font-size: 12px; }
  .qa-btn i { width: 24px; height: 24px; font-size: 14px; }
}
@media (max-width: 576px) {
  .qa-btn span { display: none; }
  .qa-btn { padding: 10px 12px; }
  .qa-btn i { width: 28px; height: 28px; font-size: 16px; }
}

/* Quick Actions — professional grid layout */
.quick-actions-wrap {
  margin-bottom: 24px;
}
.quick-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.quick-actions-header h6 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
}
.quick-actions-header h6 i {
  color: #4f46e5;
  margin-right: 6px;
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}
.qa-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  transition: all .28s cubic-bezier(.34, 1.2, .64, 1);
  border: 1px solid rgba(255,255,255,.12);
  position: relative;
  overflow: hidden;
  min-height: 88px;
}
.qa-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.qa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  color: #fff;
}
.qa-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.qa-card-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}
.qa-card-sub {
  font-size: 10px;
  opacity: .8;
  font-weight: 500;
  margin-top: -4px;
}
.qa-card.qa-customer { background: linear-gradient(145deg, #4f46e5, #3730a3); }
.qa-card.qa-sale { background: linear-gradient(145deg, #059669, #10b981); }
.qa-card.qa-payment { background: linear-gradient(145deg, #d97706, #f59e0b); }
.qa-card.qa-agreement { background: linear-gradient(145deg, #7c3aed, #8b5cf6); }
.qa-card.qa-installment { background: linear-gradient(145deg, #0891b2, #06b6d4); }
.qa-card.qa-inventory { background: linear-gradient(145deg, #2563eb, #3b82f6); }
.qa-card.qa-supplier { background: linear-gradient(145deg, #0d9488, #14b8a6); }
.qa-card.qa-expense { background: linear-gradient(145deg, #dc2626, #ef4444); }
.qa-card.qa-approve { background: linear-gradient(145deg, #9333ea, #a855f7); animation: pulse-approve 2.5s infinite; }
.qa-card .qa-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Table row action buttons */
.tbl-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.tbl-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  padding: 0;
  line-height: 1;
}
.tbl-act:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  color: inherit;
}
.tbl-act-edit { background: #f1f5f9; color: #475569; }
.tbl-act-edit:hover { background: #e2e8f0; color: #334155; }
.tbl-act-print { background: #dbeafe; color: #1d4ed8; }
.tbl-act-print:hover { background: #bfdbfe; color: #1e40af; }
.tbl-act-wa { background: #dcfce7; color: #16a34a; }
.tbl-act-wa:hover { background: #bbf7d0; color: #15803d; }
.tbl-act-delete { background: #fee2e2; color: #dc2626; }
.tbl-act-delete:hover { background: #fecaca; color: #b91c1c; }
.tbl-act-collect { background: #ede9fe; color: #6d28d9; }
.tbl-act-collect:hover { background: #ddd6fe; color: #5b21b6; }
.tbl-act-khata { background: #f1f5f9; color: #64748b; }
.tbl-act-khata:hover { background: #e2e8f0; color: #475569; }

/* ============================================================
   DASHBOARD TABS
   ============================================================ */
.dash-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  transition: var(--transition);
  text-decoration: none;
}
.dash-tab:hover { background: #e2e8f0; color: #334155; }
.dash-tab.active {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.dash-tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 4px;
}

/* ============================================================
   STAT CARD LINKS
   ============================================================ */
.stat-card-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
}
.stat-card-link:hover .stat-card {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  cursor: pointer;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: #94a3b8 !important; }
.fw-700 { font-weight: 700; }
.rounded-xl { border-radius: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 20px; font-weight: 800; color: #0f172a; }
.section-header p { font-size: 13px; color: #94a3b8; margin-top: 2px; }
