/* ===== CSS Variables ===== */
:root {
  --bg: #F5F6F8;
  --bg2: #FFFFFF;
  --ink: #1A1D23;
  --ink-2: #3D4148;
  --muted: #8A8F98;
  --muted-2: #B5B9C0;
  --rule: #E8E6E1;
  --rule-2: #F0EEE9;
  --accent: #1B5E20;
  --accent-hover: #14451A;
  --accent-light: #E8F5E9;
  --accent2: #0277BD;
  --accent2-light: #E1F5FE;
  --danger: #C62828;
  --danger-light: #FFEBEE;
  --warn: #EF6C00;
  --warn-light: #FFF3E0;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 240px;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
*::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1B5E20 0%, #0277BD 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo .icon {
  width: 56px;
 height: 56px;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.login-logo h1 { font-size: 20px; color: var(--ink); }
.login-logo p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.login-form input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--rule);
  border-radius: 8px; font-size: 15px; transition: border-color .2s;
}
.login-form input:focus { outline: none; border-color: var(--accent); }
.login-form .btn-login {
  width: 100%; padding: 12px; background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 15px; font-weight: 600; margin-top: 8px;
  transition: background .2s;
}
.login-form .btn-login:hover { background: var(--accent-hover); }
.login-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ===== App Layout ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: #1A1D23;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-title strong { font-size: 14px; display: block; }
.sidebar-title small { font-size: 11px; color: rgba(255,255,255,0.5); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Nav group (1st level) */
.nav-group { margin-bottom: 2px; }
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.nav-group-header:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-group-header .nav-icon { display: flex; flex-shrink: 0; }
.nav-group-header .nav-text { flex: 1; }
.nav-group-header .nav-arrow {
  transition: transform .2s;
  opacity: 0.5;
  font-size: 10px;
}
.nav-group.expanded .nav-group-header .nav-arrow { transform: rotate(90deg); }

/* Nav sub-items (2nd level) */
.nav-sub-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.nav-group.expanded .nav-sub-items { max-height: 300px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 44px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  transition: color .15s, background .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active {
  color: #fff;
  background: rgba(27,94,32,0.25);
  border-left-color: var(--accent);
}
.nav-item .nav-icon { display: flex; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
}
.sidebar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-btn.danger:hover { background: rgba(198,40,40,0.2); color: #ef9a9a; }

/* ===== Main Area ===== */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  display: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--ink-2);
}
.sidebar-toggle:hover { background: var(--rule-2); }
.page-title { font-size: 18px; font-weight: 600; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 14px; color: var(--accent); font-weight: 600; }
.topbar-user { font-size: 13px; color: var(--ink-2); font-weight: 500; }

.content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Cards ===== */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.card-body { padding: 20px; }

/* ===== Stat Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.stat-card.green { border-left-color: var(--success); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.warn { border-left-color: var(--warn); }
.stat-card.accent2 { border-left-color: var(--accent2); }
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--ink); }
.stat-value.green { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-value.accent { color: var(--accent); }
.stat-trend { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--ink-2); border: 1px solid var(--rule); }
.btn-secondary:hover { background: var(--rule-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.form-group label .label-en { color: var(--muted); font-weight: 400; font-size: 12px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm); font-size: 14px; transition: border-color .2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 60px; }
select.form-control { cursor: pointer; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: #F5F7FA;
  color: var(--ink-2);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.data-table tbody tr:nth-child(even) { background: #FAFBFC; }
.data-table tbody tr:hover { background: var(--accent-light); }
.data-table .amt-income { color: var(--success); font-weight: 600; }
.data-table .amt-expense { color: var(--danger); font-weight: 600; }
.data-table .amt-myr { font-family: 'Courier New', monospace; font-weight: 600; }
.data-table td .cell-en { color: var(--muted); font-size: 11px; display: block; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warn { background: var(--warn-light); color: var(--warn); }
.badge-info { background: var(--accent2-light); color: var(--accent2); }
.badge-muted { background: var(--rule-2); color: var(--muted); }
.badge-company { background: #E3F2FD; color: #1565C0; }
.badge-cash { background: #FFF3E0; color: #E65100; }

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.action-bar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.action-bar-right { display: flex; gap: 10px; align-items: center; }

/* ===== Filter Section ===== */
.filter-section {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-section .form-group { margin-bottom: 0; min-width: 140px; }

/* ===== Month Selector ===== */
.month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}
.month-selector select {
  padding: 8px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s, transform .25s;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warn { background: var(--warn); }
.toast-info { background: var(--accent2); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 440px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.modal-header h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-body p { margin-bottom: 8px; color: var(--ink-2); }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== File Upload ===== */
.file-upload-area {
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.file-upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.file-upload-area .icon { font-size: 36px; color: var(--muted); margin-bottom: 8px; }
.file-upload-area p { color: var(--muted); font-size: 14px; }
.file-upload-area input { display: none; }

/* ===== Verify Table (dual data) ===== */
.verify-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.verify-table th { background: #F5F7FA; padding: 8px 10px; border-bottom: 2px solid var(--rule); font-weight: 600; text-align: left; white-space: nowrap; }
.verify-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.verify-table .diff-row { background: #FFF3E0; }
.verify-table .diff-cell { color: var(--danger); font-weight: 600; }
.verify-table .match-cell { color: var(--success); }

/* ===== Charts ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.chart-card { margin-bottom: 0; }
.chart-card .card-body { padding: 0; }
.chart-container { width: 100%; height: 300px; }

/* ===== Dash Welcome ===== */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-welcome h2 { font-size: 18px; }
.dash-welcome p { font-size: 13px; color: var(--muted); }
.dash-actions { display: flex; gap: 8px; }

/* ===== Summary List ===== */
.summary-list { list-style: none; }
.summary-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.summary-list li:last-child { border-bottom: none; }
.summary-list .label { color: var(--ink-2); }
.summary-list .value { font-weight: 600; }

/* ===== Quick Actions Grid ===== */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.quick-action-btn {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 100px;
}
.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.quick-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-btn:nth-child(2) .quick-icon { background: #E1F5FE; }
.quick-action-btn:nth-child(3) .quick-icon { background: #FFF3E0; }
.quick-action-btn:nth-child(4) .quick-icon { background: #FFEBEE; }
.quick-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .quick-action-btn {
    padding: 24px 16px;
    min-height: 120px;
  }
  .quick-icon {
    width: 64px;
    height: 64px;
  }
  .quick-icon svg {
    width: 36px;
    height: 36px;
  }
  .quick-label {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .quick-action-btn {
    padding: 20px 12px;
    min-height: 100px;
  }
  .quick-icon {
    width: 56px;
    height: 56px;
  }
  .quick-icon svg {
    width: 32px;
    height: 32px;
  }
  .quick-label {
    font-size: 15px;
  }
}

/* ===== A4 Print Styles ===== */
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
  }
  .no-print { display: none !important; }
  .page-break { page-break-after: always; }
}

/* A4 Document Styles (for generated print pages) */
.a4-doc {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm;
  margin: 0 auto;
  background: #fff;
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
}
.a4-doc * { box-sizing: border-box; }
.a4-header {
  text-align: center;
  border-bottom: 2px solid #1B5E20;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.a4-header h1 { font-size: 20px; color: #1B5E20; margin-bottom: 4px; }
.a4-header h2 { font-size: 14px; color: #333; font-weight: 400; }
.a4-header .reg-no { font-size: 12px; color: #666; margin-top: 4px; }
.a4-title { text-align: center; font-size: 16px; font-weight: 600; margin: 16px 0; }
.a4-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}
.a4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.a4-table th {
  background: #E8F5E9;
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: center;
  font-weight: 600;
}
.a4-table td {
  border: 1px solid #333;
  padding: 5px 8px;
  text-align: center;
}
.a4-table .amt { text-align: right; font-family: 'Courier New', monospace; }
.a4-signature {
  margin-top: 30px;
  display: flex;
  justify-content: space-around;
  gap: 40px;
}
.a4-sign-block {
  text-align: center;
  flex: 1;
}
.a4-sign-block .sign-label { font-size: 13px; margin-bottom: 50px; }
.a4-sign-block .sign-line { border-top: 1px solid #333; padding-top: 4px; font-size: 12px; color: #666; }
.a4-note {
  margin-top: 20px;
  padding: 10px;
  background: #F5F5F5;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
  text-align: center;
}

/* ===== User Management ===== */
.perm-group {
  margin-bottom: 16px;
}
.perm-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--rule-2);
  border-radius: 4px;
}
.perm-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 8px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .15s;
}
.perm-item:hover {
  background: var(--rule-2);
}
.perm-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.perm-item input[type="checkbox"]:checked + span {
  color: var(--accent);
  font-weight: 500;
}
.perm-item input[type="checkbox"]:checked {
  accent-color: var(--accent);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .chart-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }
  html { font-size: 15px; }
  
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    width: 280px;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  
  .sidebar-header {
    padding: 20px 18px;
  }
  .sidebar-logo {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .sidebar-title strong { font-size: 16px; }
  .sidebar-title small { font-size: 12px; }
  
  .nav-group-header {
    padding: 14px 18px;
    font-size: 13px;
    gap: 12px;
  }
  .nav-group-header .nav-icon svg { width: 20px; height: 20px; }
  
  .nav-item {
    padding: 13px 18px 13px 52px;
    font-size: 15px;
    gap: 12px;
  }
  .nav-item .nav-icon svg { width: 18px; height: 18px; }
  
  .sidebar-footer {
    padding: 16px 18px;
  }
  .sidebar-btn {
    padding: 12px;
    font-size: 14px;
    gap: 8px;
  }
  .sidebar-btn svg { width: 16px; height: 16px; }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
  
  .sidebar-toggle { display: flex; }
  .sidebar-toggle svg { width: 24px; height: 24px; }
  
  .main-area { margin-left: 0; }
  .topbar { height: 64px; padding: 0 16px; }
  .page-title { font-size: 20px; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 20px; }
  .stat-label { font-size: 14px; }
  .stat-value { font-size: 28px; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar-left, .action-bar-right { width: 100%; }
  .filter-section { flex-direction: column; align-items: stretch; }
  .filter-section .form-group { min-width: 100%; }
  .form-row { flex-direction: column; }
  .form-control { padding: 12px 14px; font-size: 15px; }
  .btn { padding: 12px 20px; font-size: 15px; }
  .a4-doc { width: 100%; min-height: auto; padding: 10mm; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .dash-welcome { flex-direction: column; align-items: flex-start; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .card-body { padding: 16px; }
  .form-group label { font-size: 14px; margin-bottom: 8px; }
}
