:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --brand: #0f766e;
  --brand-dark: #0b5e58;
  --accent: #2563eb;
  --danger: #b42318;
  --good: #167647;
  --warn: #b54708;
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  --soft-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Modern dashboard refresh */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1d2939;
  --muted: #667085;
  --line: #eaecf0;
  --brand: #465fff;
  --brand-dark: #3641f5;
  --accent: #12b76a;
  --danger: #d92d20;
  --good: #039855;
  --warn: #dc6803;
  --shadow: 0 22px 50px rgba(16, 24, 40, 0.10);
  --soft-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
}

body {
  background:
    radial-gradient(circle at top left, rgba(70, 95, 255, 0.08), transparent 28%),
    var(--bg);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px rgba(16, 24, 40, 0.03);
}

.brand {
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #7a5cff);
  box-shadow: 0 12px 28px rgba(70, 95, 255, 0.25);
}

.brand strong {
  color: #101828;
  font-size: 17px;
  letter-spacing: 0;
}

.nav {
  gap: 4px;
  padding: 2px;
  align-content: start;
  overflow: visible;
}

.nav-link {
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 10px;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
}

.nav-link i {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f2f4f7;
  color: #667085;
}

.nav-link.active,
.nav-link:hover {
  background: #f4f6ff;
  color: var(--brand-dark);
  transform: none;
}

.nav-link.active i,
.nav-link:hover i {
  background: #eef2ff;
  color: var(--brand-dark);
}

.nav-group {
  position: relative;
}

.nav-toggle {
  border: 0;
}

.nav-caret {
  margin-left: auto;
  display: inline-flex;
  color: #98a2b3;
  font-size: 11px;
  transition: transform 0.16s ease;
}

.nav-group.open .nav-caret {
  transform: rotate(90deg);
}

.nav-flyout {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  z-index: 30;
  width: 216px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-group.open .nav-flyout {
  display: grid;
  gap: 4px;
}

.nav-sub-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #475467;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.nav-sub-link i {
  width: 24px;
  color: #98a2b3;
  text-align: center;
}

.nav-sub-link.active,
.nav-sub-link:hover {
  background: #f4f6ff;
  color: var(--brand-dark);
}

.nav-sub-link.active i,
.nav-sub-link:hover i {
  color: var(--brand-dark);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.user-pill {
  border-radius: 14px;
  background: #f9fafb;
}

.content {
  padding: 32px;
}

.topbar {
  margin-bottom: 24px;
}

h1 {
  color: #101828;
  font-size: 32px;
  font-weight: 800;
}

h2 {
  color: #101828;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--soft-shadow);
}

.panel,
.form-panel {
  padding: 20px;
}

.stat {
  padding: 20px;
}

.stat::before {
  height: 0;
}

.stat span {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  color: #101828;
  font-size: 28px;
}

.btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 14px;
  background: #f2f4f7;
  color: #344054;
  font-weight: 800;
  box-shadow: none;
}

.btn:hover {
  transform: none;
  background: #e4e7ec;
  box-shadow: none;
}

.btn.primary {
  background: var(--brand);
  box-shadow: 0 10px 20px rgba(70, 95, 255, 0.18);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fff1f3;
  color: var(--danger);
}

label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 42px;
  border-radius: 10px;
  border-color: #d0d5dd;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.12);
}

.cart-item {
  border-radius: 14px;
  border-color: var(--line);
  background: #fcfcfd;
  padding: 14px;
}

th {
  background: #f9fafb;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

td {
  color: #344054;
}

tbody tr:hover {
  background: #f9fbff;
}

.badge {
  border-radius: 999px;
  font-weight: 800;
}

.badge.good {
  background: #ecfdf3;
  color: var(--good);
}

.badge.warn,
.diff-badge.warn {
  background: #fffaeb;
  color: var(--warn);
}

.badge.danger {
  background: #fff1f3;
  color: var(--danger);
}

.price-preview {
  color: var(--brand-dark);
}

.report-filter {
  padding: 16px;
}

.report-tab {
  border-radius: 10px;
}

.invoice-detail,
.mini-table {
  border-radius: 12px;
}

.toast {
  border-radius: 14px;
  background: #101828;
  box-shadow: var(--shadow);
}

.login-page {
  background:
    radial-gradient(circle at top left, rgba(70, 95, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #f8faff, #eef4ff);
}

.login-box {
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.login-icon {
  border-radius: 14px;
  background: #eef2ff;
  color: var(--brand-dark);
}

@media (max-width: 560px) {
  body {
    background: #f8fafc;
  }

  .content {
    background: #f8fafc;
  }

  .sidebar {
    border-radius: 18px 18px 0 0;
  }

  .nav-link {
    border-radius: 12px;
  }

  .panel,
  .form-panel,
  .stat,
  .report-filter {
    border-radius: 14px;
  }
}

/* Final Gentelella-style sidebar refinement */
.app-shell {
  grid-template-columns: 230px minmax(0, 1fr) !important;
}

.sidebar {
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  width: 230px !important;
  padding: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  background: #2a3f54 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.brand {
  min-height: 54px !important;
  padding: 10px 13px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.brand-mark {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: #1abb9c !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.brand strong {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.brand span {
  display: none !important;
}

.nav {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
  padding: 8px 8px 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.nav-link,
.nav-toggle {
  min-height: 32px !important;
  padding: 7px 9px !important;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #e7e7e7 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.nav-link i,
.nav-toggle i {
  width: 18px !important;
  min-width: 18px !important;
  height: auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #b8c7ce !important;
  font-size: 13px !important;
}

.nav-link span,
.nav-toggle span {
  font-size: 12px !important;
  font-weight: 400 !important;
}

.nav-link:hover,
.nav-link.active,
.nav-toggle:hover,
.nav-toggle.active {
  border-left-color: #1abb9c !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)) !important;
  color: #fff !important;
  transform: none !important;
}

.nav-link:hover i,
.nav-link.active i,
.nav-toggle:hover i,
.nav-toggle.active i {
  color: #fff !important;
}

.nav-group {
  position: static !important;
  display: block !important;
}

.nav-caret {
  margin-left: auto !important;
  color: #b8c7ce !important;
  font-size: 9px !important;
}

.nav-group.open .nav-caret,
.nav-toggle.active .nav-caret {
  transform: rotate(90deg) !important;
}

.nav-flyout {
  position: static !important;
  z-index: auto !important;
  display: none !important;
  width: auto !important;
  margin: 2px 0 5px 24px !important;
  padding: 2px 0 2px 7px !important;
  border: 0 !important;
  border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.nav-group.open .nav-flyout,
.nav-toggle.active + .nav-flyout {
  display: grid !important;
  gap: 1px !important;
}

.nav-sub-link {
  min-height: 28px !important;
  padding: 6px 8px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #cbd6dd !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
}

.nav-sub-link i {
  width: 16px !important;
  color: #9fb1bd !important;
  font-size: 11px !important;
}

.nav-sub-link:hover,
.nav-sub-link.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.sidebar-footer {
  flex: 0 0 auto !important;
  display: grid !important;
  gap: 8px !important;
  padding: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #23384d !important;
}

.user-pill {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.user-avatar {
  display: grid !important;
  place-items: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #1abb9c !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.user-pill strong {
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

.user-pill span:not(.user-avatar) {
  color: #b8c7ce !important;
  font-size: 9.5px !important;
  font-weight: 400 !important;
}

.sidebar-footer .btn.ghost {
  justify-content: center !important;
  width: 100% !important;
  min-height: 30px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ecf0f1 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

@media (max-width: 560px) {
  .sidebar {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 100 !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    height: 70px !important;
    padding: 6px 8px !important;
  }

  .brand {
    display: none !important;
  }

  .nav {
    flex-direction: row !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .nav-link,
  .nav-toggle {
    flex: 0 0 62px !important;
    min-width: 62px !important;
    min-height: 50px !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px 4px !important;
    border-left: 0 !important;
    border-top: 2px solid transparent !important;
    text-align: center !important;
  }

  .nav-link span,
  .nav-toggle span {
    max-width: 58px !important;
    overflow: hidden !important;
    font-size: 9.5px !important;
    text-overflow: ellipsis !important;
  }

  .nav-flyout {
    position: fixed !important;
    right: 8px !important;
    bottom: 76px !important;
    left: 8px !important;
    margin: 0 !important;
    padding: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: #172d44 !important;
  }

  .sidebar-footer {
    display: flex !important;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
  }

  .user-pill {
    display: none !important;
  }

  .sidebar-footer .btn.ghost {
    flex-direction: column !important;
    gap: 4px !important;
    width: 58px !important;
    min-height: 50px !important;
    padding: 6px 4px !important;
    border: 0 !important;
    font-size: 9.5px !important;
  }
}

/* Gentelella-inspired compact admin shell */
:root {
  --gt-sidebar: #2a3f54;
  --gt-sidebar-deep: #172d44;
  --gt-sidebar-soft: #33485d;
  --gt-accent: #1abb9c;
  --gt-bg: #f7f7f7;
  --gt-line: #e6e9ed;
  --gt-text: #34495e;
  --gt-muted: #73879c;
}

body {
  background: var(--gt-bg) !important;
  color: var(--gt-text) !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}

.app-shell {
  grid-template-columns: 230px minmax(0, 1fr) !important;
  background: var(--gt-bg) !important;
}

.sidebar {
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
  width: 230px !important;
  padding: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  background: var(--gt-sidebar) !important;
  box-shadow: none !important;
  color: #ecf0f1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.brand {
  min-height: 54px !important;
  padding: 10px 13px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  gap: 10px !important;
}

.brand-mark {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: var(--gt-accent) !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.brand strong {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
}

.brand span {
  color: #b8c7ce !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
}

.nav {
  flex: 1 1 auto !important;
  gap: 1px !important;
  padding: 8px 8px 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent !important;
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.nav-link,
.nav-toggle {
  min-height: 32px !important;
  padding: 7px 9px !important;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #e7e7e7 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

.nav-link i,
.nav-toggle i {
  width: 18px !important;
  min-width: 18px !important;
  height: auto !important;
  background: transparent !important;
  color: #b8c7ce !important;
  font-size: 13px !important;
  box-shadow: none !important;
}

.nav-link span,
.nav-toggle span {
  font-size: 12px !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
}

.nav-link:hover,
.nav-toggle:hover,
.nav-link.active,
.nav-toggle.active {
  border-left-color: var(--gt-accent) !important;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)) !important;
  color: #fff !important;
  transform: none !important;
}

.nav-link:hover i,
.nav-toggle:hover i,
.nav-link.active i,
.nav-toggle.active i {
  color: #fff !important;
}

.nav-caret {
  margin-left: auto !important;
}

.nav-caret i {
  width: auto !important;
  min-width: 0 !important;
  font-size: 9px !important;
}

.nav-flyout {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 3px !important;
  background: var(--gt-sidebar-deep) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22) !important;
}

.nav-sub-link {
  min-height: 31px !important;
  padding: 7px 10px !important;
  border-radius: 0 !important;
  color: #d9e4ea !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.nav-sub-link i {
  color: #b8c7ce !important;
  font-size: 12px !important;
}

.nav-sub-link:hover,
.nav-sub-link.active {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.sidebar-footer {
  flex: 0 0 auto !important;
  display: grid !important;
  gap: 8px !important;
  padding: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #23384d !important;
}

.user-pill {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.user-avatar {
  display: grid !important;
  place-items: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: var(--gt-accent) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.user-pill strong {
  display: block !important;
  overflow: hidden !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.user-pill span:not(.user-avatar) {
  display: block !important;
  color: #b8c7ce !important;
  font-size: 9.5px !important;
  font-weight: 400 !important;
  letter-spacing: 0.05em !important;
}

.sidebar-footer .btn.ghost {
  justify-content: center !important;
  width: 100% !important;
  min-height: 30px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ecf0f1 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.sidebar-footer .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.content {
  padding: 16px 20px 32px !important;
  background: var(--gt-bg) !important;
}

.topbar {
  min-height: 50px !important;
  margin: -16px -20px 16px !important;
  padding: 12px 20px !important;
  border-bottom: 1px solid #d9dee4 !important;
  background: #fff !important;
  box-shadow: none !important;
}

h1 {
  color: #2a3f54 !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

h2 {
  color: #2a3f54 !important;
  font-size: 15px !important;
  font-weight: 400 !important;
}

.muted,
.helper,
small {
  color: var(--gt-muted) !important;
}

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter,
.invoice-detail,
.mini-table {
  border: 1px solid var(--gt-line) !important;
  border-radius: 3px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.panel,
.form-panel,
.report-filter {
  padding: 12px 14px !important;
}

.stat {
  min-height: 82px !important;
  padding: 12px 14px !important;
}

.stat span {
  margin-bottom: 6px !important;
  color: var(--gt-muted) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

.stat strong {
  color: #2a3f54 !important;
  font-size: 21px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
}

.btn {
  min-height: 32px !important;
  padding: 7px 11px !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.btn.primary {
  background: var(--gt-accent) !important;
  color: #fff !important;
}

.btn.primary:hover {
  background: #169f85 !important;
}

.btn.danger {
  background: #fff5f5 !important;
  color: #c0392b !important;
}

label {
  color: #34495e !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

input,
select,
textarea {
  min-height: 32px !important;
  border-color: #ccd0d7 !important;
  border-radius: 3px !important;
  color: #34495e !important;
  font-size: 12px !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gt-accent) !important;
  box-shadow: 0 0 0 2px rgba(26, 187, 156, 0.12) !important;
}

th {
  background: #f7f7f7 !important;
  color: var(--gt-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}

td {
  color: #34495e !important;
  font-size: 12px !important;
}

th,
td {
  padding: 8px 10px !important;
}

tbody tr:hover {
  background: #fafafa !important;
}

.badge {
  border-radius: 3px !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
}

.cart-item {
  border-radius: 3px !important;
  background: #fff !important;
}

.login-box {
  border-radius: 4px !important;
}

@media (max-width: 560px) {
  .app-shell {
    display: block !important;
  }

  .sidebar {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    height: 70px !important;
    max-height: 70px !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  .brand {
    display: none !important;
  }

  .nav {
    display: flex !important;
    flex: 1 1 auto !important;
    gap: 5px !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .nav-link,
  .nav-toggle {
    flex: 0 0 62px !important;
    min-width: 62px !important;
    min-height: 50px !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px 4px !important;
    border-left: 0 !important;
    border-top: 2px solid transparent !important;
    text-align: center !important;
  }

  .nav-link span,
  .nav-toggle span {
    max-width: 58px !important;
    overflow: hidden !important;
    font-size: 9.5px !important;
    text-overflow: ellipsis !important;
  }

  .nav-link i,
  .nav-toggle i {
    width: auto !important;
    min-width: 0 !important;
    font-size: 14px !important;
  }

  .nav-link.active,
  .nav-link:hover,
  .nav-toggle.active,
  .nav-toggle:hover {
    border-top-color: var(--gt-accent) !important;
  }

  .sidebar-footer {
    flex: 0 0 auto !important;
    display: flex !important;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
  }

  .user-pill {
    display: none !important;
  }

  .sidebar-footer .btn.ghost {
    flex-direction: column !important;
    gap: 4px !important;
    width: 58px !important;
    min-height: 50px !important;
    padding: 6px 4px !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    font-size: 9.5px !important;
  }

  .nav-flyout {
    position: fixed !important;
    right: 8px !important;
    bottom: 76px !important;
    left: 8px !important;
    width: auto !important;
  }

  .content {
    padding: 12px 12px 86px !important;
  }

  .topbar {
    margin: -12px -12px 12px !important;
    padding: 10px 12px !important;
  }

  h1 {
    font-size: 18px !important;
  }
}

/* PSSHC-inspired control room polish */
:root {
  --bg: #f3f1e9;
  --panel: #ffffff;
  --ink: #07110e;
  --muted: #718078;
  --line: #dfe3df;
  --brand: #07583d;
  --brand-dark: #064831;
  --accent: #c9ff36;
  --danger: #b42318;
  --good: #087245;
  --warn: #b54708;
  --shadow: 0 26px 70px rgba(7, 17, 14, 0.12);
  --soft-shadow: 0 12px 34px rgba(7, 17, 14, 0.06);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #06130f;
  color: #fff;
  border-right: 0;
  box-shadow: none;
  padding: 28px 20px;
}

.brand {
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark,
.login-brand > span {
  width: 44px;
  height: 51px;
  border-radius: 0;
  background: var(--accent);
  color: var(--brand);
  clip-path: polygon(50% 0, 94% 18%, 86% 78%, 50% 100%, 14% 78%, 6% 18%);
  box-shadow: none;
  font-weight: 900;
}

.brand strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.brand span,
.user-pill span {
  color: #8ea098;
  font-size: 10px;
  letter-spacing: 2px;
}

.nav {
  gap: 5px;
  padding: 0;
}

.nav-link {
  min-height: 42px;
  border-radius: 4px;
  padding: 11px 12px;
  color: #99aaa3;
  font-size: 12px;
  font-weight: 800;
}

.nav-link i {
  width: 25px;
  min-width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #102b21;
  color: #789187;
}

.nav-link.active,
.nav-link:hover {
  background: #102b21;
  color: #fff;
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-link.active i,
.nav-link:hover i {
  background: #17392d;
  color: var(--accent);
}

.nav-caret {
  color: #5f766c;
}

.nav-flyout {
  border: 1px solid #17392d;
  border-radius: 6px;
  background: #06130f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.nav-sub-link {
  border-radius: 4px;
  color: #99aaa3;
}

.nav-sub-link.active,
.nav-sub-link:hover {
  background: #102b21;
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-pill {
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: #0b1e17;
}

.user-pill strong {
  color: #fff;
}

.sidebar .btn.ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: #d4ddd8;
}

.content {
  padding: 34px 42px 60px;
}

.topbar {
  min-height: 74px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.topbar h1 {
  font-size: 30px;
  letter-spacing: -1px;
}

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

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter {
  border-radius: 0;
  border: 0;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.panel,
.form-panel {
  padding: 24px;
}

.stat {
  min-height: 118px;
  padding: 24px;
  border-top: 4px solid transparent;
}

.stat:hover {
  border-top-color: var(--accent);
}

.stat span {
  color: #77857e;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.stat strong {
  color: var(--ink);
  font-size: 34px;
  letter-spacing: -1px;
}

h2 {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.btn {
  border-radius: 0;
  background: #e9eee9;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fbe8e8;
  color: #a22;
}

label {
  color: #516159;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

input,
select,
textarea {
  border-radius: 0;
  border-color: #d8ded9;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 88, 61, 0.12);
}

th {
  background: #fafbfa;
  color: #74827b;
  font-size: 9px;
  letter-spacing: 1px;
}

td {
  color: #26362f;
}

tbody tr:hover {
  background: #f8faf8;
}

.badge {
  border-radius: 0;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.badge.good {
  background: #dff3e7;
  color: var(--good);
}

.badge.danger {
  background: #fbe8e8;
  color: #a22;
}

.toast {
  border-radius: 0;
  background: #06130f;
  color: #fff;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 25px;
  background:
    radial-gradient(circle at 70% 20%, rgba(18, 117, 83, 0.96), #04120e 55%),
    #04120e;
}

.login-box {
  width: min(470px, 100%);
  padding: 45px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand div {
  display: flex;
  flex-direction: column;
}

.login-brand b {
  font-size: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-brand small {
  color: #84908b;
  font-size: 8px;
  letter-spacing: 3px;
}

.login-kicker {
  margin: 44px 0 0;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
}

.login-heading {
  display: block;
}

.login-heading h1 {
  margin: 12px 0 10px;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -1.5px;
}

.login-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-card {
  gap: 18px;
  margin-top: 28px;
}

.login-card .btn.primary {
  justify-content: space-between;
  margin-top: 8px;
  background: var(--accent);
  color: var(--brand);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px 20px 110px;
  }
}

@media (max-width: 560px) {
  body,
  .content {
    background: var(--bg);
  }

  .login-box {
    padding: 30px;
  }

  .login-heading h1 {
    font-size: 30px;
  }

  .sidebar {
    background: #06130f;
    border-radius: 0;
    padding: 8px 10px;
  }

  .nav-link {
    min-width: 82px;
    border-radius: 4px;
    color: #b8c7c0;
  }

  .nav-link.active {
    box-shadow: inset 0 3px 0 var(--accent);
  }

  .nav-flyout {
    background: #06130f;
    border-color: #17392d;
  }

  .panel,
  .form-panel,
  .stat,
  .report-filter {
    border-radius: 0;
  }
}

/* Compact CRM redesign */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #4361ee;
  --brand-dark: #3446c7;
  --accent: #4895ef;
  --danger: #dc2626;
  --good: #16a34a;
  --warn: #d97706;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --soft-shadow: 0 6px 20px rgba(15, 23, 42, 0.045);
}

html {
  font-size: 14px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  width: 236px;
  padding: 14px 10px;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  gap: 10px;
}

.brand {
  gap: 10px;
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 34px;
  height: 34px;
  clip-path: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  box-shadow: none;
}

.brand strong {
  color: #111827;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.brand span {
  color: #9ca3af;
  font-size: 10px;
  letter-spacing: 0.3px;
}

.nav {
  gap: 3px;
  padding: 0 2px;
}

.nav-link {
  min-height: 35px;
  border-radius: 9px;
  padding: 7px 9px;
  gap: 8px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-link i {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(67, 97, 238, 0.1);
  color: var(--brand);
  box-shadow: none;
}

.nav-link.active i,
.nav-link:hover i {
  background: transparent;
  color: var(--brand);
}

.nav-caret {
  color: #9ca3af;
}

.nav-flyout {
  width: 190px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-sub-link {
  min-height: 34px;
  border-radius: 8px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}

.nav-sub-link.active,
.nav-sub-link:hover {
  background: rgba(67, 97, 238, 0.1);
  color: var(--brand);
}

.content {
  padding: 18px 22px 42px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  color: #111827;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar .muted {
  margin: 3px 0 0;
  font-size: 12px;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-user div {
  display: grid;
  gap: 1px;
  min-width: 92px;
}

.topbar-user strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.1;
}

.topbar-user small {
  color: #9ca3af;
  font-size: 10px;
  line-height: 1.1;
}

.topbar-logout {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--danger);
  text-decoration: none;
}

.topbar-logout:hover {
  background: #fee2e2;
}

.grid {
  gap: 12px;
}

.grid.two {
  gap: 12px;
}

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.panel,
.form-panel {
  padding: 14px;
}

h2 {
  margin-bottom: 10px;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.stat {
  min-height: 86px;
  padding: 14px;
  border-top: 0;
}

.stat:hover {
  border-top: 0;
}

.stat span {
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.stat strong {
  color: #111827;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.toolbar {
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  min-height: 32px;
  border-radius: 8px;
  padding: 7px 10px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.btn.small {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11px;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fee2e2;
  color: var(--danger);
}

label {
  gap: 5px;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

input,
select,
textarea {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 9px;
  border-color: #d1d5db;
  color: #111827;
  font-size: 12px;
}

textarea {
  min-height: 64px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.report-filter {
  padding: 10px;
  gap: 9px;
}

.form-grid {
  gap: 9px;
}

.cart-item {
  padding: 9px;
  border-radius: 10px;
  background: #f9fafb;
}

table {
  font-size: 12px;
}

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

th {
  background: #f9fafb;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

td {
  color: #374151;
}

.badge {
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.summary-line {
  padding: 7px 0;
  font-size: 12px;
}

.summary-line.total {
  font-size: 16px;
}

.empty {
  padding: 18px;
  font-size: 12px;
}

.toast {
  border-radius: 10px;
  font-size: 12px;
}

.login-box {
  border-radius: 16px;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .content {
    padding: 14px 12px 86px;
  }

  .topbar {
    min-height: 50px;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    display: flex;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar-user {
    flex-shrink: 0;
    padding: 4px;
  }

  .topbar-user div {
    display: none;
  }

  .topbar-avatar,
  .topbar-logout {
    width: 28px;
    height: 28px;
  }

  .sidebar {
    max-height: 72px;
    padding: 6px 8px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.08);
  }

  .nav {
    gap: 6px;
  }

  .nav-link {
    min-width: 68px;
    min-height: 52px;
    padding: 6px 5px;
    border-radius: 10px;
    color: #4b5563;
    font-size: 10px;
  }

  .nav-link i {
    width: 22px;
    min-width: 22px;
    height: 22px;
  }

  .nav-link.active {
    box-shadow: none;
  }

  .nav-flyout {
    bottom: 78px;
    background: #fff;
    border-color: var(--line);
  }

  .panel,
  .form-panel,
  .stat,
  .report-filter {
    border-radius: 12px;
  }

  th,
  td {
    padding: 7px 8px;
    font-size: 11px;
  }
}

/* Extra slim CRM density */
html {
  font-size: 13px;
}

body {
  font-size: 12px;
  line-height: 1.45;
}

.app-shell {
  grid-template-columns: 216px minmax(0, 1fr);
}

.sidebar {
  width: 216px;
  padding: 10px 8px;
}

.brand {
  padding: 4px 8px 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.brand strong {
  font-size: 13px;
  font-weight: 650;
}

.brand span {
  font-size: 9px;
}

.nav {
  gap: 2px;
}

.nav-link {
  min-height: 31px;
  padding: 5px 8px;
  border-radius: 8px;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 500;
}

.nav-link i {
  width: 19px;
  min-width: 19px;
  height: 19px;
  font-size: 10.5px;
}

.nav-sub-link {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 500;
}

.content {
  padding: 14px 18px 34px;
}

.topbar {
  min-height: 46px;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 650;
}

.topbar .muted {
  font-size: 11px;
}

.topbar-user {
  gap: 7px;
  padding: 4px 6px;
  border-radius: 10px;
}

.topbar-avatar,
.topbar-logout {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.topbar-user strong {
  font-size: 11px;
  font-weight: 600;
}

.topbar-user small {
  font-size: 9px;
}

.grid {
  gap: 9px;
}

.panel,
.form-panel {
  padding: 11px;
}

h2 {
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.stat {
  min-height: 72px;
  padding: 11px;
}

.stat span {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 500;
}

.stat strong {
  font-size: 18px;
  font-weight: 650;
}

.toolbar {
  gap: 7px;
  margin-bottom: 8px;
}

.muted {
  font-size: 11.5px;
}

label {
  font-size: 10.5px;
  font-weight: 500;
}

input,
select,
textarea {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11.5px;
}

textarea {
  min-height: 56px;
}

.btn {
  min-height: 29px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
}

.btn.small {
  min-height: 25px;
  padding: 4px 7px;
  font-size: 10.5px;
}

.badge {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 9.5px;
  font-weight: 600;
}

.report-filter {
  padding: 8px;
  gap: 7px;
}

.form-grid {
  gap: 7px;
}

.cart-item {
  padding: 7px;
}

table {
  font-size: 11.5px;
}

th,
td {
  padding: 6px 8px;
  font-size: 11.5px;
}

th {
  font-size: 9.5px;
  font-weight: 600;
}

td strong,
.summary-line strong {
  font-weight: 600;
}

.summary-line {
  padding: 5px 0;
  font-size: 11.5px;
}

.summary-line.total {
  font-size: 14px;
}

.empty {
  padding: 14px;
  font-size: 11.5px;
}

.invoice-detail summary {
  font-size: 11px;
  font-weight: 600;
}

.login-heading h1 {
  font-weight: 650;
}

@media (max-width: 560px) {
  .content {
    padding: 10px 10px 78px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .sidebar {
    max-height: 64px;
    padding: 5px 7px;
  }

  .nav-link {
    min-width: 60px;
    min-height: 46px;
    padding: 5px 4px;
    font-size: 9.5px;
    font-weight: 500;
  }

  .nav-link i {
    width: 19px;
    min-width: 19px;
    height: 19px;
  }

  .nav-flyout {
    bottom: 70px;
  }

  th,
  td {
    padding: 6px 7px;
    font-size: 10.5px;
  }
}

/* Sidebar grouped menu */
.sidebar {
  overflow: visible;
}

.nav {
  overflow: visible;
}

.nav-group {
  position: relative;
}

.nav-toggle {
  border: 0;
  font: inherit;
}

.nav-caret {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  color: #98a2b3;
  font-size: 11px;
  transition: transform 0.16s ease;
}

.nav-group.open .nav-caret {
  transform: rotate(90deg);
}

.nav-flyout {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  z-index: 30;
  width: 218px;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-group.open .nav-flyout {
  display: grid;
  gap: 4px;
}

.nav-sub-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #475467;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.nav-sub-link i {
  width: 24px;
  color: #98a2b3;
  text-align: center;
}

.nav-sub-link.active,
.nav-sub-link:hover {
  background: #f4f6ff;
  color: var(--brand-dark);
}

.nav-sub-link.active i,
.nav-sub-link:hover i {
  color: var(--brand-dark);
}

.sidebar-footer .btn {
  width: 100%;
}

@media (max-width: 560px) {
  .nav-group {
    position: static;
  }

  .nav-toggle .nav-caret {
    display: none;
  }

  .nav-flyout {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 96px;
    top: auto;
    width: auto;
    max-height: 52vh;
    overflow: auto;
    border-radius: 16px;
    z-index: 40;
  }

  .nav-sub-link {
    min-height: 44px;
    font-size: 13px;
  }
}

/* Product page layout */
.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.five {
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr));
}

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

.purchase-cart-table {
  min-width: 760px;
}

.purchase-cart-table tfoot td {
  background: #f8fafc;
}

.purchase-empty {
  border-top: 1px solid var(--line);
}

.payout-table {
  min-width: 820px;
}

.check-col {
  width: 62px;
  text-align: center;
}

.payout-check {
  width: 18px;
  min-height: 18px;
  margin: 0 auto;
  display: block;
}

.payout-selected-total {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.payout-selected-total > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.payout-selected-total strong {
  font-size: 17px;
  color: #101828;
}

.payout-selected-total .payout-grand {
  background: #eef4ff;
  border-color: #c7d7fe;
}

@media (max-width: 980px) {
  .form-grid.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .form-grid.five {
    grid-template-columns: 1fr;
  }

  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .purchase-cart-table {
    min-width: 680px;
  }

  .payout-selected-total {
    grid-template-columns: 1fr;
  }
}

/* Tailwind-style compact admin layout */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #0ea5e9;
  --danger: #dc2626;
  --good: #16a34a;
  --warn: #d97706;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --soft-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  padding: 14px 10px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: none;
  gap: 12px;
}

.brand {
  gap: 10px;
  padding: 8px 8px 12px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand);
  box-shadow: none;
  font-size: 15px;
}

.brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand span,
.user-pill span {
  font-size: 11px;
}

.nav {
  gap: 2px;
}

.nav-link {
  min-height: 38px;
  border-radius: 8px;
  padding: 7px 8px;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.nav-link i {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
}

.nav-link.active,
.nav-link:hover {
  background: #eff6ff;
  color: var(--brand-dark);
}

.nav-link.active i,
.nav-link:hover i {
  background: #dbeafe;
  color: var(--brand-dark);
}

.sidebar-footer {
  gap: 8px;
  padding-top: 10px;
}

.user-pill {
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.user-pill strong {
  font-size: 13px;
}

.content {
  padding: 22px;
}

.topbar {
  margin-bottom: 16px;
}

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 750;
}

h2 {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 750;
}

.muted {
  font-size: 13px;
}

.grid {
  gap: 12px;
}

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.panel,
.form-panel {
  padding: 14px;
}

.stat {
  padding: 14px;
}

.stat span {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 650;
}

.stat strong {
  font-size: 22px;
  font-weight: 800;
}

.toolbar {
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.btn.primary {
  background: var(--brand);
  box-shadow: none;
}

.btn.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

label {
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 10px;
  border-color: #cbd5e1;
  font-size: 13px;
}

textarea {
  min-height: 68px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cart-item {
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.sale-input-line {
  grid-template-columns: minmax(180px, 1.4fr) 74px 118px 118px;
}

.purchase-input-line {
  grid-template-columns: minmax(180px, 1.4fr) 80px 132px;
}

table {
  min-width: 720px;
}

th,
td {
  padding: 9px 10px;
  font-size: 13px;
}

th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.02em;
}

tbody tr:hover {
  background: #f8fafc;
}

.badge {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
}

.price-preview {
  min-height: 16px;
  font-size: 11px;
  color: #2563eb;
}

[data-product-search] {
  margin-bottom: 6px;
  background: #f8fafc;
}

.sale-help {
  margin: 4px 0 0;
}

.sale-cart-wrap {
  position: relative;
}

.sale-cart-table {
  min-width: 760px;
}

.sale-cart-table tfoot td {
  background: #f8fafc;
}

.sale-empty {
  border-top: 1px solid var(--line);
}

.cart-stock {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.manual-price-input {
  margin-top: 6px;
}

.sale-product-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.sale-product-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.sale-product-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2,
.modal-head p {
  margin-bottom: 4px;
}

.modal-search {
  max-width: 420px;
}

.modal-table-wrap {
  max-height: 480px;
}

.product-picker-table {
  min-width: 720px;
}

.report-filter {
  padding: 10px;
  gap: 10px;
}

.report-filter label {
  min-width: 160px;
}

.report-grid {
  gap: 12px;
  margin-top: 12px;
}

.summary-line {
  padding: 7px 0;
  font-size: 13px;
}

.invoice-detail {
  padding: 7px 8px;
  border-radius: 8px;
}

.diff-badge {
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 11px;
}

.compact-input,
.opname-actual {
  max-width: 96px;
}

.empty {
  padding: 22px;
  font-size: 13px;
}

.toast {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.login-box {
  width: min(380px, 100%);
  padding: 24px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.login-heading h1 {
  font-size: 22px;
}

.login-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 14px 12px 96px;
  }

  .sidebar {
    padding: 7px 8px;
  }

  .nav-link {
    min-width: 76px;
    min-height: 56px;
    padding: 7px 5px;
    font-size: 10px;
  }

  .panel,
  .form-panel {
    padding: 12px;
  }

  h1 {
    font-size: 22px;
  }

  table {
    min-width: 560px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.06)),
    #f8fafc;
}

.login-visual {
  width: min(620px, 100%);
  display: grid;
  gap: 18px;
  justify-self: end;
  color: var(--ink);
}

.login-visual h1 {
  margin: 0;
  max-width: 620px;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.login-mark,
.login-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.login-mark {
  width: 62px;
  height: 62px;
  background: #0f766e;
  color: #fff;
  font-size: 25px;
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.22);
}

.login-box {
  width: min(420px, 100%);
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-heading h1,
.login-heading p {
  margin: 0;
}

.login-heading h1 {
  font-size: 28px;
}

.login-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.login-icon {
  width: 46px;
  height: 46px;
  background: #ecfdf5;
  color: var(--brand-dark);
}

.login-card {
  display: grid;
  gap: 16px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #ffffff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 1px 0 0 var(--line);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0f766e;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span,
.user-pill span {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button,
.nav-link {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: #344054;
  text-align: left;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
  text-decoration: none;
  font-weight: 650;
}

.nav button span:first-child,
.nav-link i {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 800;
}

.nav button.active,
.nav button:hover,
.nav-link.active,
.nav-link:hover {
  background: #ecfdf5;
  color: var(--brand-dark);
  transform: translateX(2px);
}

.nav button.active span:first-child,
.nav-link.active i {
  background: #d1fae5;
  color: var(--brand-dark);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-pill {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: 0;
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid > *,
.report-grid > *,
.panel,
.form-panel,
.table-wrap {
  min-width: 0;
}

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

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

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

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.five {
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr));
}

.panel,
.stat,
.table-wrap,
.form-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.panel,
.form-panel {
  padding: 18px;
}

.stat {
  padding: 17px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #93c5fd);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat strong {
  display: block;
  font-size: clamp(22px, 2.5vw, 32px);
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

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

.btn {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 13px;
  background: #e7edf6;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(15, 23, 42, 0.1);
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fee4e2;
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.btn.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4f7fb;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tfoot td {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.detail-row td {
  padding-top: 0;
  background: #fbfcfe;
}

.invoice-detail {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.invoice-detail summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.invoice-detail .muted {
  margin: 8px 0;
}

.mini-table {
  min-width: 520px;
  margin-top: 10px;
}

.mini-table th,
.mini-table td {
  padding: 9px 10px;
}

tr:last-child td {
  border-bottom: 0;
}

.right {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  margin: 2px;
}

.badge.good {
  background: #dcfae6;
  color: var(--good);
}

.badge.warn {
  background: #fef0c7;
  color: var(--warn);
}

.badge.danger {
  background: #fee4e2;
  color: var(--danger);
}

.price-preview {
  display: block;
  min-height: 18px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 750;
}

[data-product-preview] {
  color: var(--muted);
}

.total-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #14532d;
  font-size: 13px;
  font-weight: 700;
}

.total-pill strong {
  color: #0f766e;
  font-size: 15px;
}

.line-items {
  display: grid;
  gap: 10px;
}

.report-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.report-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.report-tab.active,
.report-tab:hover {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: var(--brand-dark);
}

.compact-filter {
  margin-bottom: 14px;
}

.report-filter label {
  min-width: 190px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.report-wide {
  grid-column: 1 / -1;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pagination span,
.page-note {
  color: var(--muted);
  font-size: 13px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 88px 135px 128px 36px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.purchase-line {
  grid-template-columns: minmax(180px, 1fr) 92px 150px 36px;
}

.sale-input-line {
  grid-template-columns: minmax(180px, 1.3fr) 82px 130px 130px;
}

.purchase-input-line {
  grid-template-columns: minmax(180px, 1.3fr) 90px 150px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.summary-line.total {
  font-size: 22px;
  font-weight: 800;
  border-bottom: 0;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.loading-screen .brand-mark {
  color: #fff;
}

.compact-input {
  max-width: 110px;
  margin-left: auto;
  text-align: right;
}

.opname-table table {
  min-width: 860px;
}

.opname-table th,
.opname-table td {
  vertical-align: middle;
}

.opname-actual {
  max-width: 120px;
  margin-left: auto;
  text-align: right;
  font-weight: 800;
}

.danger-input {
  border-color: #fda29b;
  background: #fff1f0;
  color: var(--danger);
}

.good-input {
  border-color: #75e0a7;
  background: #f0fdf4;
  color: var(--good);
}

.diff-badge {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.diff-badge.good {
  background: #dcfae6;
  color: var(--good);
}

.diff-badge.warn {
  background: #fef0c7;
  color: var(--warn);
}

.opname-row-danger td {
  background: #fff1f0;
}

.opname-row-good td {
  background: #f0fdf4;
}

.opname-row-warn td {
  background: #fffbeb;
}

.selected-row td {
  background: #ecfdf5;
}

.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.install-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #17202b;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 5;
}

.hide {
  display: none !important;
}

@media (max-width: 980px) {
  .login-page,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    justify-self: center;
    text-align: center;
    justify-items: center;
  }

  .login-visual h1 {
    font-size: 42px;
  }

  .login-box {
    justify-self: center;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

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

  .report-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  html,
  body {
    background: #fff;
    min-height: 100%;
    overflow-x: hidden;
  }

  .content {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - 88px);
    padding: 16px 14px 104px;
    background: #fff;
  }

  .login-box,
  .login-visual {
    padding: 20px;
  }

  .login-page {
    padding: 16px;
  }

  .login-visual h1 {
    font-size: 34px;
  }

  .report-filter {
    display: grid;
  }

  .form-grid.five {
    grid-template-columns: 1fr;
  }

  .report-filter label {
    min-width: 0;
  }

  .report-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .report-tab {
    white-space: nowrap;
  }

  .topbar {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    min-height: 100vh;
    background: #fff;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    max-height: 88px;
    overflow: hidden;
    padding: 8px 10px 8px;
    padding-bottom: calc(8px + constant(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
    z-index: 10;
  }

  .brand,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    background: #fff;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    min-width: 82px;
    min-height: 62px;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-link i {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  .nav-link:hover {
    transform: none;
  }

  .panel,
  .form-panel,
  .report-filter,
  .stat {
    box-shadow: none;
  }

  .panel,
  .form-panel {
    padding: 14px;
  }

  .toolbar {
    display: grid;
    gap: 10px;
  }

  .toolbar .btn,
  .report-filter .btn,
  .form-panel > .btn {
    width: 100%;
  }

  .cart-item,
  .purchase-line,
  .sale-input-line,
  .purchase-input-line {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 9px;
  }

  .cart-item .btn.small,
  .purchase-line .btn.small {
    width: 100%;
  }

  .table-wrap {
    position: relative;
    width: 100%;
    max-width: calc(100vw - 28px);
    overflow-x: auto;
  }

  .table-wrap::after {
    content: "Geser tabel";
    position: sticky;
    left: calc(100% - 92px);
    bottom: 0;
    display: inline-block;
    padding: 4px 7px;
    margin: 0 0 6px;
    border-radius: 7px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand-dark);
    font-size: 11px;
    font-weight: 750;
  }

  .sale-product-modal {
    align-items: end;
    padding: 0;
  }

  .sale-product-dialog {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding: 14px;
  }

  .modal-search {
    max-width: none;
  }

  .sale-cart-table {
    min-width: 700px;
  }

  table {
    min-width: 560px;
    font-size: 13px;
  }

  th,
  td {
    padding: 9px 10px;
  }

  .mini-table {
    min-width: 460px;
  }

  .pagination {
    justify-content: stretch;
  }

  .pagination .btn,
  .pagination span {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 92px;
  }
}

/* Modern dashboard refresh - final overrides */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1d2939;
  --muted: #667085;
  --line: #eaecf0;
  --brand: #465fff;
  --brand-dark: #3641f5;
  --accent: #12b76a;
  --danger: #d92d20;
  --good: #039855;
  --warn: #dc6803;
  --shadow: 0 22px 50px rgba(16, 24, 40, 0.10);
  --soft-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
}

body {
  background:
    radial-gradient(circle at top left, rgba(70, 95, 255, 0.08), transparent 28%),
    var(--bg);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px rgba(16, 24, 40, 0.03);
}

.brand {
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #7a5cff);
  box-shadow: 0 12px 28px rgba(70, 95, 255, 0.25);
}

.brand strong {
  color: #101828;
  font-size: 17px;
  letter-spacing: 0;
}

.nav {
  gap: 4px;
  padding: 2px;
}

.nav-link {
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 10px;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
}

.nav-link i {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f2f4f7;
  color: #667085;
}

.nav-link.active,
.nav-link:hover {
  background: #f4f6ff;
  color: var(--brand-dark);
  transform: none;
}

.nav-link.active i,
.nav-link:hover i {
  background: #eef2ff;
  color: var(--brand-dark);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.user-pill {
  border-radius: 14px;
  background: #f9fafb;
}

.content {
  padding: 32px;
}

.topbar {
  margin-bottom: 24px;
}

h1 {
  color: #101828;
  font-size: 32px;
  font-weight: 800;
}

h2 {
  color: #101828;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel,
.form-panel,
.stat,
.table-wrap,
.report-filter {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--soft-shadow);
}

.panel,
.form-panel {
  padding: 20px;
}

.stat {
  padding: 20px;
}

.stat::before {
  height: 0;
}

.stat span {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  color: #101828;
  font-size: 28px;
}

.btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 14px;
  background: #f2f4f7;
  color: #344054;
  font-weight: 800;
  box-shadow: none;
}

.btn:hover {
  transform: none;
  background: #e4e7ec;
  box-shadow: none;
}

.btn.primary {
  background: var(--brand);
  box-shadow: 0 10px 20px rgba(70, 95, 255, 0.18);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fff1f3;
  color: var(--danger);
}

label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 42px;
  border-radius: 10px;
  border-color: #d0d5dd;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.12);
}

.cart-item {
  border-radius: 14px;
  border-color: var(--line);
  background: #fcfcfd;
  padding: 14px;
}

th {
  background: #f9fafb;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

td {
  color: #344054;
}

tbody tr:hover {
  background: #f9fbff;
}

.badge {
  border-radius: 999px;
  font-weight: 800;
}

.badge.good {
  background: #ecfdf3;
  color: var(--good);
}

.badge.warn,
.diff-badge.warn {
  background: #fffaeb;
  color: var(--warn);
}

.badge.danger {
  background: #fff1f3;
  color: var(--danger);
}

.price-preview {
  color: var(--brand-dark);
}

.report-filter {
  padding: 16px;
}

.report-tab {
  border-radius: 10px;
}

.invoice-detail,
.mini-table {
  border-radius: 12px;
}

.toast {
  border-radius: 14px;
  background: #101828;
  box-shadow: var(--shadow);
}

.login-page {
  background:
    radial-gradient(circle at top left, rgba(70, 95, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #f8faff, #eef4ff);
}

.login-box {
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.login-icon {
  border-radius: 14px;
  background: #eef2ff;
  color: var(--brand-dark);
}

@media (max-width: 560px) {
  body {
    background: #f8fafc;
  }

  .content {
    background: #f8fafc;
  }

  .sidebar {
    border-radius: 18px 18px 0 0;
  }

  .nav-link {
    border-radius: 12px;
  }

  .panel,
  .form-panel,
  .stat,
  .report-filter {
    border-radius: 14px;
  }
}
