/* =======================
   CSS Variables & Root
   ======================= */
:root {
  --bg: #F5F7FF;
  --panel: #FFFFFF;
  --muted: #6B7280;
  --text: #0F172A;
  --primary: #2563EB;
  --primary-2: #1D4ED8;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 18px 40px rgba(2, 6, 23, .10);
  --radius: 18px;
  --radius-sm: 14px;
  --pad: 18px;
  --pad-sm: 12px;
  --good: #16A34A;
  --warn: #F59E0B;
  --danger: #EF4444;
  --chip: #EEF2FF;
  --chipText: #1D4ED8;
  --tableHead: #F3F6FF;
  --focus: rgba(37, 99, 235, .18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --sidebar-width: 290px;
  --sidebar-collapsed-width: 72px;
}

/* =======================
   Base Reset
   ======================= */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(900px 500px at 20% -10%, rgba(37, 99, 235, .12), transparent 60%),
              radial-gradient(700px 400px at 90% 0%, rgba(16, 185, 129, .10), transparent 55%),
              var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
}

/* =======================
   App Layout
   ======================= */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 18px;
  padding: 18px;
}

/* =======================
   Mobile Menu Toggle Button
   ======================= */
.menuToggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menuToggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 2;
  fill: none;
}

/* =======================
   Sidebar
   ======================= */
.sidebar {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: width 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  position: relative;
}

/* Desktop Collapse Toggle */
.sidebarToggle {
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, .04);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.sidebarToggle:hover {
  background: rgba(37, 99, 235, .1);
  color: var(--primary);
}
.sidebarToggle .toggleClosed {
  display: none;
}
.app.sidebar-collapsed .sidebarToggle .toggleOpen {
  display: none;
}
.app.sidebar-collapsed .sidebarToggle .toggleClosed {
  display: block;
}

/* Desktop: show toggle button */
@media (min-width: 769px) {
  .sidebarToggle {
    display: flex;
  }
}

/* Collapsed sidebar (desktop only) */
.app.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}
.app.sidebar-collapsed .sidebar {
  padding: 16px 8px;
}
.app.sidebar-collapsed .brand h1,
.app.sidebar-collapsed .brand p,
.app.sidebar-collapsed .navLabel,
.app.sidebar-collapsed .navHint,
.app.sidebar-collapsed .navTitle,
.app.sidebar-collapsed .sidebarFooter .pill span:not(.dot) {
  display: none;
}
.app.sidebar-collapsed .brand {
  justify-content: center;
  padding: 10px 0 16px;
}
.app.sidebar-collapsed .brand .logo {
  display: none;
}
.app.sidebar-collapsed .sidebarToggle {
  margin-left: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(37, 99, 235, .08);
  color: var(--primary);
}
.app.sidebar-collapsed .nav {
  padding: 0;
  align-items: center;
}
.app.sidebar-collapsed .navBtn {
  justify-content: center;
  padding: 10px;
}
.app.sidebar-collapsed .navIcon {
  width: 38px;
  height: 38px;
  font-size: 18px;
}
.app.sidebar-collapsed .sidebarFooter {
  justify-content: center;
}
.app.sidebar-collapsed .sidebarFooter .pill {
  padding: 8px;
}
.app.sidebar-collapsed .sidebarFooter .pill .kbd {
  display: none;
}

.sidebarClose {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .9);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--muted);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 16px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22C55E, #2563EB);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
  flex: 0 0 auto;
}

.logo svg {
  filter: drop-shadow(0 8px 16px rgba(2, 6, 23, .22));
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: .2px;
}

.brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.navTitle {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 10px 8px;
  letter-spacing: .4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 6px;
  overflow-y: auto;
}

.navBtn {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: .18s ease;
}

.navBtn:hover {
  background: rgba(37, 99, 235, .06);
}

.navBtn.active {
  background: rgba(37, 99, 235, .10);
  border-color: rgba(37, 99, 235, .22);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .12);
}

.navLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.navIcon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .04);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 16px;
}

.navBtn.active .navIcon {
  background: rgba(37, 99, 235, .15);
}

.navLabel {
  text-align: left;
  font-weight: 650;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navHint {
  font-size: 11px;
  color: var(--muted);
  background: rgba(15, 23, 42, .04);
  border: 1px solid rgba(15, 23, 42, .06);
  padding: 4px 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebarFooter {
  margin-top: auto;
  border-top: 1px dashed rgba(15, 23, 42, .12);
  padding: 12px 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: rgba(255, 255, 255, .7);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22C55E;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
}

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(15, 23, 42, .03);
}

/* Mobile Sidebar Overlay */
.sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebarOverlay.show {
  opacity: 1;
}

/* =======================
   Main Content Area
   ======================= */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.topbarLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.breadcrumb {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crumbSmall {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumbTitle {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.langSwitch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
}

.langBtn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  transition: .16s ease;
}

.langBtn.active {
  background: rgba(37, 99, 235, .12);
  border-color: rgba(37, 99, 235, .20);
  color: var(--primary-2);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, .10);
  border: 1px solid rgba(37, 99, 235, .20);
  font-weight: 900;
  color: var(--primary-2);
  font-size: 14px;
}

/* Account Dropdown Menu */
.accountMenu {
  position: relative;
}

.accountToggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 3px 6px 3px 3px;
  cursor: pointer;
  transition: all .18s ease;
}

.accountToggle:hover {
  background: rgba(37, 99, 235, .06);
  border-color: rgba(37, 99, 235, .12);
}

.accountChevron {
  color: var(--muted);
  transition: transform .2s ease;
}

.accountMenu.open .accountChevron {
  transform: rotate(180deg);
}

.accountDropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transition: all .18s ease;
  z-index: 1000;
  overflow: hidden;
}

.accountMenu.open .accountDropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.accountDropdownHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.accountDropdownAvatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(37,99,235,.08));
  border: 1px solid rgba(37,99,235,.2);
  font-weight: 900;
  font-size: 16px;
  color: var(--primary-2);
  flex-shrink: 0;
}

.accountDropdownInfo {
  min-width: 0;
}

.accountDropdownName {
  font-size: 14px;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accountDropdownRole {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.accountDropdownDivider {
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

.accountDropdownItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background .14s ease;
  text-align: left;
}

.accountDropdownItem:hover {
  background: rgba(37, 99, 235, .05);
}

.accountDropdownItem svg {
  color: var(--muted);
  flex-shrink: 0;
}

.accountDropdownLogout {
  color: #DC2626;
}

.accountDropdownLogout svg {
  color: #DC2626;
}

.accountDropdownLogout:hover {
  background: rgba(220, 38, 38, .06);
}

.content {
  z-index: 1;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 520px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* =======================
   Grid System
   ======================= */
.grid {
  display: grid;
  gap: 14px;
}

.grid.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* =======================
   Cards
   ======================= */
.card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, .06);
}

.cardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cardTitle {
  font-weight: 800;
  font-size: 13px;
  color: var(--primary-2);
}

.cardSub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.big {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .2px;
  margin-top: 6px;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* =======================
   Chips
   ======================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, .20);
  background: var(--chip);
  color: var(--chipText);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.chip.orange {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .25);
  color: #B45309;
}

.chip.green {
  background: rgba(34, 197, 94, .14);
  border-color: rgba(34, 197, 94, .25);
  color: #15803D;
}

/* =======================
   Toolbar
   ======================= */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.input {
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .92);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  min-width: 180px;
  max-width: 100%;
  transition: .16s ease;
}

.input:focus {
  box-shadow: 0 0 0 6px var(--focus);
  border-color: rgba(37, 99, 235, .35);
}

/* =======================
   Buttons
   ======================= */
.btn {
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .92);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  transition: .16s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(2, 6, 23, .10);
}

.btnPrimary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: rgba(37, 99, 235, .25);
  color: white;
  box-shadow: 0 16px 30px rgba(37, 99, 235, .22);
}

.btnDanger {
  background: rgba(239, 68, 68, .10);
  border-color: rgba(239, 68, 68, .28);
  color: #B91C1C;
}

.btnSmall {
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 850;
  font-size: 12px;
}

/* =======================
   Table
   ======================= */
.tableWrap {
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: var(--radius);
  overflow-x: auto;
  background: rgba(255, 255, 255, .92);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

thead th {
  background: var(--tableHead);
  color: rgba(15, 23, 42, .78);
  font-size: 12px;
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .10);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  vertical-align: middle;
  font-size: 13px;
}

tbody tr:hover {
  background: rgba(37, 99, 235, .04);
}

.right {
  text-align: right;
}

.mono {
  font-family: var(--mono);
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.linkBtn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--primary-2);
  font-weight: 900;
  padding: 0;
}

.dangerIcon {
  color: #EF4444;
}

.mutedSmall {
  color: var(--muted);
  font-size: 12px;
}

/* =======================
   Modal
   ======================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 100;
  overflow-y: auto;
}

.overlay.show {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(2, 6, 23, .35);
  backdrop-filter: blur(12px);
}

.modal.modal-lg {
  width: min(900px, 95%);
}

.modalHeader {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, .10);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, .96);
  z-index: 1;
}

.modalTitle {
  font-weight: 950;
  font-size: 16px;
}

.xBtn {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: rgba(255, 255, 255, .86);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.modalBody {
  padding: 14px 16px;
}

.formGrid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 850;
  color: rgba(15, 23, 42, .78);
  margin-bottom: 6px;
}

.field .req {
  color: #EF4444;
}

.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.modalFooter {
  padding: 14px 16px;
  border-top: 1px solid rgba(15, 23, 42, .10);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(15, 23, 42, .02);
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
}

/* =======================
   Receipt Preview
   ======================= */
.receiptWrap {
  display: grid;
  place-items: center;
  padding: 18px 0 4px;
}

.receipt {
  width: min(340px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: white;
  box-shadow: 0 16px 40px rgba(2, 6, 23, .12);
  padding: 16px;
}

.receipt h2 {
  margin: 0 0 8px;
  text-align: center;
}

.dash {
  border-top: 1px dashed rgba(15, 23, 42, .25);
  margin: 10px 0;
}

.rRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin: 6px 0;
}

.rSmall {
  font-size: 12px;
  color: var(--muted);
}

.rTotal {
  font-weight: 950;
  font-size: 16px;
}

/* =======================
   Toast
   ======================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .12);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .20);
  border-radius: 16px;
  padding: 10px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 110;
  max-width: min(560px, calc(100vw - 24px));
}

.toast.show {
  display: flex;
}

.toast .tIcon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .16);
  flex-shrink: 0;
}

.toast.err .tIcon {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .18);
}

.toast .tMsg {
  font-size: 13px;
  font-weight: 800;
}

.toast .tSub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* =======================
   Loading Overlay
   ======================= */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* =======================
   Pagination
   ======================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 13px;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-size-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.page-numbers {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* =======================
   Responsive - Tablet
   ======================= */
@media (max-width: 1100px) {
  .grid.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .grid.two {
    grid-template-columns: 1fr;
  }

  .navHint {
    display: none;
  }
}

/* =======================
   Responsive - Mobile
   ======================= */
@media (max-width: 768px) {
  :root {
    --pad: 12px;
    --pad-sm: 8px;
  }

  .app {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
    height: auto;
    min-height: 100%;
  }

  /* Show menu toggle button */
  .menuToggle {
    display: flex;
  }

  /* Mobile Sidebar - Slide from left */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 85vw);
    z-index: 100;
    border-radius: 0 var(--radius) var(--radius) 0;
    transform: translateX(-100%);
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebarClose {
    display: flex;
  }

  .sidebarOverlay {
    display: block;
    pointer-events: none;
  }

  .sidebarOverlay.show {
    pointer-events: auto;
  }

  /* Main content takes full width */
  .main {
    width: 100%;
  }

  /* Topbar adjustments */
  .topbar {
    padding: 10px 12px;
  }

  .crumbSmall {
    display: none;
  }

  .crumbTitle {
    font-size: 16px;
  }

  .langSwitch {
    padding: 4px;
  }

  .langBtn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Content area */
  .content {
    padding: 12px;
    min-height: auto;
    border-radius: var(--radius-sm);
  }

  /* Toolbar */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar .row {
    width: 100%;
    justify-content: flex-start;
  }

  .input {
    min-width: 0;
    flex: 1;
  }

  /* Grid */
  .grid.cards {
    grid-template-columns: 1fr;
  }

  /* Table */
  table {
    min-width: 500px;
  }

  thead th,
  tbody td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .actions {
    gap: 4px;
  }

  .btnSmall {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Pagination */
  .pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

  .pagination-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .page-numbers {
    display: none;
  }

  /* Cards */
  .card {
    padding: 12px;
  }

  .big {
    font-size: 16px;
  }

  /* Modal */
  .modal {
    border-radius: 16px;
    max-height: calc(100vh - 24px);
  }

  .modalHeader {
    padding: 12px 14px;
  }

  .modalBody {
    padding: 12px 14px;
  }

  .modalFooter {
    padding: 12px 14px;
  }

  /* Receipt */
  .receipt {
    width: 100%;
    padding: 12px;
  }

  .receiptWrap {
    padding: 12px 0;
  }
}

/* =======================
   Responsive - Small Mobile
   ======================= */
@media (max-width: 480px) {
  .app {
    padding: 8px;
    gap: 8px;
  }

  .topbar {
    padding: 8px 10px;
  }

  .crumbTitle {
    font-size: 14px;
  }

  .content {
    padding: 10px;
  }

  .toolbar .row {
    flex-wrap: wrap;
  }

  .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  table {
    min-width: 450px;
  }

  thead th,
  tbody td {
    padding: 8px 6px;
    font-size: 11px;
  }

  .chip {
    padding: 4px 8px;
    font-size: 10px;
  }
}

/* =======================
   Print Styles
   ======================= */
@media print {
  body {
    background: white;
  }
  
  .app {
    display: block;
    padding: 0;
  }
  
  .sidebar, .topbar, .menuToggle, .sidebarOverlay {
    display: none !important;
  }
  
  .content {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
