:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #66758a;
  --line: #dfe6ee;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(246, 248, 251, .88);
  backdrop-filter: blur(8px);
  z-index: 50;
  transition: opacity .25s ease, visibility .25s ease;
}
.app-loader.hidden { opacity: 0; visibility: hidden; }
.loader-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  border: 0;
  border-radius: 7px;
  padding: 11px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  min-height: 42px;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 10px 25px rgba(37, 99, 235, .24); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.light { background: #eef4ff; color: var(--primary); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.icon { width: 38px; height: 38px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.site-nav, .hero, .section-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.site-nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.hero {
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 44px;
  align-items: center;
  padding: 24px 0 72px;
}
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .12em; }
.hero h1 { font-size: clamp(42px, 6vw, 76px); line-height: .98; margin: 12px 0 18px; letter-spacing: 0; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.7; margin: 0 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.mock-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.pill { background: #ecfdf5; color: #047857; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.mock-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mock-product { border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-height: 96px; background: #fbfdff; }
.mock-product strong { display: block; margin-top: 24px; }
.mock-product span { color: var(--muted); font-size: 13px; }
.mock-total { margin-top: 14px; padding: 16px; border-radius: 8px; color: white; background: #102033; display: flex; justify-content: space-between; align-items: center; }

.section { padding: 72px 0; background: white; border-top: 1px solid var(--line); }
.section.alt { background: #f7fafc; }
.section-title { font-size: 34px; margin: 0 0 10px; }
.section-copy { color: var(--muted); max-width: 660px; line-height: 1.7; }
.feature-grid, .price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.feature, .price-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.feature svg { color: var(--primary); }
.price-card strong { font-size: 30px; display: block; margin: 12px 0; }
.cta-band { background: #102033; color: white; padding: 46px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cta-band p { color: #cbd5e1; }
.cta-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card h1 { margin: 20px 0 8px; font-size: 30px; }
.auth-card p { color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { color: #344256; font-size: 13px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 12px;
  background: white;
  outline: none;
  transition: border .18s ease, box-shadow .18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
.check-row { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 4px 0 18px; }

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  background: #0f172a;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar .brand-mark { background: linear-gradient(135deg, #60a5fa, #34d399); }
.side-nav { display: grid; gap: 6px; }
.side-link {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 7px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: 14px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.side-link.active, .side-link:hover { background: rgba(255,255,255,.12); color: white; transform: translateX(2px); }
.side-footer { margin-top: auto; display: grid; gap: 10px; color: #94a3b8; font-size: 13px; }
.main-area { min-width: 0; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.mobile-menu { display: none; }
.page { padding: 24px; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.panel-pad { padding: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 180px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.product-card {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 124px;
  display: grid;
  align-content: space-between;
  transition: transform .18s ease, border .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 12px 28px rgba(37, 99, 235, .10); }
.product-card small, .muted { color: var(--muted); }
.price { font-weight: 800; color: var(--primary); }
.cart-list { display: grid; gap: 10px; max-height: 350px; overflow: auto; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.qty { display: inline-flex; align-items: center; gap: 7px; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.totals { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 22px; font-weight: 800; color: var(--ink); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: #f8fafc; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat strong { display: block; margin-top: 8px; font-size: 26px; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 92px; gap: 12px; align-items: center; }
.bar { height: 12px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; }
.receipt { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #111827; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0; }
.receipt hr { border: 0; border-top: 1px dashed #94a3b8; margin: 12px 0; }
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 10px; }
.toast {
  width: min(360px, calc(100vw - 36px));
  background: #102033;
  color: white;
  padding: 13px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease;
}
.toast.success { background: #047857; }
.toast.error { background: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media print {
  body * { visibility: hidden; }
  .modal, .modal * { visibility: visible; }
  .modal { position: absolute; inset: 0; width: 100%; box-shadow: none; }
  .modal-head .btn, .modal-head button { display: none; }
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; }
  .feature-grid, .price-grid, .stat-grid, .grid-2 { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-102%);
    transition: transform .22s ease;
    z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .page { padding: 16px; }
  .cta-band { display: grid; padding: 28px; }
  .cta-actions { align-items: stretch; }
}

@media (max-width: 560px) {
  .site-nav { height: auto; padding: 14px 0; align-items: flex-start; }
  .nav-actions { flex-wrap: wrap; justify-content: flex-end; }
  .hero h1 { font-size: 42px; }
  .mock-grid { grid-template-columns: 1fr; }
  .page-head { display: grid; }
  .toolbar .btn, .toolbar .field { width: 100%; }
  .actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* Requirement update additions */
.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  z-index: 25;
}
.sidebar-scrim.open { opacity: 1; visibility: visible; }
.sidebar { transition: transform .24s ease, box-shadow .24s ease; }
.home-page .hero-head { align-items: flex-start; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 22px;
  align-items: stretch;
}
.home-page { background: radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34%), radial-gradient(circle at 80% 10%, rgba(16, 185, 129, .10), transparent 30%); }
.home-page .panel { border-radius: 20px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { margin: 0; }
.status-badge, .muted-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}
.status-badge.success { color: #047857; background: #d1fae5; }
.status-badge.danger { color: #b91c1c; background: #fee2e2; }
.muted-pill { color: #475569; background: #f1f5f9; }
.checkin-status { display: grid; gap: 12px; }
.empty-state { font-size: 22px; font-weight: 800; margin: 0; }
.attendance-image { width: min(260px, 100%); border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(15, 23, 42, .12); }
.sales-highlight {
  background: linear-gradient(135deg, #0f172a, #1e3a8a 58%, #0f766e);
  color: white;
  position: relative;
  overflow: hidden;
}
.checkin-card { background: linear-gradient(180deg, #ffffff, #f8fbff); }
.stock-card { background: linear-gradient(180deg, #ffffff, #f7fafc); }
.sales-highlight::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -60px;
  top: -70px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
}
.sales-highlight strong, .expenses-snapshot strong { display: block; font-size: clamp(30px, 5vw, 46px); margin: 10px 0; }
.sales-highlight p { color: #dbeafe; }
.stock-card { grid-column: span 1; }
.expenses-snapshot { background: #fff7ed; border-color: #fed7aa; }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0 18px; }
.mini-stats div { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfdff; }
.mini-stats span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.mini-stats strong { display: block; font-size: 28px; margin-top: 8px; }
.stock-chart-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pie-chart { width: 154px; height: 154px; border-radius: 999px; border: 10px solid #fff; box-shadow: 0 18px 45px rgba(15, 23, 42, .12); }
.pie-chart.clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.pie-chart.clickable:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 22px 52px rgba(15, 23, 42, .16); }
.pie-chart.clickable:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 4px; }
.legend { display: grid; gap: 9px; color: var(--muted); font-weight: 700; }
.legend span, .legend button { display: flex; align-items: center; gap: 8px; }
.legend button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 8px 11px;
  font-weight: 800;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.legend button:hover { transform: translateY(-1px); border-color: #bfdbfe; box-shadow: 0 10px 24px rgba(37, 99, 235, .08); }
.legend i { width: 11px; height: 11px; border-radius: 999px; display: inline-block; }
.transactions-layout { grid-template-columns: 1fr 360px; }
.checkout-panel { position: sticky; top: 90px; }
.transaction-panel { margin-top: 18px; }
.elevated-panel { border-radius: 20px; box-shadow: 0 18px 50px rgba(15, 23, 42, .08); }
.transaction-filters { align-items: end; padding: 4px; border-radius: 16px; background: #f8fafc; }
.summary-strip { padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #eff6ff, #ecfdf5); color: #1d4ed8; font-weight: 900; margin-bottom: 16px; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08); }
.transaction-groups { display: grid; gap: 18px; max-height: 560px; overflow: auto; padding-right: 4px; }
.transaction-group { display: grid; gap: 9px; }
.transaction-day { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.transaction-day h3 { margin: 0; }
.transaction-day span { color: var(--muted); font-weight: 800; }
.transaction-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 10px 24px rgba(15, 23, 42, .04); }
.transaction-day { background: #fff; position: sticky; top: 0; z-index: 1; border-radius: 12px; padding: 10px 12px; }
.report-filters { margin-bottom: 18px; }
.report-stat-grid { grid-template-columns: repeat(5, 1fr); }
.stat.net { background: #ecfdf5; border-color: #a7f3d0; }
.product-card:disabled { background: #f8fafc; color: #94a3b8; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.checkout-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.checkout-product-grid .product-card { min-height: 112px; border-radius: 14px; }
.checkout-summary-panel { position: sticky; top: 88px; }
.compact-cart { max-height: min(44vh, 360px); }
.sticky-total { position: sticky; bottom: 0; background: var(--panel); }
.checkout-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.user-attendance-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.user-attendance-card strong { display: block; font-size: 17px; }
.user-attendance-card span, .user-attendance-card p { color: var(--muted); margin: 0; }
.attendance-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.attendance-thumb { width: 86px; height: 86px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.attendance-workspace { min-height: 420px; display: grid; align-items: center; }
.attendance-empty { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 46px 18px; }
.attendance-empty h2 { margin: 0; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.04em; }
.attendance-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.attendance-detail-card { border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: linear-gradient(180deg, #fff, #f8fbff); display: grid; gap: 14px; align-content: start; }
.attendance-detail-card h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); letter-spacing: -.04em; }
.attendance-large-image { width: 100%; max-height: 360px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 18px 42px rgba(15, 23, 42, .10); }

.hidden-field {
  display: none !important;
}

.pos-date-panel {
  margin-bottom: 16px;
}

.pos-date-toolbar {
  margin-bottom: 0;
  align-items: end;
}

.pos-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.pos-balance-card {
  display: grid;
  gap: 12px;
  min-height: 190px;
}

.pos-balance-card.total {
  color: #fff;
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 255, 255, .18), transparent 28%),
    linear-gradient(135deg, #111827, #1d4ed8 64%, #0f766e);
}

.pos-balance-card.total .eyebrow,
.pos-balance-card.total p {
  color: rgba(255, 255, 255, .78);
}

.pos-balance-card strong {
  display: block;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -.04em;
}

.pos-balance-card p {
  margin: 0;
  color: var(--muted);
}

.pos-quick-row,
.amount-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.pos-quick-row input,
.amount-stepper input {
  text-align: center;
  font-weight: 800;
}

.pos-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pos-action-form {
  display: grid;
  gap: 10px;
}

.pos-action-form textarea {
  min-height: 92px;
  resize: vertical;
}

.pos-actions-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.pos-action-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.pos-action-item strong {
  display: block;
  line-height: 1.45;
}

.pos-action-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.pos-action-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pos-action-item small {
  align-self: start;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* POS ledger redesign */
.pos-page {
  max-width: 1320px;
}

.pos-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(30, 64, 175, .92) 62%, rgba(15, 118, 110, .92)),
    #111827;
  color: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
  overflow: hidden;
  position: relative;
}

.pos-hero::after {
  content: '';
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
}

.pos-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 8px;
}

.pos-hero-copy .eyebrow {
  color: #bfdbfe;
}

.pos-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -.045em;
}

.pos-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 16px;
}

.pos-date-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: end;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(12px);
}

.pos-date-card .field {
  margin-bottom: 0;
}

.pos-date-card label {
  color: rgba(255, 255, 255, .74);
}

.pos-date-card select,
.pos-date-card input {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .96);
}

.pos-date-card .btn {
  width: 100%;
  background: #fff;
  color: #1d4ed8;
}

.pos-balance-grid {
  grid-template-columns: 1.16fr .92fr .92fr;
  gap: 18px;
  margin-bottom: 18px;
}

.pos-balance-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .08);
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 236px;
}

.pos-balance-card::after {
  content: '';
  position: absolute;
  right: -44px;
  top: -56px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: #eff6ff;
}

.pos-balance-card.total {
  background:
    linear-gradient(135deg, #111827 0%, #1d4ed8 64%, #0f766e 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 24px 60px rgba(29, 78, 216, .22);
}

.pos-balance-card.cash::after {
  background: #ecfdf5;
}

.pos-balance-card.bank::after {
  background: #fff7ed;
}

.pos-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

.pos-balance-card.total .pos-card-icon {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.pos-balance-card.cash .pos-card-icon {
  background: #d1fae5;
  color: #047857;
}

.pos-balance-card.bank .pos-card-icon {
  background: #ffedd5;
  color: #c2410c;
}

.pos-balance-card .eyebrow,
.pos-balance-card strong,
.pos-balance-card p,
.pos-mini-label,
.pos-quick-row {
  position: relative;
  z-index: 1;
}

.pos-balance-card strong {
  font-size: clamp(30px, 4.3vw, 48px);
  letter-spacing: -.055em;
}

.pos-balance-card.total .eyebrow,
.pos-balance-card.total p {
  color: rgba(255, 255, 255, .72);
}

.pos-mini-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pos-quick-row,
.amount-stepper {
  grid-template-columns: 44px minmax(92px, 1fr) 44px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.pos-quick-row .btn,
.amount-stepper .btn {
  border-radius: 12px;
  background: #fff;
  color: #172033;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .05);
}

.pos-quick-row input,
.amount-stepper input {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 4px;
}

.pos-workspace {
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 18px;
}

.pos-action-panel,
.pos-history-panel {
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 44px rgba(16, 24, 40, .07);
}

.pos-action-panel {
  position: sticky;
  top: 88px;
}

.pos-action-panel .card-title p,
.pos-history-panel .card-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pos-action-form {
  gap: 12px;
}

.pos-action-form .field {
  margin-bottom: 0;
}

.pos-action-form select,
.pos-action-form input,
.pos-action-form textarea {
  background: #fbfdff;
}

.pos-action-form .btn.primary {
  min-height: 50px;
  margin-top: 4px;
}

.pos-history-panel {
  min-height: 430px;
}

.pos-actions-list {
  max-height: 640px;
  gap: 12px;
}

.pos-action-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 16px 16px 16px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .06);
}

.pos-action-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 999px;
  background: #2563eb;
}

.pos-action-item strong {
  font-size: 15px;
}

.pos-action-item small {
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
}

.pos-action-item.withdrawal::before {
  background: #0f766e;
}

.pos-action-item.withdrawal small {
  background: #ccfbf1;
  color: #0f766e;
}

.pos-action-item.add::before {
  background: #16a34a;
}

.pos-action-item.add small {
  background: #dcfce7;
  color: #15803d;
}

.pos-action-item.subtract::before {
  background: #dc2626;
}

.pos-action-item.subtract small {
  background: #fee2e2;
  color: #b91c1c;
}

.pos-action-item.set::before {
  background: #7c3aed;
}

.pos-action-item.set small {
  background: #ede9fe;
  color: #6d28d9;
}

@media (max-width: 1080px) {
  .dashboard-grid, .transactions-layout, .report-stat-grid, .checkout-layout, .pos-balance-grid, .pos-workspace { grid-template-columns: 1fr; }
  .checkout-panel { position: static; }
  .checkout-summary-panel { position: sticky; bottom: 0; top: auto; z-index: 8; border-radius: 18px 18px 0 0; box-shadow: 0 -18px 40px rgba(15, 23, 42, .12); }
  .checkout-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkout-controls { grid-template-columns: 1fr 1fr; }
  .compact-cart { max-height: 190px; }
  .attendance-detail-grid { grid-template-columns: 1fr; }
  .pos-hero { grid-template-columns: 1fr; }
  .pos-action-panel { position: static; }
}

@media (min-width: 921px) {
  .sidebar-scrim { display: none; }
}

/* Modern responsive polish pass */
:root {
  --bg: #f7f9fc;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #687386;
  --line: #e6edf5;
  --shadow: 0 18px 44px rgba(16, 24, 40, .08);
}

.dashboard {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 22% 0%, rgba(37, 99, 235, .08), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f7f9fc 42%, #f5f7fb 100%);
}

.sidebar {
  width: 272px;
  background: linear-gradient(180deg, #111827 0%, #172033 52%, #101828 100%);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.side-nav {
  gap: 7px;
}

.side-link {
  min-height: 44px;
  border-radius: 13px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.topbar {
  height: 68px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 28px);
}

.page-head {
  align-items: flex-start;
  margin-bottom: clamp(16px, 2.2vw, 26px);
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.06;
  letter-spacing: -.045em;
  font-weight: 800;
}

.page-head p {
  max-width: 680px;
  font-size: 15px;
}

.panel {
  border-color: var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}

.panel-pad {
  padding: clamp(15px, 2vw, 22px);
}

.btn {
  border-radius: 12px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

.btn.ghost {
  background: rgba(255, 255, 255, .72);
}

input,
select,
textarea {
  min-height: 44px;
  border-radius: 12px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2vw, 22px);
}

.sales-highlight {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, .18), transparent 28%),
    linear-gradient(135deg, #111827 0%, #1d4ed8 62%, #0f766e 100%);
  box-shadow: 0 18px 44px rgba(29, 78, 216, .18);
}

.checkin-card,
.stock-card,
.expenses-snapshot {
  min-width: 0;
}

.mini-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.mini-stats strong,
.stat strong {
  letter-spacing: -.035em;
}

.stock-chart-wrap {
  align-items: center;
}

.transaction-filters,
.toolbar {
  gap: 12px;
}

.transaction-item {
  align-items: flex-start;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  min-width: 760px;
}

.checkout-layout,
.transactions-layout,
.grid-2 {
  min-width: 0;
}

.checkout-product-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.floating-cart-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: white;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(29, 78, 216, .24);
}

.floating-cart-btn.has-items {
  background: linear-gradient(135deg, #0f172a, #0f766e);
}

.floating-cart-icon {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.floating-cart-meta {
  display: grid;
  gap: 1px;
  text-align: left;
}

.floating-cart-meta span {
  font-size: 11px;
  color: rgba(255,255,255,.78);
  font-weight: 800;
}

.floating-cart-meta strong {
  font-size: 15px;
  line-height: 1;
}

.cart-modal-shell {
  display: grid;
  gap: 14px;
}

.cart-modal-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.cart-modal-topline span {
  color: var(--muted);
  font-weight: 800;
}

.cart-modal-controls {
  margin-top: 4px;
}

.sale-success-shell {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 18px 10px 8px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.sale-success-shell h2,
.sale-success-shell p {
  margin: 0;
}

.sale-success-check {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10b981, #2563eb);
  color: white;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(16, 185, 129, .22);
}

.sale-success-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sale-success-confetti span {
  position: absolute;
  top: -8px;
  left: calc((var(--piece) * 5.2%) + 4%);
  width: 9px;
  height: 18px;
  border-radius: 999px;
  background: hsl(calc(var(--piece) * 20deg), 90%, 60%);
  animation: confettiDrop .95s ease-out forwards;
  animation-delay: calc(var(--piece) * .03s);
  transform: rotate(calc(var(--piece) * 12deg));
}

.cart-item {
  min-width: 0;
}

@media (min-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  }

  .sales-highlight,
  .checkin-card {
    min-height: 220px;
  }
}

@media (max-width: 920px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 15px;
  }

  .dashboard {
    display: block;
  }

  .sidebar {
    width: min(86vw, 320px);
    height: 100dvh;
    overflow-y: auto;
    box-shadow: 24px 0 70px rgba(15, 23, 42, .26);
  }

  .sidebar-scrim.open {
    backdrop-filter: blur(2px);
  }

  .main-area {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    height: 64px;
    gap: 10px;
  }

  .topbar strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-head {
    display: grid;
    gap: 10px;
  }

  .page-head .btn,
  .page-head .status-badge {
    justify-self: start;
  }

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

  .transaction-groups {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .transaction-day {
    position: static;
  }

  .checkout-layout {
    gap: 12px;
  }

  .checkout-products-panel {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 12px;
  }

  .panel-pad {
    padding: 14px;
  }

  .page-head h1 {
    font-size: clamp(25px, 9vw, 34px);
  }

  .pos-action-item {
    display: grid;
  }

  .pos-action-item small {
    justify-self: start;
  }

  .pos-hero {
    border-radius: 20px;
    padding: 18px;
  }

  .pos-date-card {
    padding: 12px;
  }

  .pos-balance-card,
  .pos-action-panel,
  .pos-history-panel {
    border-radius: 18px;
  }

  .pos-quick-row,
  .amount-stepper {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .card-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .transaction-filters {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar .field,
  .toolbar .btn,
  .transaction-filters .field,
  .transaction-filters .btn {
    width: 100%;
  }

  .stat-grid,
  .report-stat-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .sales-highlight strong,
  .expenses-snapshot strong {
    font-size: clamp(30px, 10vw, 42px);
  }

  .stock-chart-wrap {
    justify-content: center;
    text-align: left;
  }

  .checkout-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .checkout-product-grid .product-card {
    padding: 12px;
    min-height: 104px;
  }

  .checkout-controls {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .qty {
    justify-content: space-between;
  }

  .transaction-item,
  .transaction-day {
    display: grid;
    grid-template-columns: 1fr;
  }

  .attendance-workspace {
    min-height: auto;
  }

  .attendance-empty {
    padding: 28px 8px;
  }

  .attendance-large-image {
    max-height: 260px;
  }
}

@media (max-width: 380px) {
  .checkout-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar .muted {
    display: none;
  }
}

/* Checkout speed pass: keep sale logging compact on phones */
.checkout-products-panel {
  min-width: 0;
}

.checkout-product-grid .product-card {
  gap: 8px;
  overflow: hidden;
}

.checkout-product-grid .product-card strong {
  display: block;
  margin-top: 3px;
  line-height: 1.15;
}

@media (max-width: 920px) {
  .checkout-layout {
    gap: 12px;
  }

  .floating-cart-btn {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 9px 11px;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .checkout-toolbar {
    margin-bottom: 10px;
  }

  .checkout-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .checkout-product-grid .product-card {
    min-height: 86px;
    padding: 10px;
    border-radius: 13px;
    font-size: 13px;
  }

  .checkout-product-grid .product-card small {
    font-size: 11px;
    line-height: 1.2;
  }

  .checkout-product-grid .price {
    font-size: 15px;
  }

  .cart-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .cart-item small {
    font-size: 12px;
  }

  .qty {
    justify-content: flex-end;
    gap: 5px;
  }

  .qty button {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .qty .btn.icon {
    width: 28px;
    height: 28px;
  }

  .checkout-controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .checkout-controls label {
    font-size: 12px;
  }

  .totals {
    margin-top: 10px;
    padding-top: 10px;
  }

  .totals .grand {
    font-size: 18px;
  }

  .floating-cart-meta strong {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .checkout-product-grid .product-card {
    min-height: 78px;
    padding: 9px;
  }

  .checkout-controls {
    grid-template-columns: 1fr;
  }
}

@keyframes confettiDrop {
  0% {
    opacity: 0;
    transform: translateY(-12px) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(170px) rotate(220deg);
  }
}

/* Stock drill-down */
.stock-explorer-panel {
  display: grid;
  gap: 18px;
}

.stock-filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-filter-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(16, 24, 40, .05);
}

.stock-filter-btn i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.stock-filter-btn.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.stock-empty {
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.stock-empty h2 {
  margin: 0 0 6px;
}

.stock-results-title {
  margin-bottom: 12px;
}

.stock-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.stock-product-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .05);
  display: grid;
  gap: 7px;
}

.stock-product-card strong {
  font-size: 17px;
}

.stock-product-card span {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 640px) {
  .stock-filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stock-filter-btn {
    justify-content: center;
    padding: 11px 10px;
  }

  .stock-product-grid {
    grid-template-columns: 1fr;
  }
}
