/* ============================================================
   BizTech Transport — Main Stylesheet (Final)
   With Mobile Hamburger Sidebar
   ============================================================ */

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: #eef2f7;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 13px;
  color: #333;
  margin: 0;
  padding: 0;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ===== Sidebar ===== */
.sidebar {
  width: 210px;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #1e293b;
  font-size: 13px;
  z-index: 1000;
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.sidebar .brand {
  padding: 14px 14px 12px;
  border-bottom: 1px solid #334155;
  position: relative;
}
.sidebar .brand h6 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sidebar .brand h6 i { color: #60a5fa; }
.sidebar .brand small {
  color: #94a3b8;
  font-size: 11px;
  display: block;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 30px;
}

.sidebar ul {
  list-style: none;
  padding: 8px 6px 20px;
  margin: 0;
}
.sidebar ul > li { margin-bottom: 2px; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 500;
  transition: .15s;
  position: relative;
}
.sidebar a:hover {
  background: #334155;
  color: #fff;
}
.sidebar a.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.sidebar a i { font-size: 14px; width: 16px; text-align: center; }
.sidebar a.text-danger { color: #f87171 !important; }
.sidebar a.text-danger:hover { background: #7f1d1d; color: #fff; }

/* Mobile close button (hidden on desktop) */
.mobile-close-btn {
  display: none;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: 210px;
  padding: 14px 16px;
  min-height: 100vh;
}
.page-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.2px;
}
.page-title i { color: #2563eb; font-size: 17px; }

/* ===== Cards ===== */
.card {
  border: none;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  background: #fff;
  margin-bottom: 10px;
}
.card-body { padding: 12px 14px; }
.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 9px 9px 0 0 !important;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-header i { color: #2563eb; }

/* ===== Form Controls ===== */
.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.form-label.mb-1 {
  font-size: 10.5px;
  margin-bottom: 2px !important;
}
.form-control, .form-select {
  font-size: 13px;
  padding: 5px 10px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #1e293b;
  background-color: #fff;
  transition: .15s;
}
.form-control:focus, .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.form-control-sm, .form-select-sm {
  font-size: 12.5px;
  padding: 4px 8px;
  height: 30px;
}
textarea.form-control { height: auto; min-height: 60px; }
.form-control[readonly] {
  background: #f8fafc;
  color: #475569;
  cursor: default;
}
.input-group-text {
  font-size: 12.5px;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
  font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 7px;
  font-weight: 500;
  transition: .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-sm { font-size: 11.5px; padding: 3px 8px; }
.btn-primary { background: #2563eb; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-primary:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-danger { background: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-info { background: #0891b2; border-color: #0891b2; }
.btn-info:hover { background: #0e7490; border-color: #0e7490; }
.btn-secondary { background: #64748b; border-color: #64748b; }
.btn-secondary:hover { background: #475569; border-color: #475569; }
.btn-outline-primary { color: #2563eb; border-color: #2563eb; background: transparent; }
.btn-outline-primary:hover { background: #2563eb; color: #fff; }
.btn-outline-success { color: #16a34a; border-color: #16a34a; background: transparent; }
.btn-outline-success:hover { background: #16a34a; color: #fff; }
.btn-outline-danger { color: #dc2626; border-color: #dc2626; background: transparent; }
.btn-outline-danger:hover { background: #dc2626; color: #fff; }
.btn-outline-secondary { color: #64748b; border-color: #cbd5e1; background: transparent; }
.btn-outline-secondary:hover { background: #f1f5f9; color: #1e293b; }
.btn:disabled, .btn.disabled { opacity: .6; cursor: not-allowed; }

/* ===== Tables ===== */
.table {
  font-size: 12.5px;
  margin-bottom: 0;
  color: #1e293b;
}
.table thead th {
  background: #f1f5f9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #475569;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
}
.table tbody td {
  padding: 7px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot td {
  padding: 8px 10px;
  border-top: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
}
.table tr.table-warning { background: #fef3c7 !important; }

/* ===== Badges ===== */
.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: .2px;
  display: inline-block;
}
.badge-UD { background: #fef3c7; color: #92400e; }
.badge-DL { background: #dcfce7; color: #166534; }
.badge.bg-primary { background: #2563eb !important; color: #fff; }
.badge.bg-secondary { background: #64748b !important; color: #fff; }
.badge.bg-success { background: #16a34a !important; color: #fff; }
.badge.bg-danger { background: #dc2626 !important; color: #fff; }
.badge.bg-warning { background: #f59e0b !important; color: #fff; }

/* ===== Stat Cards ===== */
.stat-card {
  border-radius: 11px;
  color: #fff;
  padding: 15px 17px;
  position: relative;
  overflow: hidden;
  min-height: 82px;
  transition: transform .2s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card h6 {
  font-size: 11px;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .9;
  font-weight: 600;
}
.stat-card h3 {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.1;
}
.stat-card.blue   { background: linear-gradient(135deg,#4e73df,#224abe); }
.stat-card.green  { background: linear-gradient(135deg,#1cc88a,#13855c); }
.stat-card.orange { background: linear-gradient(135deg,#f6c23e,#dda20a); }
.stat-card.red    { background: linear-gradient(135deg,#e74a3b,#be2617); }
.stat-card.purple { background: linear-gradient(135deg,#8b5cf6,#6d28d9); }
.stat-card i {
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 34px;
  opacity: .2;
  color: #fff;
}

/* ===== Info Mini Cards ===== */
.info-mini {
  background: #fff;
  padding: 10px 14px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid #e2e8f0;
  min-height: 46px;
}
.info-mini .label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.info-mini .label i { font-size: 12px; }
.info-mini .value {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.section-title i { color: #2563eb; font-size: 13px; }

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.section-label i { color: #2563eb; font-size: 13px; }

/* ===== Autocomplete Suggestions ===== */
#goods_suggest .list-group-item,
#d_goods_suggest .list-group-item {
  font-size: 12.5px;
  padding: 6px 10px;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #f1f5f9;
}
#goods_suggest .list-group-item:last-child,
#d_goods_suggest .list-group-item:last-child {
  border-bottom: none;
}
#goods_suggest .list-group-item.active,
#goods_suggest .list-group-item:hover,
#d_goods_suggest .list-group-item.active,
#d_goods_suggest .list-group-item:hover {
  background: #2563eb;
  color: #fff;
}

/* ===== Alerts ===== */
.alert {
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
}
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ===== Login Page ===== */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  border: none;
}
.login-card .card-body { padding: 30px 26px; }
.login-card h4 {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-card h4 i { color: #2563eb; font-size: 24px; }
.login-card small {
  display: block;
  text-align: center;
  color: #64748b;
  margin-bottom: 20px;
  font-size: 12.5px;
}
.login-card .form-control { height: 38px; font-size: 13.5px; }
.login-card .btn { height: 40px; font-size: 13.5px; font-weight: 600; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #fff;
  padding: 6px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: .15s;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}
.filter-btn:hover {
  background: #f1f5f9;
  color: #2563eb;
}
.filter-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.filter-btn.active:hover {
  background: #1d4ed8;
  color: #fff;
}
.filter-btn i { font-size: 14px; }

/* ============================================================
   Reports Hub — Compact Cards
   ============================================================ */
.reports-hero {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 20px rgba(30,41,59,.2);
}
.reports-hero .hero-icon {
  width: 46px;
  height: 46px;
  background: rgba(96,165,250,.2);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #60a5fa;
  flex-shrink: 0;
}
.reports-hero .hero-text h5 {
  margin: 0 0 2px 0;
  font-size: 15px;
  font-weight: 700;
}
.reports-hero .hero-text p {
  margin: 0;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.report-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  padding: 12px 13px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: all .22s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
  min-height: 145px;
}
.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #2563eb;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border-color: transparent;
}
.report-card:hover::before { transform: scaleX(1); }

.report-card-orange::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.report-card-green::before  { background: linear-gradient(90deg, #16a34a, #15803d); }
.report-card-blue::before   { background: linear-gradient(90deg, #2563eb, #1d4ed8); }
.report-card-purple::before { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.report-card-red::before    { background: linear-gradient(90deg, #dc2626, #b91c1c); }
.report-card-teal::before   { background: linear-gradient(90deg, #0891b2, #0e7490); }

.report-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.report-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  background: #64748b;
  flex-shrink: 0;
}
.report-card-orange .report-card-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.report-card-green  .report-card-icon { background: linear-gradient(135deg, #16a34a, #15803d); }
.report-card-blue   .report-card-icon { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.report-card-purple .report-card-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.report-card-red    .report-card-icon { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.report-card-teal   .report-card-icon { background: linear-gradient(135deg, #0891b2, #0e7490); }

.report-card-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}
.report-card-orange .report-card-badge { background: #fef3c7; color: #92400e; }
.report-card-green  .report-card-badge { background: #dcfce7; color: #166534; }
.report-card-blue   .report-card-badge { background: #dbeafe; color: #1e40af; }
.report-card-purple .report-card-badge { background: #ede9fe; color: #5b21b6; }
.report-card-red    .report-card-badge { background: #fee2e2; color: #991b1b; }
.report-card-teal   .report-card-badge { background: #cffafe; color: #155e75; }

.report-card-body {
  flex: 1;
  margin-bottom: 8px;
}
.report-card-body h6 {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 3px 0;
  letter-spacing: -.2px;
}
.report-card-body p {
  font-size: 10.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.report-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.report-stat .stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -.3px;
}
.report-stat .stat-label {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-weight: 600;
  margin-top: 2px;
}
.report-arrow {
  font-size: 10.5px;
  font-weight: 700;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all .2s ease;
}
.report-card:hover .report-arrow {
  opacity: 1;
  transform: translateX(0);
}
.report-arrow i {
  font-size: 11px;
  transition: transform .2s;
}
.report-card:hover .report-arrow i { transform: translateX(3px); }

.tip-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #cbd5e1;
}
.tip-item i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.tip-item b {
  font-size: 12px;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}
.tip-item p {
  font-size: 11px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* ============================================================
   Profit / Loss Report
   ============================================================ */
.pl-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 14px;
  padding: 22px 26px;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  position: relative;
  overflow: hidden;
}
.pl-hero.profit { background: linear-gradient(135deg, #16a34a 0%, #047857 100%); }
.pl-hero.loss   { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.pl-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  pointer-events: none;
}
.pl-hero-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.pl-hero-content { flex: 1; z-index: 1; }
.pl-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: .9;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pl-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}
.pl-sub {
  font-size: 12.5px;
  opacity: .85;
  margin-top: 4px;
}

.pl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}
.pl-row:last-of-type { border-bottom: none; }
.pl-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
}
.pl-row-left i { color: #64748b; font-size: 14px; }
.pl-row-right { color: #0f172a; }
.pl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pl-total-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 0;
  border-top: 2px solid #e2e8f0;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.pl-formula-box {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}
.pl-formula-box.profit { background: #dcfce7; border-color: #16a34a; }
.pl-formula-box.loss   { background: #fee2e2; border-color: #dc2626; }
.pl-formula-lbl {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
  margin-bottom: 4px;
}
.pl-formula-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.pl-month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.pl-month-label {
  width: 75px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}
.pl-month-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pl-bar-wrap {
  height: 10px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}
.pl-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.pl-bar-income  { background: linear-gradient(90deg, #16a34a, #15803d); }
.pl-bar-expense { background: linear-gradient(90deg, #dc2626, #b91c1c); }
.pl-month-val {
  width: 110px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   Mobile Top Bar (with Hamburger)
   ============================================================ */
.mobile-topbar {
  display: none;
  background: #1e293b;
  color: #fff;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.mobile-topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}
.mobile-topbar .brand i {
  color: #60a5fa;
  font-size: 20px;
}
.mobile-topbar .user-info {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 2px;
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 4px 8px;
  margin-right: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: .15s;
  line-height: 1;
  flex-shrink: 0;
}
.hamburger-btn:hover,
.hamburger-btn:active {
  background: rgba(255,255,255,.1);
}

/* Mobile Sidebar Overlay (hidden on desktop) */
.mobile-sidebar-overlay {
  display: none;
}

/* ============================================================
   Mobile Bottom Bar
   ============================================================ */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  border-top: 1px solid #334155;
  z-index: 1050;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
.mobile-bottom-bar .nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.mobile-bottom-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 500;
  padding: 4px 1px;
  border-radius: 8px;
  transition: .15s;
  text-decoration: none;
  gap: 2px;
  min-width: 0;
}
.mobile-bottom-bar a i {
  font-size: 18px;
  line-height: 1;
}
.mobile-bottom-bar a span {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.mobile-bottom-bar a:hover,
.mobile-bottom-bar a.active {
  color: #fff;
  background: #334155;
}
.mobile-bottom-bar a.active i { color: #60a5fa; }
.mobile-bottom-bar a.text-danger { color: #f87171 !important; }
.mobile-bottom-bar a.text-danger.active {
  background: #7f1d1d;
  color: #fff !important;
}

/* ===== Table Wrapper ===== */
.table-responsive-mobile {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.table-responsive-mobile::-webkit-scrollbar { height: 6px; }
.table-responsive-mobile::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.table-responsive-mobile::-webkit-scrollbar-track { background: #f1f5f9; }
.desktop-table { min-width: 640px; }

/* ===== Mobile Cards ===== */
.mobile-cards { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large Desktop */
@media (max-width: 1440px) {
  .table { font-size: 12px; }
  .table thead th { font-size: 10.5px; padding: 7px 8px; }
  .table tbody td { padding: 6px 8px; }
}

/* Laptop (992px - 1199px) */
@media (max-width: 1199px) {
  .main-content { padding: 10px 12px; }
  .table { font-size: 11.5px; }
  .table thead th {
    font-size: 10px;
    padding: 6px 6px;
    letter-spacing: .2px;
  }
  .table tbody td {
    padding: 6px 6px;
    white-space: nowrap;
  }
  .card-body { padding: 10px; }
  .card-header { padding: 8px 12px; font-size: 12.5px; }
  .page-title { font-size: 14.5px; margin-bottom: 10px; }
  .form-control, .form-select {
    font-size: 12.5px;
    height: 32px;
    padding: 4px 8px;
  }
  .form-label { font-size: 10.5px; }
  .stat-card { padding: 13px 15px; }
  .stat-card h3 { font-size: 19px; }
  .stat-card h6 { font-size: 10.5px; }
  .stat-card i { font-size: 28px; opacity: .18; }
  .table .btn-sm { padding: 3px 6px; font-size: 10.5px; }
  .hide-laptop { display: none !important; }
}

/* ============================================================
   Tablet & Mobile (<992px) — SIDEBAR BECOMES HAMBURGER DRAWER
   ============================================================ */
@media (max-width: 991px) {

  /* Show hamburger */
  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile topbar layout */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .mobile-topbar .brand {
    flex: 1;
    min-width: 0;
  }

  /* ===== SIDEBAR = SLIDE-IN DRAWER ===== */
  .sidebar {
    display: block !important;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    z-index: 1200;
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Sidebar close button */
  .mobile-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 16px;
    cursor: pointer;
    transition: .15s;
    z-index: 10;
  }
  .mobile-close-btn:hover,
  .mobile-close-btn:active {
    background: rgba(255,255,255,.15);
    color: #fff;
  }

  /* Sidebar brand — close button ke liye space */
  .sidebar .brand {
    padding: 16px 50px 14px 16px;
  }
  .sidebar .brand h6 {
    font-size: 16px;
  }
  .sidebar .brand small {
    padding-right: 0;
    font-size: 11.5px;
  }

  /* Sidebar links — bigger for touch */
  .sidebar a {
    font-size: 13.5px;
    padding: 11px 14px;
  }
  .sidebar a i {
    font-size: 16px;
    width: 20px;
  }

  /* ===== OVERLAY (backdrop) ===== */
  .mobile-sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
  }
  .mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* ===== MAIN CONTENT = FULL WIDTH ===== */
  .main-content {
    margin-left: 0;
    padding: 10px 10px 90px;
  }

  /* Body scroll lock when sidebar open */
  body.sidebar-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Show bottom bar */
  .mobile-bottom-bar {
    display: block;
  }

  /* Common smaller text */
  .page-title { font-size: 15px; margin-bottom: 10px; }
  .stat-card h3 { font-size: 18px; }
  .card-body { padding: 10px; }

  /* Hide desktop table, show cards */
  .table-responsive-mobile .desktop-table { display: none; }
  .mobile-cards { display: block; padding: 8px; }

  /* Data card (accordion) */
  .data-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: .15s;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }
  .data-card.expanded {
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    border-color: #2563eb;
  }
  .data-card .card-head {
    padding: 11px 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    user-select: none;
  }
  .data-card .card-head:active { background: #f1f5f9; }
  .card-head .head-left { flex: 1; min-width: 0; }
  .card-head .head-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .card-head .head-sub {
    font-size: 11.5px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-head .head-sub span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }
  .card-head .head-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
  }
  .card-head .head-amount {
    font-size: 14px;
    font-weight: 700;
    color: #dc2626;
    white-space: nowrap;
  }
  .card-head .head-toggle {
    color: #94a3b8;
    font-size: 14px;
    transition: transform .2s;
  }
  .data-card.expanded .head-toggle {
    transform: rotate(180deg);
    color: #2563eb;
  }
  .data-card .card-body-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .2s ease;
    border-top: 0 solid #e2e8f0;
    background: #f8fafc;
  }
  .data-card.expanded .card-body-details {
    max-height: 700px;
    border-top: 1px solid #e2e8f0;
    padding: 10px 13px;
  }
  .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12.5px;
    border-bottom: 1px dashed #e2e8f0;
    gap: 10px;
  }
  .detail-row:last-child { border-bottom: none; }
  .detail-row .label {
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    flex-shrink: 0;
  }
  .detail-row .value {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
  }
  .detail-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
  }
  .detail-actions .btn {
    flex: 1;
    min-width: 70px;
    font-size: 12px;
    padding: 6px 8px;
  }

  /* Filter bar scroll */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn {
    padding: 7px 13px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* Reports grid */
  .report-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 9px;
  }
  .reports-hero {
    padding: 12px 14px;
    gap: 10px;
  }
  .reports-hero .hero-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .reports-hero .hero-text h5 { font-size: 13.5px; }
  .reports-hero .hero-text p { font-size: 11px; }

  /* Profit/Loss */
  .pl-hero {
    padding: 18px;
    gap: 14px;
  }
  .pl-hero-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }
  .pl-value { font-size: 26px; }
  .pl-sub { font-size: 11.5px; }
}

/* ============================================================
   Small Mobile (<576px)
   ============================================================ */
@media (max-width: 576px) {
  .stat-card { padding: 11px 13px; min-height: 70px; }
  .stat-card h6 { font-size: 9.5px; }
  .stat-card h3 { font-size: 16px; }
  .stat-card i { font-size: 24px; right: 10px; top: 10px; }

  .mobile-topbar { padding: 8px 12px; }
  .mobile-topbar .brand { font-size: 13px; }
  .mobile-topbar .brand i { font-size: 18px; }

  .hamburger-btn {
    font-size: 22px;
    padding: 3px 6px;
    margin-right: 6px;
  }

  .sidebar {
    width: 240px;
  }
  .sidebar a {
    font-size: 13px;
    padding: 10px 12px;
  }
  .sidebar a i {
    font-size: 15px;
  }

  .mobile-bottom-bar a { font-size: 9px; padding: 4px 1px; }
  .mobile-bottom-bar a i { font-size: 17px; }
  .mobile-bottom-bar a span { font-size: 8.5px; }

  .card-body { padding: 9px; }
  .form-label { font-size: 10px; }
  .page-title { font-size: 14px; }
  .btn { font-size: 12px; padding: 5px 10px; }
  .info-mini { padding: 8px 12px; }
  .info-mini .value { font-size: 13.5px; }
  .info-mini .label { font-size: 10px; }
  .table { font-size: 11.5px; }

  .report-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .report-card {
    padding: 10px 11px;
    min-height: 130px;
  }
  .report-card-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .report-card-body h6 { font-size: 12px; }
  .report-card-body p { font-size: 10px; line-height: 1.35; }
  .report-stat .stat-value { font-size: 14px; }
  .report-stat .stat-label { font-size: 8.5px; }
  .report-card-badge { font-size: 8px; padding: 2px 6px; }

  .reports-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pl-hero {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 18px 14px;
  }
  .pl-value { font-size: 24px; }
  .pl-month-label { width: 60px; font-size: 11px; }
  .pl-month-val { width: 85px; font-size: 11px; }
  .pl-formula-val { font-size: 15px; }
}

/* ===== Utilities ===== */
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }
.text-muted { color: #64748b !important; }
.text-primary { color: #2563eb !important; }
.text-success { color: #16a34a !important; }
.text-danger { color: #dc2626 !important; }
.text-warning { color: #f59e0b !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.d-none { display: none !important; }

/* ===== Print ===== */
@media print {
  body { background: #fff !important; font-size: 11px; }
  .sidebar, .mobile-topbar, .mobile-bottom-bar, .no-print,
  .mobile-sidebar-overlay, .hamburger-btn {
    display: none !important;
  }
  .main-content { margin: 0; padding: 0; }
  .card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
  }
  .stat-card,
  .badge,
  .table thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
/* ============================================================
   Partial (PD) Status Styling
   ============================================================ */
.badge-PD {
  background: #ffedd5;
  color: #9a3412;
}

.badge.bg-pd {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

/* Track page partial */
.track-card.partial { border-left-color: #f97316; }
.status-badge.pd {
  background: #ffedd5;
  color: #9a3412;
}

/* Partial row highlight */
tr.partial-row { background: #fff7ed !important; }

/* Builty list partial badge */
.badge-PD {
  background: #ffedd5;
  color: #9a3412;
  font-weight: 700;
}
/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-left: 210px;
  min-height: 60px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand i { color: #2563eb; font-size: 18px; flex-shrink: 0; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   User Dropdown
   ============================================================ */
.user-dropdown {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 30px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: .15s;
  font-family: inherit;
  color: inherit;
}
.user-trigger:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.user-trigger.open,
.user-trigger[aria-expanded="true"] {
  background: #e0e7ff;
  border-color: #2563eb;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4e73df, #224abe);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.user-avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  text-align: left;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-role {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  white-space: nowrap;
}

.user-chevron {
  font-size: 12px;
  color: #94a3b8;
  transition: transform .25s ease;
  margin-left: 2px;
}
.user-trigger.open .user-chevron,
.user-trigger[aria-expanded="true"] .user-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

/* ============================================================
   Dropdown Menu
   ============================================================ */
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.08);
  border: 1px solid #e2e8f0;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 9999;
}
.user-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* User Info Header */
.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}
.user-menu-info {
  min-width: 0;
  flex: 1;
}
.user-menu-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-role {
  font-size: 11px;
  color: #2563eb;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.user-menu-email {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section */
.user-menu-section {
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}
.user-menu-section:last-of-type {
  border-bottom: none;
}
.user-menu-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 8px 12px 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.user-menu-section-title i {
  font-size: 11px;
  color: #2563eb;
}

/* Menu Item */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: .15s;
  margin: 0 4px;
}
.user-menu-item:hover {
  background: #f1f5f9;
  color: #2563eb;
}
.user-menu-item:hover i {
  color: #2563eb;
}
.user-menu-item i {
  font-size: 15px;
  color: #64748b;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: .15s;
}

/* Logout Footer */
.user-menu-footer {
  padding: 6px 4px 4px;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
}
.user-menu-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: .15s;
}
.user-menu-logout:hover {
  background: #fee2e2;
  color: #991b1b;
}
.user-menu-logout i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ============================================================
   Topbar — Responsive
   ============================================================ */
@media (max-width: 991px) {
  .topbar {
    margin-left: 0;
    padding: 8px 12px;
    min-height: 54px;
  }
  .topbar-brand { font-size: 13.5px; }
  .topbar-brand i { font-size: 16px; }
  
  .user-trigger { padding: 3px 8px 3px 3px; gap: 8px; }
  .user-avatar { width: 32px; height: 32px; font-size: 13px; }
  .user-name { font-size: 11.5px; max-width: 100px; }
  .user-role { font-size: 9.5px; }
  
  .user-menu {
    min-width: 240px;
    right: -5px;
  }
}

@media (max-width: 576px) {
  .topbar-brand span { font-size: 12.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .user-details { display: none; }
  .user-trigger { padding: 3px; gap: 4px; background: transparent; border-color: transparent; }
  .user-trigger:hover,
  .user-trigger.open {
    background: #f1f5f9;
    border-color: #e2e8f0;
  }
  .user-avatar { width: 34px; height: 34px; font-size: 14px; }
  
  .user-menu { min-width: 220px; }
  .user-menu-item { font-size: 12.5px; padding: 8px 10px; }
  .user-menu-section-title { font-size: 9.5px; }
}

/* Print */
@media print {
  .topbar, .user-menu { display: none !important; }
}


/* ===== Sidebar Section Title ===== */
.sidebar .menu-section-title {
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 6px 10px 4px;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 800;
  position: relative;
}
.sidebar .menu-section-title::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, #334155, transparent);
}