:root {
  --navy-1: #020b3a;
  --navy-2: #01052a;
  --navy-3: #06114f;
  --purple: #4318ff;
  --purple-2: #601cff;
  --purple-soft: #f2edff;
  --text: #09114a;
  --text-soft: #5c689a;
  --line: #e8ebf4;
  --panel: #ffffff;
  --bg: #fbfcff;
  --green: #16a34a;
  --green-soft: #ebf8ef;
  --orange: #ff7300;
  --orange-soft: #fff1e8;
  --pink: #ff2a67;
  --pink-soft: #ffeaf1;
  --red: #ff4560;
  --red-soft: #ffe8ef;
  --blue: #2b67f6;
  --blue-soft: #eaf2ff;
  --shadow: 0 12px 28px rgba(13, 19, 64, 0.04);
  --sidebar-w: 224px;
  --sidebar-collapsed: 92px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

.reports-app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
body.sidebar-collapsed .reports-app { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.reports-sidebar {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 16px 14px 18px;
  background: radial-gradient(circle at 22px 22px, rgba(96, 32, 255, 0.3), transparent 84px), linear-gradient(180deg, var(--navy-3) 0%, var(--navy-2) 54%, #000b33 100%);
  box-shadow: 18px 0 44px rgba(4, 11, 51, 0.16);
}
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 10px 18px; }
.sidebar-brand-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3200ef 0%, #651dff 100%); box-shadow: 0 12px 24px rgba(68, 24, 255, 0.32); flex: 0 0 44px; }
.sidebar-brand-icon svg { width: 24px; height: 24px; stroke-width: 2; }
.brand-copy strong { display: block; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.brand-copy small { display: block; margin-top: 2px; color: rgba(255,255,255,0.92); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }
.sidebar-toggle { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: rgba(255,255,255,0.86); border-radius: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.06); }
.sidebar-toggle svg { width: 18px; height: 18px; stroke-width: 2.2; transition: transform .2s ease; }
.reports-nav { padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-item, .logout-link {
  height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 12px; margin-bottom: 5px; border-radius: 10px;
  color: rgba(255,255,255,0.96); font-size: 14px; font-weight: 600; transition: background .2s ease, color .2s ease;
}
.nav-item:hover, .logout-link:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, #3500ee 0%, #5e1cff 100%); box-shadow: 0 14px 26px rgba(67, 14, 255, 0.26); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; }
.nav-icon svg { width: 21px; height: 21px; stroke-width: 1.9; }
.nav-text { white-space: nowrap; }
.assist-card {
  margin: 18px 4px 18px; padding: 18px 16px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(81, 20, 255, 0.28) 0%, rgba(63, 18, 180, 0.66) 100%);
  border: 1px solid rgba(255,255,255,0.08); color: #fff;
}
.assist-card h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; line-height: 1.35; }
.assist-card p { margin: 0 0 18px; color: rgba(255,255,255,0.96); font-size: 14px; line-height: 1.45; }
.assist-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assist-bottom-row button { min-width: 114px; height: 38px; padding: 0 14px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #3500ee 0%, #5d1cff 100%); font-size: 13px; font-weight: 700; }
.assist-bot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,0.12); }
.assist-bot svg { width: 22px; height: 22px; stroke-width: 1.8; }
.logout-link { margin-top: 8px; }

.reports-main { min-width: 0; padding: 22px 24px 18px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.page-head p { margin: 6px 0 0; color: var(--text-soft); font-size: 14px; }
.head-actions { display: flex; align-items: center; gap: 20px; }
.date-btn, .export-btn, .filter-btn, .clear-btn, .per-page-btn {
  height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; font-size: 15px; font-weight: 650;
}
.date-btn { min-width: 270px; padding: 0 18px; color: #172359; border: 1px solid #dde2f0; background: #fff; }
.export-btn { min-width: 122px; color: #fff; background: linear-gradient(135deg, #3500ee 0%, #5d1cff 100%); box-shadow: 0 14px 30px rgba(67, 14, 255, 0.2); }
.date-btn svg, .export-btn svg, .filter-btn svg, .clear-btn svg, .quick-card svg, .action-btn svg, .per-page-btn svg, .stat-icon svg, .mini-icon svg { width: 20px; height: 20px; stroke-width: 1.9; }
.caret { width: 18px !important; height: 18px !important; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { min-height: 146px; display: flex; gap: 16px; align-items: flex-start; padding: 18px 18px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 54px; }
.stat-icon.purple { color: #fff; background: linear-gradient(135deg, #4318ff 0%, #6621ff 100%); }
.stat-icon.green { color: #fff; background: linear-gradient(135deg, #17a44c 0%, #2ec86a 100%); }
.stat-icon.orange { color: #fff; background: linear-gradient(135deg, #ff7300 0%, #ff8c2f 100%); }
.stat-icon.pink { color: #fff; background: linear-gradient(135deg, #ff2a67 0%, #ff567f 100%); }
.stat-icon.blue { color: #fff; background: linear-gradient(135deg, #2468f7 0%, #4d84ff 100%); }
.stat-label { display: block; color: #29346f; font-size: 14px; font-weight: 600; }
.stat-card h2 { margin: 6px 0 6px; font-size: 18px; line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; }
.stat-card p { margin: 0; color: var(--text-soft); font-size: 14px; }
.trend { display: inline-flex; align-items: center; min-height: 26px; margin-top: 14px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.trend.up { color: #138a3e; background: #e7f7ec; }
.trend.down { color: #c43434; background: #fdecef; }

.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, .8fr) minmax(180px, .8fr) minmax(160px, .65fr); gap: 18px; margin-bottom: 18px; }
.filter-btn, .clear-btn { min-width: 0; padding: 0 16px; color: #172359; border: 1px solid #dde2f0; background: #fff; white-space: nowrap; }
.filter-btn.wide { justify-content: flex-start; }
.clear-btn { margin-left: auto; min-width: 150px; }

.quick-panel, .summary-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.quick-panel { padding: 14px 14px 16px; margin-bottom: 18px; }
.quick-panel h3, .summary-panel h3 { margin: 4px 0 14px; padding: 0 2px; font-size: 13px; font-weight: 800; color: #111c57; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-card {
  min-height: 92px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; align-items: center; gap: 14px; padding: 14px 14px; border: 1px solid #e7ebf5; border-radius: 14px; background: #fff;
}
.quick-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.quick-icon.lilac { color: #451dff; background: #f2edff; }
.quick-icon.mint { color: #16a34a; background: #e9f8ee; }
.quick-icon.peach { color: #ff7300; background: #fff1e8; }
.quick-icon.sky { color: #2b67f6; background: #edf4ff; }
.quick-icon.rose { color: #ff345f; background: #fff0f3; }
.quick-icon.soft-purple { color: #6b42ff; background: #f3efff; }
.quick-content strong { display: block; font-size: 15px; font-weight: 800; }
.quick-content p { margin: 6px 0 0; color: #596593; font-size: 13px; line-height: 1.45; }
.quick-arrow { color: #3d26ff; font-size: 28px; line-height: 1; justify-self: end; }

.summary-panel { padding: 14px 14px 8px; }
.table-wrap { overflow-x: auto; }
.reports-table { min-width: 1120px; display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1.1fr .9fr .65fr; align-items: center; }
.reports-header { min-height: 36px; padding: 0 8px; color: #141f5a; font-size: 12px; font-weight: 800; border-bottom: 1px solid var(--line); }
.reports-row { min-height: 84px; padding: 0 8px; color: #1d255f; font-size: 14px; border-bottom: 1px solid #edf0f7; }
.report-name-cell { display: flex; align-items: center; gap: 14px; }
.mini-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 34px; }
.mini-icon.violet { color: #4a26ff; background: #f3efff; }
.mini-icon.green { color: #16a34a; background: #eaf8ee; }
.mini-icon.orange { color: #ff7300; background: #fff1e8; }
.mini-icon.blue { color: #2b67f6; background: #ecf3ff; }
.mini-icon.red { color: #ff3460; background: #fff0f4; }
.report-name-cell strong { display: block; font-size: 15px; font-weight: 800; }
.report-name-cell span { display: block; margin-top: 4px; color: #5a6695; font-size: 13px; }
.type-badge { min-width: 90px; min-height: 28px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 13px; font-weight: 700; }
.type-badge.sales { color: #4a26ff; background: #f2edff; }
.type-badge.inventory { color: #138f43; background: #eaf8ee; }
.type-badge.finance { color: #f36a00; background: #fff1e8; }
.type-badge.payments { color: #2468f7; background: #edf4ff; }
.type-badge.expenses { color: #ff3460; background: #fff0f4; }
.action-group { display: flex; align-items: center; gap: 10px; }
.action-btn { width: 42px; height: 36px; border-radius: 9px; display: grid; place-items: center; border: 1px solid #dfe4f1; background: #fff; color: #3923ff; }
.action-btn svg { width: 17px; height: 17px; }

.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px 8px; }
.table-footer p { margin: 0; color: #223066; font-size: 14px; font-weight: 550; }
.pagination { display: flex; align-items: center; gap: 12px; }
.page-btn { width: 36px; height: 36px; border-radius: 10px; color: #202a62; background: #fff; border: 1px solid #dfe4f1; font-size: 15px; font-weight: 700; }
.page-btn.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, #3500ee 0%, #5d1cff 100%); box-shadow: 0 14px 26px rgba(67, 14, 255, 0.22); }
.page-btn.muted { color: #8d96bc; }
.per-page-btn { min-width: 146px; padding: 0 18px; color: #202a62; border: 1px solid #dfe4f1; background: #fff; }

body.sidebar-collapsed .reports-sidebar { padding-left: 10px; padding-right: 10px; }
body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .nav-text, body.sidebar-collapsed .assist-copy, body.sidebar-collapsed .assist-bottom-row button, body.sidebar-collapsed .logout-link .nav-text { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-right: 0; padding-left: 0; }
body.sidebar-collapsed .sidebar-brand-row { flex-direction: column; align-items: center; gap: 12px; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
body.sidebar-collapsed .nav-item, body.sidebar-collapsed .logout-link { justify-content: center; padding: 0; }
body.sidebar-collapsed .assist-card { padding: 12px; display: grid; place-items: center; }
body.sidebar-collapsed .assist-bottom-row { justify-content: center; }

@media (max-width: 1500px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .head-actions { justify-content: flex-end; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .reports-app, body.sidebar-collapsed .reports-app { grid-template-columns: 1fr; }
  .reports-sidebar { min-height: auto; }
  .reports-main { padding: 16px; }
  .head-actions, .filter-bar, .quick-grid, .stats-grid { grid-template-columns: 1fr; }
  .head-actions { display: grid; }
  .date-btn, .export-btn, .filter-btn, .clear-btn, .per-page-btn { width: 100%; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}
