/* ============================================================
   SUSUPRO — Main Stylesheet
   Modern Fintech / Banking UI
   ============================================================ */

/* ── FONTS & VARIABLES ──────────────────────────────────────── */
:root {
  --font-body:   'DM Sans', sans-serif;
  --font-head:   'Syne', sans-serif;

  /* Dark theme (default) */
  --bg:          #0d1117;
  --bg2:         #0f1420;
  --card:        #161b27;
  --card2:       #1c2333;
  --border:      #21293d;
  --border2:     #2a3450;
  --text:        #e6edf3;
  --text2:       #8b949e;
  --text3:       #6e7681;

  --primary:     #6366f1;
  --primary-d:   #4f46e5;
  --primary-g:   linear-gradient(135deg,#6366f1,#8b5cf6);
  --success:     #22c55e;
  --success-g:   linear-gradient(135deg,#00d4aa,#059669);
  --danger:      #f43f5e;
  --danger-g:    linear-gradient(135deg,#f43f5e,#e11d48);
  --warning:     #f59e0b;
  --warning-g:   linear-gradient(135deg,#f59e0b,#d97706);
  --info:        #0ea5e9;
  --purple:      #a855f7;

  --sidebar-w:   240px;
  --topbar-h:    60px;
  --radius:      12px;
  --radius-lg:   18px;
  --shadow:      0 4px 24px rgba(0,0,0,.35);
  --shadow-lg:   0 12px 48px rgba(0,0,0,.5);
  --transition:  .2s cubic-bezier(.4,0,.2,1);
}

[data-theme="light"] {
  --bg:    #f0f4f8;
  --bg2:   #e8edf4;
  --card:  #ffffff;
  --card2: #f8fafc;
  --border:#e2e8f0;
  --border2:#cbd5e1;
  --text:  #1a202c;
  --text2: #64748b;
  --text3: #94a3b8;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.12);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--purple); }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

#sidebar.collapsed { width: 68px; }
#sidebar.collapsed .brand-name,
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .user-info { display: none; }
#sidebar.collapsed .badge-pill { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
#sidebar.collapsed .sidebar-user { justify-content: center; }
#sidebar.collapsed .user-avatar { margin: 0; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--primary-g);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 18px; font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text2);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
  margin-bottom: 2px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  position: relative;
}

.nav-item i { font-size: 18px; flex-shrink: 0; }

.nav-item:hover {
  background: var(--card2);
  color: var(--text);
}

.nav-item.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
}

.badge-pill {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* User at bottom */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary-g);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text2); text-transform: capitalize; }

/* ── MAIN WRAP ──────────────────────────────────────────────── */
#main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

#main-wrap.expanded { margin-left: 68px; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
#topbar {
  position: sticky; top: 0; z-index: 900;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 16px; font-weight: 700;
  color: var(--text);
  flex: 1;
  margin: 0;
}

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topbar-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--border); color: var(--text); }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
}

.mini-avatar {
  width: 28px; height: 28px;
  background: var(--primary-g);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}

/* ── NOTIFICATION DROPDOWN ──────────────────────────────────── */
.notif-dropdown { width: 320px; max-height: 420px; overflow-y: auto; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px;
}
.mark-read-link { font-size: 12px; color: var(--primary); }
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--card2); }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.notif-title { font-size: 13px; color: var(--text); }
.notif-time  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text3); font-size: 13px; }

/* ── CONTENT ────────────────────────────────────────────────── */
#content { flex: 1; padding: 24px; }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}

.page-header h2 {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 800;
  color: var(--text); margin: 0;
}

.page-header p { margin: 4px 0 0; color: var(--text2); font-size: 13px; }

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--sc-color, var(--primary));
  opacity: .1;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--sc-color, var(--primary)) 15%, transparent);
  color: var(--sc-color, var(--primary));
  margin-bottom: 14px;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }
.stat-sub   { font-size: 11px; color: var(--sc-color, var(--primary)); margin-top: 4px; font-weight: 600; }

.stat-trend {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 12px; font-weight: 700;
}
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.card-box-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-box-head h5 {
  font-family: var(--font-head);
  font-size: 15px; font-weight: 700;
  color: var(--text); margin: 0;
}

.card-box-body { padding: 20px; }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl thead tr {
  border-bottom: 2px solid var(--border);
}

.tbl thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  white-space: nowrap;
}

.tbl tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.tbl tbody tr:hover { background: var(--card2); }
.tbl tbody tr:last-child { border-bottom: none; }

.tbl td {
  padding: 13px 14px;
  color: var(--text);
  white-space: nowrap;
}

.tbl td.code { color: var(--primary); font-weight: 700; font-family: monospace; }
.tbl td.amount-pos { color: var(--success); font-weight: 700; }
.tbl td.amount-neg { color: var(--danger);  font-weight: 700; }
.tbl td.amount     { font-weight: 700; }

.tbl-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
}

.tbl-empty i { font-size: 40px; display: block; margin-bottom: 10px; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.badge-active    { background: #22c55e20; color: #22c55e; }
.badge-suspended { background: #f59e0b20; color: #f59e0b; }
.badge-closed    { background: #6e768120; color: #8b949e; }
.badge-pending   { background: #6366f120; color: #6366f1; }
.badge-approved  { background: #22c55e20; color: #22c55e; }
.badge-overdue   { background: #f43f5e20; color: #f43f5e; }
.badge-rejected  { background: #f43f5e20; color: #f43f5e; }
.badge-processed { background: #0ea5e920; color: #0ea5e9; }
.badge-admin     { background: #f59e0b20; color: #f59e0b; }
.badge-manager   { background: #a855f720; color: #a855f7; }
.badge-collector { background: #6366f120; color: #6366f1; }
.badge-cash      { background: #22c55e20; color: #22c55e; }
.badge-momo      { background: #f59e0b20; color: #f59e0b; }
.badge-bank      { background: #0ea5e920; color: #0ea5e9; }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-control, .form-select {
  background: var(--bg) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  color: var(--text) !important;
  font-size: 14px !important;
  font-family: var(--font-body) !important;
  transition: border-color var(--transition), box-shadow var(--transition) !important;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent) !important;
  outline: none !important;
  background: var(--bg) !important;
  color: var(--text) !important;
}

.form-control::placeholder { color: var(--text3) !important; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all var(--transition) !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary-g) !important; color: #fff !important; }
.btn-success { background: var(--success-g) !important; color: #fff !important; }
.btn-danger  { background: var(--danger-g)  !important; color: #fff !important; }
.btn-warning { background: var(--warning-g) !important; color: #fff !important; }

.btn-ghost {
  background: var(--card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text2) !important;
}
.btn-ghost:hover { color: var(--text) !important; background: var(--border) !important; }

.btn-sm { font-size: 12px !important; padding: 6px 12px !important; }

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-content {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 22px !important;
}

.modal-title {
  font-family: var(--font-head) !important;
  font-weight: 700 !important;
}

.modal-footer { border-top: 1px solid var(--border) !important; }

.btn-close { filter: invert(1); }
[data-theme="light"] .btn-close { filter: none; }

/* ── SEARCH BAR ─────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-wrap i {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 15px;
  pointer-events: none;
}

.search-wrap .form-control {
  padding-left: 38px !important;
}

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination-wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.pagination-info { color: var(--text2); }

.page-link {
  background: var(--card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text2) !important;
  border-radius: 8px !important;
  margin: 0 2px !important;
  transition: all var(--transition) !important;
}

.page-link:hover, .page-item.active .page-link {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* ── RECEIPT PRINT ──────────────────────────────────────────── */
.receipt-box {
  background: #fff;
  color: #111;
  font-family: 'Courier New', monospace;
  border-radius: 12px;
  padding: 30px;
  max-width: 380px;
  margin: 0 auto;
  border: 2px dashed #ddd;
}

.receipt-box .receipt-logo { text-align: center; font-size: 30px; margin-bottom: 6px; }
.receipt-box .receipt-co   { text-align: center; font-weight: 800; font-size: 16px; }
.receipt-box .receipt-sub  { text-align: center; font-size: 11px; color: #666; margin-bottom: 16px; }
.receipt-box .receipt-line { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.receipt-box .receipt-divider { border-top: 1px dashed #ccc; margin: 12px 0; }
.receipt-box .receipt-total { font-size: 22px; font-weight: 800; text-align: center; color: #1a1a1a; margin: 12px 0; }
.receipt-box .receipt-footer { text-align: center; font-size: 11px; color: #888; margin-top: 16px; }

@media print {
  #sidebar, #topbar, .no-print, .btn, .modal-footer { display: none !important; }
  #main-wrap { margin-left: 0 !important; }
  #content    { padding: 0 !important; }
  .receipt-box { border: none; }
}

/* ── INFO BOXES ─────────────────────────────────────────────── */
.info-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
}

.info-box-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 4px;
}

.info-box-val { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── PROGRESS ────────────────────────────────────────────────── */
.progress-custom {
  background: var(--border);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-custom {
  height: 100%;
  border-radius: 8px;
  transition: width 1s ease;
}

/* ── ALERTS / TOAST ─────────────────────────────────────────── */
.alert {
  border-radius: 12px !important;
  border-left: 4px solid;
  font-size: 14px;
}

/* ── CHART CONTAINERS ───────────────────────────────────────── */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap-sm { position: relative; height: 180px; }

/* ── AVATAR ──────────────────────────────────────────────────── */
.avatar-lg {
  width: 72px; height: 72px;
  background: var(--primary-g);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; font-weight: 800;
  flex-shrink: 0;
}

.avatar-sm {
  width: 36px; height: 36px;
  background: var(--primary-g);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}

/* ── DROPDOWN MENU ───────────────────────────────────────────── */
.dropdown-menu {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 6px !important;
  font-size: 14px !important;
}

.dropdown-item {
  color: var(--text2) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  transition: all var(--transition) !important;
}

.dropdown-item:hover {
  background: var(--card2) !important;
  color: var(--text) !important;
}

.dropdown-item.text-danger { color: var(--danger) !important; }
.dropdown-divider { border-color: var(--border) !important; margin: 4px 0 !important; }

/* ── PROFILE PAGE ────────────────────────────────────────────── */
.profile-header {
  display: flex; align-items: center; gap: 20px;
  background: var(--card2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

/* ── DASHBOARD GRID ──────────────────────────────────────────── */
.dashboard-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dashboard-grid-2x { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-blob-1 {
  width: 500px; height: 500px;
  top: -150px; left: -150px;
  background: radial-gradient(circle, #6366f135, transparent 70%);
}

.login-blob-2 {
  width: 400px; height: 400px;
  bottom: -100px; right: -100px;
  background: radial-gradient(circle, #00d4aa25, transparent 70%);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 64px; height: 64px;
  background: var(--primary-g);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 992px) {
  #sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  #sidebar.mobile-open { transform: translateX(0); }
  #main-wrap, #main-wrap.expanded { margin-left: 0; }
  .dashboard-grid-2, .dashboard-grid-2x { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  #content { padding: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .login-card { padding: 32px 20px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ── UTILITY ─────────────────────────────────────────────────── */
.text-primary-c { color: var(--primary) !important; }
.text-success-c { color: var(--success) !important; }
.text-danger-c  { color: var(--danger)  !important; }
.text-warning-c { color: var(--warning) !important; }
.text-muted-c   { color: var(--text2)   !important; }
.fw-head        { font-family: var(--font-head) !important; }
.bg-card        { background: var(--card) !important; }
.border-custom  { border-color: var(--border) !important; }
.rounded-custom { border-radius: var(--radius) !important; }
.gap-btn        { display: flex; gap: 8px; flex-wrap: wrap; }
