:root {
  --navy-1: #020b3a;
  --navy-2: #01052a;
  --navy-3: #06114f;
  --purple: #4318ff;
  --purple-2: #601cff;
  --text: #09114a;
  --text-soft: #5c689a;
  --line: #e8ebf4;
  --panel: #ffffff;
  --bg: #fbfcff;
  --green: #16a34a;
  --green-soft: #ebf8ef;
  --orange: #ff6900;
  --pink: #ff2f67;
  --pink-soft: #ffeef4;
  --purple-soft: #efe8ff;
  --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; }

.returns-app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
body.sidebar-collapsed .returns-app { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.returns-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; }
.returns-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; }

.returns-main { min-width: 0; padding: 22px 20px 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, .new-btn, .filter-btn, .clear-btn, .per-page-btn, .view-btn {
  height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; font-size: 15px; font-weight: 650;
}
.date-btn { min-width: 280px; padding: 0 18px; color: #172359; border: 1px solid #dde2f0; background: #fff; }
.new-btn { min-width: 136px; color: #fff; background: linear-gradient(135deg, #3500ee 0%, #5d1cff 100%); box-shadow: 0 14px 30px rgba(67, 14, 255, 0.18); }
.date-btn svg, .new-btn svg, .filter-btn svg, .clear-btn svg, .search-box svg, .view-btn svg, .per-page-btn svg, .stat-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(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card { min-height: 160px; display: flex; gap: 18px; align-items: flex-start; padding: 22px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stat-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 56px; color: #fff; }
.stat-icon.pink { background: linear-gradient(135deg, #ff2f67 0%, #ff4b78 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #ff6900 0%, #ff8b2a 100%); }
.stat-icon.green { background: linear-gradient(135deg, #18a44c 0%, #2fc86b 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #a881ff 0%, #c7b0ff 100%); color: #5628ff; }
.stat-label { display: block; color: #29346f; font-size: 14px; font-weight: 600; }
.stat-card h2 { margin: 8px 0 8px; font-size: 19px; line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; }
.stat-card p { margin: 0; color: var(--text-soft); font-size: 14px; }

.table-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.search-box { min-width: 0; flex: 1 1 auto; max-width: 500px; height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid #dde2f0; border-radius: 12px; background: #fff; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.search-box input::placeholder { color: #6672a5; }
.tool-actions { display: flex; align-items: center; gap: 14px; }
.filter-btn, .clear-btn { padding: 0 16px; color: #172359; border: 1px solid #dde2f0; background: #fff; white-space: nowrap; }
.clear-btn { min-width: 150px; }

.table-wrap { overflow-x: auto; }
.returns-table { min-width: 1260px; display: grid; grid-template-columns: 1.25fr 1.2fr 1.1fr 1.25fr 1fr 1.65fr 1.2fr 1fr .95fr; align-items: center; }
.returns-header { min-height: 58px; padding: 0 18px; color: #141f5a; font-size: 13px; font-weight: 800; border-bottom: 1px solid var(--line); }
.returns-row { min-height: 94px; padding: 0 18px; color: #1d255f; font-size: 14px; border-bottom: 1px solid #edf0f7; }
.sort { color: #7380b2; font-size: 12px; }
.id-col strong, .date-col strong, .customer-col strong, .items-col strong, .reason-col strong { display: block; font-size: 15px; font-weight: 700; }
.id-col span, .date-col span, .customer-col span, .reason-col span { display: block; margin-top: 6px; color: #596593; font-size: 13px; }
.id-col strong, .invoice-col a, .items-col a { color: #3f22ff; }
.invoice-col a { font-size: 15px; font-weight: 700; }
.items-col a { display: inline-block; margin-top: 7px; font-size: 13px; font-weight: 600; }
.refund-col { color: #ef1d33; font-size: 16px; font-weight: 800; }
.status-badge {
  min-width: 94px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 999px;
  color: #188e42; background: #eaf8ee; font-size: 13px; font-weight: 700;
}
.view-btn { min-width: 82px; height: 38px; padding: 0 14px; color: #3923ff; border: 1px solid #dfe4f1; background: #fff; border-radius: 10px; }
.view-btn svg { width: 16px; height: 16px; }

.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 14px 16px; }
.table-footer p { margin: 0; color: #223066; font-size: 14px; font-weight: 550; }
.pagination { display: flex; align-items: center; gap: 12px; }
.page-btn { width: 40px; height: 40px; 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: 138px; padding: 0 18px; color: #202a62; border: 1px solid #dfe4f1; background: #fff; }

body.sidebar-collapsed .returns-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: 1450px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .head-actions { justify-content: flex-end; }
  .table-tools { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .tool-actions { justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 980px) {
  .returns-app, body.sidebar-collapsed .returns-app { grid-template-columns: 1fr; }
  .returns-sidebar { min-height: auto; }
  .returns-main { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .head-actions, .tool-actions { flex-direction: column; align-items: stretch; }
  .date-btn, .new-btn, .filter-btn, .clear-btn, .per-page-btn { width: 100%; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}
