:root {
  --sidebar-width: 240px;
  --navbar-height: 56px;
  --sidebar-bg: #16191f;
  --sidebar-hover-bg: rgba(255,255,255,.06);
  --sidebar-active-bg: rgba(246,201,14,.13);
  --sidebar-active-color: #f6c90e;
  --sidebar-text: #b0b7c3;
  --sidebar-label: #555f6e;
  --sidebar-border: rgba(255,255,255,.07);
  --accent: #f6c90e;
}

* { box-sizing: border-box; }

body {
  background: #f0f2f5;
  font-family: 'Segoe UI', system-ui, sans-serif;
  padding-top: var(--navbar-height);
}

/* ── Layout wrapper ── */
.wrapper { display: flex; min-height: calc(100vh - var(--navbar-height)); }

/* ── Sidebar shell ── */
#sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  background: var(--sidebar-bg);
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

/* ── Scrollable nav area ── */
#sidebar .sidebar-inner {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem 0;
  /* thin custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
#sidebar .sidebar-inner::-webkit-scrollbar { width: 4px; }
#sidebar .sidebar-inner::-webkit-scrollbar-track { background: transparent; }
#sidebar .sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}

/* ── Section labels ── */
#sidebar .sidebar-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-label);
  padding: .9rem 1.1rem .35rem;
  display: block;
}

/* ── Nav links ── */
#sidebar .nav-link {
  display: flex;
  align-items: center;
  color: var(--sidebar-text);
  padding: .55rem 1rem .55rem 1.1rem;
  margin: 1px .5rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 400;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
#sidebar .nav-link i {
  width: 20px;
  font-size: .9rem;
  text-align: center;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity .15s;
}
#sidebar .nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}
#sidebar .nav-link:hover i { opacity: 1; }

#sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
  font-weight: 600;
  border-left-color: var(--sidebar-active-color);
}
#sidebar .nav-link.active i { opacity: 1; }

/* ── User footer — pinned at bottom ── */
#sidebar .sidebar-footer {
  flex-shrink: 0;
  padding: .85rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0,0,0,.15);
}

/* ── Content area ── */
#content-wrapper {
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
  flex: 1;
  min-height: calc(100vh - var(--navbar-height));
  transition: margin-left .25s ease;
}

body.sidebar-collapsed #sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
body.sidebar-collapsed #content-wrapper { margin-left: 0; }

/* ── Cards ── */
.stat-card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.stat-card .card-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

.card { border: none; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.card-header { border-radius: 14px 14px 0 0 !important; border-bottom: 1px solid rgba(0,0,0,.06); }

/* ── Tables ── */
.table-hover tbody tr:hover { background: rgba(246,201,14,.06); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: #6c757d; font-weight: 600; }

/* ── Avatars ── */
.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  flex-shrink: 0;
}

/* ── Badges ── */
.badge { font-weight: 500; font-size: .73rem; padding: .35em .65em; }

/* ── Page header ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap; gap: .5rem;
}
.page-header h4 { margin: 0; font-weight: 700; }

/* ── Forms ── */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #dee2e6;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(246,201,14,.2);
}

/* ── Buttons ── */
.btn { border-radius: 8px; font-size: .875rem; font-weight: 500; }
.btn-warning { color: #000; }

/* ── Money Order / Receipt ── */
.receipt-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 2rem;
}
.receipt-header { border-bottom: 3px solid var(--accent); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.receipt-company-name { font-size: 1.5rem; font-weight: 800; color: #1a1d23; }
.receipt-sub { font-size: .85rem; color: #6c757d; }

.receipt-table { width: 100%; border-collapse: collapse; }
.receipt-table th, .receipt-table td { padding: .5rem .75rem; border: 1px solid #dee2e6; font-size: .9rem; }
.receipt-table th { background: #f8f9fa; font-weight: 600; }

.receipt-total-row { font-size: 1rem; font-weight: 700; background: #fff9e6; }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    box-shadow: none;
  }
  #content-wrapper { margin-left: 0; }
  body.sidebar-open #sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.35);
  }
}


/* ── Commission Status ── */
.comm-pending { color: #fd7e14; }
.comm-paid    { color: #198754; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1d23 0%, #2d3748 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { font-size: 2.5rem; color: var(--accent); }
