:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-strong: #eef5ff;
  --ink: #172033;
  --ink-soft: #344563;
  --muted: #6b7890;
  --line: #d9e2ef;
  --line-soft: #e8eef6;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --accent: #4f5f7a;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --info: #3538cd;
  --info-soft: #eef4ff;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(15, 23, 42, .10);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
  --motion-fast: 160ms ease;
  --motion-normal: 220ms ease;
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, .16);
  --page-max: 1680px;
}


*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.theme-dark {
  --bg: #0b1220;
  --surface: #111827;
  --surface-soft: #172033;
  --surface-strong: #1e293b;
  --ink: #e5edf8;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --line: #334155;
  --line-soft: #243247;
  --brand-soft: rgba(37, 99, 235, .18);
  --shadow: 0 18px 42px rgba(0, 0, 0, .34);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Arial, sans-serif;
  background:
    linear-gradient(180deg, #f8fbff 0, #f4f7fb 260px, #f4f7fb 100%);
  color: var(--ink);
  line-height: 1.5;
  accent-color: var(--brand);
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

body.menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(17, 24, 39, .42);
}

body.logged-out .sidebar,
body.logged-out .app-shell {
  display: none;
}

body.owner-mode .sidebar {
  display: block !important;
  width: 300px;
  background:
    linear-gradient(180deg, rgba(30, 41, 82, .92), rgba(8, 13, 31, .98)),
    #09111f;
  border-inline-end: 1px solid rgba(148, 163, 184, .18);
  box-shadow: -18px 0 50px rgba(2, 6, 23, .36);
}

body.owner-mode .app-shell {
  margin-inline-start: 300px;
  background:
    radial-gradient(circle at 78% 10%, rgba(56, 189, 248, .12), transparent 28%),
    radial-gradient(circle at 18% 0%, rgba(124, 58, 237, .12), transparent 26%),
    linear-gradient(180deg, #0b1220 0, #101827 280px, #eef3f9 281px, #f4f7fb 100%);
}

body.owner-mode .topbar {
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: row;
  background: rgba(10, 18, 34, .82);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  color: #e5eefc;
  text-align: right;
  min-height: 86px;
}

body.owner-mode .topbar > div:first-child {
  align-self: flex-end;
}

body.owner-mode .topbar h1 { color: #f8fafc; }
body.owner-mode .eyebrow { color: #93a4bd; }

body.owner-mode .top-actions {
  direction: rtl;
  justify-content: flex-end;
  max-width: none;
  width: 100%;
}

.owner-header-title {
  display: grid;
  gap: 2px;
  min-width: 220px;
}

.owner-header-title strong {
  color: #f8fafc;
  font-size: 15px;
}

.owner-header-title span {
  color: #a9b7cf;
  font-size: 12px;
}

.owner-role-chip {
  padding: 8px 11px;
  border-radius: var(--radius);
  color: #dbeafe;
  background: rgba(37, 99, 235, .18);
  border: 1px solid rgba(96, 165, 250, .28);
  font-weight: 800;
  font-size: 12px;
}

.owner-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.owner-brand strong {
  display: block;
  color: #f8fafc;
  font-size: 16px;
}

.owner-brand small {
  color: #94a3b8;
  font-size: 12px;
}

.owner-nav-section,
.owner-nav-footer {
  display: grid;
  gap: 8px;
}

.owner-nav-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .16);
}

body.owner-mode .nav button,
.owner-nav-footer button {
  color: #cbd5e1;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, .28);
}

body.owner-mode .nav button b,
.owner-nav-footer button b {
  background: rgba(96, 165, 250, .12);
  color: #7dd3fc;
}

body.owner-mode .nav button:hover,
.owner-nav-footer button:hover {
  background: rgba(37, 99, 235, .20);
  color: #fff;
}

body.owner-mode .nav button.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: rgba(125, 211, 252, .26);
  box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
}

body.owner-mode .content {
  max-width: 1760px;
}

.owner-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, .20);
  border-radius: 12px;
  background: rgba(15, 23, 42, .86);
  color: #e5eefc;
  box-shadow: 0 18px 44px rgba(2, 6, 23, .22);
}

.owner-hero span {
  color: #7dd3fc;
  font-weight: 800;
  font-size: 12px;
}

.owner-hero h2 {
  margin: 3px 0;
  font-size: 30px;
  color: #fff;
}

.owner-hero p {
  margin: 0;
  color: #b8c5d8;
}

.owner-hero-actions,
.owner-quick-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.owner-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.owner-stat,
.owner-card,
.owner-plan-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(203, 213, 225, .78);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}

.owner-stat {
  display: flex;
  gap: 12px;
  padding: 16px;
  min-height: 116px;
}

.owner-stat > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
}

.owner-stat small,
.owner-stat em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.owner-stat strong {
  display: block;
  margin: 5px 0;
  color: var(--ink);
  font-size: 24px;
}

.owner-stat.success > span { background: var(--success-soft); color: var(--success); }
.owner-stat.danger > span { background: var(--danger-soft); color: var(--danger); }
.owner-stat.warning > span { background: var(--warning-soft); color: var(--warning); }

.owner-quick-actions,
.owner-section-head {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(203, 213, 225, .72);
}

.owner-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.owner-section-head h2 {
  margin: 0;
}

.owner-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.owner-plan-grid,
.owner-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subscription-current-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.subscription-current-plan span,
.subscription-current-plan small,
.subscription-current-plan b {
  display: block;
}

.subscription-current-plan span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.subscription-current-plan strong {
  display: block;
  margin: 3px 0;
  color: #0f172a;
  font-size: 22px;
}

.subscription-current-plan small {
  color: #64748b;
}

.subscription-current-plan b {
  color: #1d4ed8;
  font-size: 18px;
  white-space: nowrap;
}

.subscription-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
}

.subscription-pricing-grid.renewal {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.subscription-price-card {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  padding: 24px 22px 20px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.subscription-price-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 4px;
  background: currentColor;
  opacity: .9;
}

.subscription-price-card.green { color: #22c55e; }
.subscription-price-card.blue { color: #3b82f6; }
.subscription-price-card.violet { color: #6366f1; }

.subscription-price-card.current {
  border-color: currentColor;
  box-shadow: 0 20px 42px rgba(37, 99, 235, .16);
}

.subscription-price-card.compact {
  min-height: 310px;
}

.price-card-top {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.price-card-top span {
  color: currentColor;
  font-size: 12px;
  font-weight: 900;
}

.price-card-top h4 {
  margin: 4px 0 0;
  color: #111827;
  font-size: 24px;
}

.price-card-top strong {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: #111827;
  font-size: 26px;
  line-height: 1.1;
}

.price-card-top strong small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.price-card-top em {
  display: block;
  width: fit-content;
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.price-current {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.price-compare {
  display: inline-grid;
  gap: 4px;
  color: #0f172a;
  text-align: start;
}

.price-compare-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.price-compare-row {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price-compare del {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.price-compare b {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.price-compare small {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 900;
}

.subscription-price-card ul {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  margin: 22px 0 22px;
  padding: 0;
  list-style: none;
  color: #334155;
  font-size: 13px;
}

.subscription-price-card li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.subscription-price-card li::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 999px;
  background: currentColor;
}

.subscription-price-card > button {
  position: relative;
  z-index: 1;
  min-width: 150px;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .14);
}

.plan-card-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.database-loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, .96), rgba(244, 247, 251, .98)),
    var(--bg);
}

.database-loading[hidden] {
  display: none;
}

.database-loading-panel {
  width: min(460px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.database-loading-panel h1 {
  margin: 0;
  font-size: 24px;
  color: var(--ink);
}

.database-loading-panel p {
  margin: 0;
  color: var(--muted);
}

.database-loader {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: database-spin .8s linear infinite;
}

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

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

button,
input,
select,
textarea,
a {
  outline-color: var(--brand);
  outline-offset: 2px;
}

button {
  border: 0;
  border-radius: var(--radius);
  min-height: 38px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 286px;
  padding: 18px 12px;
  background: #0f172a;
  color: white;
  overflow-y: auto;
  z-index: 40;
  border-inline-end: 1px solid rgba(255,255,255,.08);
  box-shadow: 12px 0 34px rgba(15, 23, 42, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 12px;
}

.brand > div {
  min-width: 0;
  flex: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), #38bdf8);
  color: white;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .34);
}

.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 1px;
}

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

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

.nav-group > span {
  padding: 4px 10px;
  color: #93a4bd;
  font-size: 11px;
  font-weight: 800;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #dbe7f7;
  background: transparent;
  text-align: start;
  padding: 9px 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav button b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255,255,255,.07);
  color: #bfdbfe;
  font-size: 13px;
}

.nav button:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.08);
  color: white;
}

.nav button.active {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: white;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
}

.nav button.active b {
  background: rgba(255,255,255,.18);
  color: white;
}

.app-shell {
  margin-inline-start: 286px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 12px 24px;
  background: rgba(248, 251, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
}

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

.top-actions,
.filters,
.summary-strip,
.date-filter,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.content {
  padding: 22px 24px 48px;
  display: grid;
  gap: 16px;
  max-width: 1680px;
  margin-inline: auto;
  width: 100%;
}

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

.grid.stats { grid-template-columns: repeat(7, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.payroll-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
  border-start-start-radius: var(--radius);
  border-start-end-radius: var(--radius);
}

.card-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.card-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 13px;
}

.profit-net {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profit-net > div {
  min-width: 0;
}

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

.profit-net strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.2;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-hero h2 {
  margin: 4px 0;
  font-size: 24px;
}

.dashboard-hero p {
  margin: 0;
  color: var(--muted);
}

.dashboard-stats {
  align-items: stretch;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-grid .chart-card {
  grid-column: span 2;
}

.dashboard-grid .card:nth-last-child(1),
.dashboard-grid .card:nth-last-child(2) {
  grid-column: span 2;
}

.stat {
  position: relative;
  padding: 15px;
  min-height: 114px;
  overflow: hidden;
  border-color: #dbeafe;
}

.stat::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 4px;
  background: var(--brand);
}

.stat.tone-success::before { background: var(--success); }
.stat.tone-warning::before { background: var(--warning); }
.stat.tone-danger::before { background: var(--danger); }
.stat.tone-info::before { background: #0ea5e9; }
.stat.tone-orders::before { background: #7c3aed; }
.stat.tone-cash::before { background: var(--brand); }

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

.stat strong {
  display: block;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.25;
}

.bar-chart {
  min-height: 230px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.bar-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.bar-track {
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 8px;
  background: #eef4ff;
  overflow: hidden;
}

.bar-track span {
  width: 100%;
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--brand), #60a5fa);
}

.bar-chart.profit .bar-track span {
  background: linear-gradient(180deg, var(--success), #86efac);
}

.bar-item small {
  color: var(--muted);
  font-size: 11px;
}

.bar-item b {
  color: var(--ink);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: white;
}

.rank-row span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 900;
}

.rank-row strong,
.rank-row small {
  display: block;
}

.rank-row small {
  color: var(--muted);
  font-size: 12px;
}

.rank-row b {
  color: var(--ink);
  font-size: 13px;
  z-index: 1;
}

.rank-row i {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: var(--w);
  height: 3px;
  background: var(--brand);
}

.stat small {
  color: var(--muted);
  display: block;
  margin-top: 9px;
  font-size: 12px;
}

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

.filters input,
.filters select,
.date-filter input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, .02);
}

.filters input,
.filters select {
  width: 230px;
}

.date-filter {
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.date-filter > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding-inline: 4px;
}

.date-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-filters input,
.finance-filters select {
  width: 180px;
}

.finance-filters .reports-filter-select {
  width: 180px;
}

.finance-filters .reports-filter-select-button {
  min-height: 40px;
}

.finance-filters .checkbox-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.finance-filters .checkbox-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.finance-filters .checkbox-line span {
  line-height: 1.4;
  white-space: normal;
}

.financial-log-toolbar {
  align-items: end;
}

.date-filter input {
  width: 150px;
  min-height: 34px;
  padding: 6px 8px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-section-title strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.modal-section-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.modal-summary-panel {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  padding: 14px;
}

.modal-summary-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-summary-title strong {
  color: var(--ink);
  font-size: 16px;
}

.modal-summary-title small {
  color: var(--muted);
  font-weight: 800;
}

.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.modal-summary-grid span {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.modal-summary-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-summary-grid b {
  color: var(--ink);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.full { grid-column: 1 / -1; }

.form-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-grid .modal-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

.modal-field-error {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.readonly-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  padding: 12px 14px;
}

.readonly-preview .upgrade-detail-box {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.readonly-preview .upgrade-detail-box .settings-meta {
  background: #fff;
  padding: 10px 12px;
}

.readonly-preview .upgrade-discount-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.readonly-preview .upgrade-discount-panel > span {
  color: #166534;
  font-size: 13px;
  font-weight: 900;
}

.readonly-preview .upgrade-detail-box .settings-meta strong {
  font-size: 15px;
  text-align: left;
}

.readonly-preview .upgrade-detail-box .settings-note {
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}

.readonly-preview[data-preview$="Warning"],
.readonly-preview[data-preview="partialWarning"],
.readonly-preview[data-preview="supplierPaymentWarning"] {
  background: var(--warning-soft);
  border-color: #fedf89;
  color: var(--warning);
  font-size: 14px;
  line-height: 1.7;
  font-weight: 800;
}

.choice-card-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  display: grid;
  gap: 4px;
  text-align: center;
}

.choice-card strong {
  font-size: 18px;
  font-weight: 900;
}

.choice-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.choice-card:has(input:checked) {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.choice-card:has(input:checked) strong {
  color: var(--brand-strong);
}

.choice-card:hover {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 8px;
}

.primary-btn {
  background: var(--brand);
  color: white;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}

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

.ghost-btn {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.button-loading {
  cursor: wait !important;
  opacity: .82;
  pointer-events: none;
}

.ghost-btn:hover {
  background: var(--surface-soft);
  border-color: #c8d1dc;
  color: var(--ink);
}

.link-btn {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  text-align: start;
}

.link-btn:hover {
  color: var(--brand-strong);
  transform: none;
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecdca;
}

.success-btn {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #abefc6;
}

.warning-btn {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #fedf89;
}

.icon-btn {
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

#menuBtn { display: none; }
.sidebar-close { display: none; }

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.sync-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.sync-chip.connected {
  color: var(--success);
  background: var(--success-soft);
  border-color: #abefc6;
}

.sync-chip.offline {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecdca;
}

.sync-chip.checking {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #fedf89;
}

.settings-card .card-body {
  display: grid;
  gap: 14px;
}

.settings-card,
.settings-section-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.settings-tab-form {
  margin-top: 12px;
}

.settings-tab-form .form-control,
.settings-tab-form .form-group select,
.settings-tab-form .form-group input,
.settings-tab-form .form-group textarea {
  min-height: 44px;
}

.settings-sections {
  display: grid;
  gap: 16px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.settings-tabs button {
  min-height: 40px;
  flex: 1 1 auto;
  justify-content: center;
}

.settings-tab-form {
  display: grid;
  gap: 18px;
}

.settings-tab-form .actions.form-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.settings-section-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.settings-section-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 3px;
}

.settings-section-head h3 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.settings-section-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.settings-section-body {
  padding: 10px;
}

.settings-section-body .settings-grid {
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.settings-section-body .form-group {
  min-width: 0;
}

.settings-section-card .settings-note {
  margin-top: 2px;
}

.settings-logo-uploader {
  display: grid;
  gap: 10px;
  align-content: start;
}

.settings-logo-preview {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.settings-logo-preview img {
  max-width: 150px;
  max-height: 70px;
  object-fit: contain;
}

.settings-logo-pick {
  justify-content: center;
  cursor: pointer;
}

.settings-logo-pick input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.danger-text {
  color: var(--danger);
}

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

.settings-row strong,
.settings-meta strong {
  color: var(--ink);
  font-size: 16px;
}

.settings-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.settings-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.settings-note {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.settings-table {
  display: grid;
  gap: 10px;
}

.settings-table h3 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.42)),
    linear-gradient(135deg, #e9f1f4, #f8fafc 48%, #dff1ed);
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(17, 24, 39, .14);
}

.login-panel .brand-mark {
  margin-bottom: 4px;
}

.login-panel h1 {
  margin: 0;
  font-size: 26px;
}

.login-panel p,
.login-panel small {
  margin: 0;
  color: var(--muted);
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-panel input {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  direction: ltr;
}

.login-panel button {
  min-height: 48px;
  font-weight: 800;
}

#loginHint {
  min-height: 18px;
  color: var(--danger);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}

.data-table {
  display: grid;
  gap: 10px;
}

.table-toolbar,
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.table-toolbar input {
  width: min(280px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  background: white;
  color: var(--ink);
}

.table-toolbar span,
.table-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  background: var(--surface);
}

th,
td {
  padding: 11px 12px;
  text-align: start;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 12.5px;
}

th {
  color: var(--muted);
  background: #f7faff;
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

th button {
  min-height: auto;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  text-align: start;
}

th button:hover {
  transform: none;
  color: var(--brand);
}

th button small {
  color: #9aa8bd;
  font-size: 10px;
}

tbody tr:hover td {
  background: #f8fbff;
}

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

td .actions,
td.actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

td .actions button,
td.actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--info); }

.audit-cell {
  display: block;
  max-width: 320px;
  max-height: 72px;
  overflow: hidden;
  color: var(--ink-soft);
  line-height: 1.55;
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  .sidebar,
  .topbar,
  .toolbar,
  .toast,
  .print-actions {
    display: none !important;
  }

  .print-document {
    background: #fff;
    color: #111827;
    box-shadow: none;
    border: 0;
    margin: 0;
  }

  .print-a4 {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
  }

  .print-thermal {
    width: 80mm;
    padding: 0;
  }

  .print-header,
  .print-meta,
  .print-party,
  .print-table,
  .print-summary,
  .print-notes,
  .print-signatures,
  .print-footer {
    break-inside: avoid;
  }

  body.printing-financial-log .sidebar,
  body.printing-financial-log .topbar,
  body.printing-financial-log .toolbar,
  body.printing-financial-log .account-metrics,
  body.printing-financial-log .table-toolbar,
  body.printing-financial-log .table-pagination,
  body.printing-financial-log .toast {
    display: none !important;
  }

  body.printing-financial-log .app-shell {
    margin: 0;
  }

  body.printing-financial-log .content {
    padding: 0;
    max-width: none;
  }

  body.printing-financial-log .card {
    box-shadow: none;
    border: 0;
  }

  body.printing-financial-log tr {
    display: table-row !important;
  }

  body.printing-audit-log .sidebar,
  body.printing-audit-log .topbar,
  body.printing-audit-log .toolbar,
  body.printing-audit-log .account-metrics,
  body.printing-audit-log .table-toolbar,
  body.printing-audit-log .table-pagination,
  body.printing-audit-log .toast {
    display: none !important;
  }

  body.printing-audit-log .app-shell {
    margin: 0;
  }

  body.printing-audit-log .content {
    padding: 0;
    max-width: none;
  }

  body.printing-audit-log .card {
    box-shadow: none;
    border: 0;
  }

  body.printing-audit-log tr {
    display: table-row !important;
  }

  body.printing-audit-log .audit-cell {
    max-height: none;
  }

  body.printing-statements .sidebar,
  body.printing-statements .topbar,
  body.printing-statements .toolbar,
  body.printing-statements .account-metrics,
  body.printing-statements .table-toolbar,
  body.printing-statements .table-pagination,
  body.printing-statements .toast,
  body.printing-reports .sidebar,
  body.printing-reports .topbar,
  body.printing-reports .toolbar,
  body.printing-reports .reports-header,
  body.printing-reports .reports-filter-card,
  body.printing-reports .reports-tabs,
  body.printing-reports .account-metrics,
  body.printing-reports .table-toolbar,
  body.printing-reports .table-pagination,
  body.printing-reports .toast {
    display: none !important;
  }

  body.printing-statements .app-shell,
  body.printing-reports .app-shell {
    margin: 0;
  }

  body.printing-statements .content,
  body.printing-reports .content {
    padding: 0;
    max-width: none;
  }

  body.printing-statements .card,
  body.printing-reports .card {
    box-shadow: none;
    border: 0;
    break-inside: avoid;
  }

  body.printing-reports .reports-center,
  body.printing-reports .reports-print-scope,
  body.printing-reports .reports-tab-panel {
    display: block;
  }

  body.printing-reports .reports-print-title {
    display: block;
    margin-bottom: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
  }

  body.printing-statements tr,
  body.printing-reports tr {
    display: table-row !important;
  }
}

.empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.activity-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.activity-list li:last-child { border-bottom: 0; }
.activity-list small { color: var(--muted); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(8px);
  overflow: auto;
}

.modal[hidden] { display: none; }

.modal-panel {
  width: min(1080px, 100%);
  max-height: min(86vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.modal-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.modal-panel .form-grid {
  padding: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  overflow: auto;
}

.modal-panel .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.modal-panel .form-actions button {
  min-height: 42px;
  min-width: 140px;
}

.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  background: #121826;
  color: white;
  padding: 12px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: min(430px, calc(100vw - 36px));
}

.summary-strip span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.payroll-board .card-header {
  background: var(--surface);
}

.payroll-board .card-body {
  padding: 0;
}

.payroll-board .table-wrap {
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.payroll-board table {
  font-variant-numeric: tabular-nums;
}

.payroll-board th,
.payroll-board td {
  padding: 11px 12px;
}

.payroll-board th:last-child,
.payroll-board td:last-child {
  width: 220px;
}

.payroll-board .actions {
  justify-content: flex-start;
}

.payroll-board .actions button {
  flex: 1 1 70px;
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.account-head h2 {
  margin: 4px 0;
  font-size: 24px;
}

.account-head p,
.account-head small,
.muted-text {
  margin: 0;
  color: var(--muted);
}

.account-head .summary-strip {
  justify-content: flex-end;
  max-width: 760px;
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.settlement-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(15, 118, 110, .10), rgba(37, 99, 235, .08));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.settlement-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.settlement-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.settlement-hero-total {
  min-width: 220px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settlement-hero-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-hero-total strong {
  font-size: 24px;
}

.reports-page,
.reports-center {
  display: grid;
  gap: 16px;
  width: 100%;
}

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.reports-header span {
  display: block;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.reports-header h2 {
  margin: 3px 0 5px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.2;
}

.reports-header p {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.7;
}

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

.reports-filter-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

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

.reports-filter-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--ink);
}

.reports-filter-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reports-filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

.reports-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reports-filter-grid input,
.reports-filter-grid select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.reports-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.reports-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.reports-tab {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  transition: .16s ease;
}

.reports-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
}

.reports-tab span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reports-tab-panel {
  display: grid;
  gap: 16px;
}

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reports-kpi-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 118px;
  padding: 14px 15px 14px 56px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
  overflow: hidden;
}

.reports-kpi-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 5px;
  background: var(--brand);
}

.reports-kpi-card::after {
  content: "▣";
  position: absolute;
  inset-inline-start: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 8px;
  font-weight: 900;
}

.reports-kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.reports-kpi-card strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.2;
}

.reports-kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.reports-kpi-card.is-important {
  background: linear-gradient(180deg, rgba(15, 118, 110, .07), var(--surface));
  border-color: rgba(15, 118, 110, .28);
}

.reports-analysis-grid,
.reports-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.reports-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, .95fr);
  gap: 14px;
  align-items: stretch;
}

.reports-overview-main,
.reports-overview-side {
  min-width: 0;
}

.reports-overview-side {
  display: grid;
  gap: 10px;
}

.reports-chart-card,
.reports-table-card,
.reports-mini-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
}

.reports-chart-card,
.reports-table-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.reports-chart-card > header,
.reports-table-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reports-chart-card h3,
.reports-table-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.reports-chart-card small,
.reports-table-card small {
  color: var(--muted);
}

.reports-chart-body {
  min-height: 250px;
  display: grid;
}

.reports-mini-card {
  display: grid;
  gap: 6px;
  min-height: 100px;
  padding: 13px 14px;
}

.reports-mini-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.reports-mini-card strong {
  color: var(--ink);
  font-size: 18px;
}

.reports-mini-card small {
  color: var(--muted);
  font-size: 12px;
}

.reports-bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 250px;
  padding-top: 8px;
}

.reports-bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.reports-bar-value,
.reports-bar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reports-bar-track {
  position: relative;
  min-height: 180px;
  background: linear-gradient(180deg, rgba(148, 163, 184, .16), rgba(148, 163, 184, .05));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.reports-bar-track span {
  position: absolute;
  inset-inline: 6px;
  bottom: 6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
}

.reports-empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.reports-print-title {
  display: none;
}

.reports-table-card .data-table {
  border: 0;
}

.report-alert-list {
  display: grid;
  gap: 8px;
}

.report-alert-list div {
  padding: 10px;
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
}

.reports-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-directory-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.report-directory-group h3 {
  margin: 0;
  font-size: 15px;
}

.report-directory-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-directory-group span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(248, 250, 252, .72);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.report-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
}

.report-section-head h2 {
  margin: 0;
  font-size: 20px;
}

.report-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.report-card {
  min-width: 0;
}

.report-card .table-wrap {
  max-height: 420px;
  overflow: auto;
}

.installment-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6fbff 100%);
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
}

.installment-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.installment-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.installment-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.installment-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: left;
}

.installment-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.installment-preview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.installment-preview span,
.installment-preview.is-muted,
.installment-preview.is-warning {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.installment-preview strong {
  color: var(--ink);
}

.installment-preview.is-warning {
  color: var(--danger);
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, .25);
  border-radius: 10px;
  background: rgba(254, 242, 242, .7);
}

.installment-preview.is-muted {
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, .45);
  border-radius: 10px;
  background: rgba(248, 250, 252, .82);
}

.installment-preview-schedule {
  display: grid;
  gap: 3px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.installment-preview-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.installment-preview-title {
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
}

.installment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.installment-summary-grid span {
  display: grid;
  gap: 4px;
  min-height: 78px;
  align-content: center;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}

.installment-summary-grid small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.installment-summary-grid strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
}

.installment-preview-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.installment-preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.installment-preview-table th,
.installment-preview-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: start;
  vertical-align: middle;
  white-space: nowrap;
}

.installment-preview-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-soft);
}

.installment-preview-table tr:last-child td {
  border-bottom: 0;
}

.installment-plans {
  display: grid;
  gap: 14px;
}

.installment-plan-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.installment-plan-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.installment-plan-card h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 17px;
}

.installment-plan-card small {
  color: var(--muted);
  line-height: 1.7;
}

.installment-plan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.installment-plan-summary span {
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.installment-plan-summary b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
}

.installment-filters {
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.installment-filters .reports-filter-select {
  min-width: 180px;
}

.installment-status-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.installment-status-chips button {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.installment-status-chips button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.account-metric {
  position: relative;
  min-height: 112px;
  padding: 14px 15px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
  overflow: hidden;
}

.account-metric::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 4px;
  background: var(--brand);
}

.account-metric.is-important {
  background: var(--brand-soft);
  border-color: rgba(15, 118, 110, .35);
  box-shadow: 0 8px 22px rgba(15, 118, 110, .08);
}

.account-metric.is-important::before {
  width: 6px;
  background: var(--brand-strong);
}

.account-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.account-metric strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
}

.account-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.permission-sections {
  display: grid;
  gap: 10px;
}

.permission-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.permission-section strong {
  color: var(--ink);
  font-size: 13px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
}

.checkline input {
  width: auto;
  min-height: auto;
}

@media (max-width: 1280px) {
  .grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid .chart-card,
  .dashboard-grid .card:nth-last-child(1),
  .dashboard-grid .card:nth-last-child(2) { grid-column: span 1; }
  .account-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .subscription-pricing-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 1100px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subscription-pricing-grid,
  .subscription-pricing-grid.renewal { grid-template-columns: 1fr; }
  .subscription-current-plan { align-items: flex-start; flex-direction: column; }
  .dashboard-hero { display: grid; }
  .account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two,
  .grid.three,
  .payroll-board { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .settlement-hero {
    display: grid;
  }

  .settlement-hero-total {
    min-width: 0;
  }

  .reports-directory-grid,
  .report-section-grid,
  .reports-analysis-grid,
  .reports-overview-layout,
  .reports-table-grid,
  .installment-plan-summary,
  .invoice-payment-board {
    grid-template-columns: 1fr;
  }

  .reports-header,
  .reports-filter-head {
    display: grid;
  }

  .reports-filter-grid,
  .reports-kpi-grid,
  .installment-summary-grid,
  .installment-fields,
  .invoice-payment-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .report-section-head {
    display: grid;
  }

  .sidebar {
    width: min(88vw, 330px);
    padding: 12px 10px;
    transform: translateX(100%);
    transition: .2s ease;
    box-shadow: -20px 0 50px rgba(17, 24, 39, .26);
  }

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

  .app-shell { margin-inline-start: 0; }
  #menuBtn { display: grid; }

  .topbar {
    min-height: 64px;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
  }

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

  .eyebrow {
    display: none;
  }

  .content {
    padding: 12px;
    gap: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .sidebar-close {
    display: grid;
    flex: 0 0 40px;
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
    color: white;
  }

  .nav {
    gap: 6px;
  }

  .nav button {
    min-height: 44px;
    font-size: 14px;
  }

  button {
    min-height: 42px;
  }

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

  .summary-strip {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .summary-strip span {
    display: flex;
    justify-content: space-between;
    min-height: 40px;
  }

  .account-metrics {
    grid-template-columns: 1fr;
  }

  .card-header {
    padding: 12px;
  }

  .card-body {
    padding: 12px;
  }

  .stat {
    min-height: 96px;
  }

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

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

  .bar-chart {
    min-height: 190px;
    gap: 7px;
  }

  .bar-track {
    height: 118px;
  }

  .profit-net {
    grid-template-columns: 1fr;
  }

  .account-head {
    display: grid;
    padding: 14px;
  }

  .account-head h2 {
    font-size: 21px;
  }

  .account-head .summary-strip { justify-content: flex-start; }
  .grid.stats { grid-template-columns: 1fr; }
  .form-grid,
  .permission-grid { grid-template-columns: 1fr; }
  .filters,
  .filters input,
  .filters select,
  .date-filter,
  .date-filter input { width: 100%; }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .date-filter {
    display: grid;
    grid-template-columns: 1fr;
  }

  .date-filter label {
    display: grid;
  }

  .modal {
    padding: 10px;
    place-items: stretch;
  }

  .modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 10px;
  }

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

  .modal-panel .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toast {
    inset-inline: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .reports-filter-grid,
  .reports-kpi-grid,
  .installment-summary-grid {
    grid-template-columns: 1fr;
  }

  .reports-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

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

  td .actions,
  td.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .data-table tbody {
    gap: 12px;
  }

  .data-table tbody tr {
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  }

  .data-table tbody tr td:first-child {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding-block: 12px;
    color: var(--ink);
    background: linear-gradient(180deg, #f8fbff, #fff);
    font-size: 14px;
    font-weight: 900;
  }

  .data-table tbody tr td:first-child::before {
    color: var(--brand);
    font-size: 11px;
  }

  .data-table td {
    min-width: 0;
  }

  .data-table td > * {
    min-width: 0;
  }

  .data-table td .actions,
  .data-table td.actions {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }

  td .actions button,
  td.actions button,
  .payroll-board .actions button {
    width: 100%;
    min-height: 38px;
    padding: 7px 8px;
    font-size: 12px;
    flex: initial;
  }

  .payroll-board .card-body {
    padding: 0;
  }

  .payroll-board th:last-child,
  .payroll-board td:last-child {
    width: auto;
  }

  .installment-box-head {
    display: grid;
    justify-items: start;
  }

  .installment-hint {
    text-align: right;
  }

  .installment-preview-table,
  .installment-preview-table thead,
  .installment-preview-table tbody,
  .installment-preview-table tr,
  .installment-preview-table th,
  .installment-preview-table td {
    display: revert;
  }

  .installment-preview-table thead {
    display: table-header-group;
  }

  .installment-preview-table tbody {
    display: table-row-group;
  }

  .installment-preview-table tr {
    display: table-row;
    box-shadow: none;
    overflow: visible;
  }

  .installment-preview-table th,
  .installment-preview-table td {
    display: table-cell;
  }

  .installment-preview-table td::before {
    content: none;
  }

}

/* Final UI/UX overrides. Keep this block at the end. */
.app-shell {
  background:
    radial-gradient(circle at 88% -10%, rgba(37, 99, 235, .09), transparent 30%),
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, .08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 320px, var(--bg) 100%);
}

.content {
  max-width: var(--page-max);
  animation: page-in var(--motion-normal);
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card,
.stat,
.owner-stat,
.owner-card,
.owner-plan-card,
.account-head,
.account-metric,
.login-panel,
.modal-panel {
  border-radius: var(--radius);
  border-color: rgba(203, 213, 225, .82);
  transition: transform var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast);
}

.card:hover,
.stat:hover,
.account-metric:hover,
.owner-card:hover,
.owner-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .09);
}

.card-header {
  min-height: 58px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96));
}

.dashboard-hero,
.owner-hero {
  position: relative;
  overflow: hidden;
}

.dashboard-hero::after,
.owner-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -80px;
  inset-block-start: -120px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  pointer-events: none;
}

.dashboard-hero > *,
.owner-hero > * {
  position: relative;
  z-index: 1;
}

.stat {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98));
}

.stat strong,
.account-metric strong,
.owner-stat strong {
  font-variant-numeric: tabular-nums;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.success-btn,
.info-btn,
.warning-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), #0ea5e9);
  color: white;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.primary-btn:hover:not(:disabled) {
  box-shadow: 0 14px 28px rgba(37, 99, 235, .27);
}

.ghost-btn,
.icon-btn {
  background: rgba(255,255,255,.78);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.ghost-btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled) {
  color: var(--brand);
  border-color: rgba(37, 99, 235, .32);
  background: var(--brand-soft);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, .22);
}

.success-btn {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(6, 118, 71, .22);
}

.warning-btn {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(181, 71, 8, .22);
}

.info-btn {
  background: var(--info-soft);
  color: var(--info);
  border: 1px solid rgba(53, 56, 205, .20);
}

.filters input,
.filters select,
.date-filter input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.table-toolbar input {
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}

.filters input:focus,
.filters select:focus,
.date-filter input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.table-toolbar input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.table-wrap {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

th {
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

tbody tr {
  transition: background var(--motion-fast);
}

tbody tr:nth-child(even) td {
  background: rgba(248, 251, 255, .52);
}

tbody tr:hover td {
  background: #eef6ff;
}

.badge {
  gap: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(248,251,255,.82));
}

.modal-panel {
  overflow: hidden;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes section-in {
  from {
    opacity: .75;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.10);
  animation: toast-in var(--motion-normal);
}

.toast::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #93c5fd;
  flex: 0 0 auto;
}

.toast-success { background: #063f2a; }
.toast-success::before { background: #22c55e; }
.toast-warning { background: #4a2b05; }
.toast-warning::before { background: #f59e0b; }
.toast-danger { background: #4a1111; }
.toast-danger::before { background: #ef4444; }
.toast-info { background: #111827; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.form-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, .02);
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.offline-banner {
  margin: 16px 24px 0;
  padding: 11px 14px;
  border: 1px solid rgba(181, 71, 8, .26);
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

body.is-offline .topbar {
  border-bottom-color: rgba(181, 71, 8, .28);
}

.sync-chip,
.user-chip,
.owner-role-chip,
.summary-strip span {
  border-radius: var(--radius);
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.nav button,
.owner-nav-footer button {
  position: relative;
}

.nav button.active::after {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  inset-block: 9px;
  width: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,.86);
}

body.owner-mode .nav button.active::after {
  background: #7dd3fc;
}

body.theme-dark .app-shell {
  background:
    radial-gradient(circle at 88% -10%, rgba(37, 99, 235, .16), transparent 30%),
    linear-gradient(180deg, #0b1220 0, #0f172a 100%);
}

body.theme-dark .topbar,
body.theme-dark .card-header,
body.theme-dark .dashboard-hero,
body.theme-dark .stat,
body.theme-dark .empty,
body.theme-dark .ghost-btn,
body.theme-dark .icon-btn,
body.theme-dark .table-toolbar input {
  background: var(--surface);
}

body.theme-dark th {
  background: var(--surface-strong);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 900px) {
  .offline-banner {
    margin: 10px 12px 0;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .sync-chip,
  .top-actions .user-chip,
  .top-actions button {
    flex: 1 1 auto;
  }

  .dashboard-hero,
  .owner-hero,
  .account-head {
    align-items: stretch;
    flex-direction: column;
  }

  .table-wrap {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .grid.stats,
  .dashboard-grid,
  .owner-stats,
  .account-metrics,
  .profit-net,
  .form-grid,
  .permission-grid {
    grid-template-columns: 1fr !important;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar > div:first-of-type {
    min-width: 0;
    flex: 1;
  }

  .topbar h1 {
    overflow-wrap: anywhere;
  }

  .card-header,
  .toolbar,
  .table-toolbar,
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .filters input,
  .filters select,
  .table-toolbar input,
  .date-filter input {
    width: 100%;
  }
}

.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  direction: rtl;
  padding: 0;
}

.pos-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.pos-page {
  --page-gap: 16px;
}

.pos-page-body {
  display: grid;
  gap: var(--page-gap);
}

.pos-page-title {
  display: grid;
  gap: 2px;
}

.pos-page-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.pos-page-title small {
  color: var(--muted);
}

.pos-header {
  display: grid;
  gap: 12px;
}

.pos-header-actions {
  display: flex;
  justify-content: flex-start;
}

.pos-header > div:first-child {
  display: grid;
  gap: 2px;
}

.pos-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.pos-kpi {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}

.pos-kpi span {
  color: var(--muted);
  font-size: 11px;
}

.pos-kpi strong {
  color: var(--ink);
  font-size: 15px;
}

.pos-focus-btn::before {
  content: "?";
}

.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr);
  gap: 16px;
  align-items: start;
}

.pos-grid {
  display: grid;
}

.pos-products-column,
.pos-cart-column {
  min-width: 0;
}

.pos-products-panel,
.pos-payment-card {
  display: grid;
  align-content: start;
  min-width: 0;
}

.pos-products-panel {
  background: #fff;
}

.pos-payment-panel {
  position: relative;
  overflow: hidden;
}

.pos-payment-card {
  background: linear-gradient(180deg, #f8fbff, #f4f8ff);
}

.pos-products-panel .card-body,
.pos-payment-card .card-body {
  padding: 0;
}

.pos-search-box {
  display: grid;
  gap: 10px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
}

.pos-cart-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pos-products-body,
.pos-cart-body,
.pos-cart-body .pos-payment-grid,
.pos-payment-body {
  display: grid;
  gap: 12px;
}

.pos-products-body,
.pos-cart-body,
.pos-payment-body {
  padding: 14px;
}

.pos-btn-clear {
  justify-self: start;
}

.pos-product-grid,
.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 530px;
  overflow: auto;
  padding-inline-end: 4px;
}

.pos-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  align-items: end;
}

.pos-search-control .form-label {
  min-height: 20px;
}

#posBarcodeInput {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.barcode-input-wrap {
  position: relative;
  display: grid;
}

.barcode-input-wrap #posBarcodeInput {
  padding-inline-start: 58px;
}

.modal-barcode-input input {
  padding-inline-start: 58px;
}

.barcode-camera-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .24);
}

.barcode-camera-btn:hover {
  filter: brightness(1.04);
}

.pos-panel-title {
  display: grid;
  gap: 2px;
}

.pos-panel-title small {
  color: var(--muted);
  font-size: 12px;
}

.pos-cart-item input,
.pos-cart-item input::placeholder {
  width: 100%;
}

#posBarcodeInput {
  min-height: 54px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  border-width: 2px;
}

.barcode-scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, .72);
  display: grid;
  place-items: center;
  padding: 18px;
}

.barcode-scanner-panel {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .35);
  overflow: hidden;
}

.barcode-scanner-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.barcode-scanner-head strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.barcode-scanner-head small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.barcode-scanner-view {
  position: relative;
  background: #020617;
  aspect-ratio: 4 / 3;
}

.barcode-scanner-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.barcode-scan-frame {
  position: absolute;
  inset: 24%;
  border: 3px solid #22c55e;
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, .18), 0 0 24px rgba(34, 197, 94, .45);
}

.barcode-scanner-device {
  display: grid;
  gap: 6px;
  padding: 12px 14px 0;
}

.barcode-scanner-device label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.barcode-scanner-device select {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.barcode-scanner-status {
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 530px;
  overflow: auto;
  padding-inline-end: 4px;
}

.pos-product {
  min-height: 148px;
  display: grid;
  align-content: space-between;
  gap: 7px;
  text-align: start;
  white-space: normal;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  position: relative;
  overflow: hidden;
}

.pos-product strong,
.pos-product b,
.pos-product span,
.pos-product small {
  display: block;
}

.pos-product strong {
  color: var(--ink);
  font-size: 14px;
}

.pos-product b {
  color: var(--brand);
  font-size: 17px;
}

.pos-product span,
.pos-product small {
  color: var(--muted);
  font-size: 12px;
}

.pos-product.is-low {
  border-color: rgba(181, 71, 8, .32);
  background: linear-gradient(180deg, #fff, #fffbeb);
}

.pos-product:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.pos-product .badge.warning {
  width: fit-content;
}

.pos-product-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.pos-cart-panel {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pos-cart-meta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.pos-cart-items {
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.pos-cart-item {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
  min-width: 0;
  overflow: hidden;
}

.pos-cart-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pos-cart-item-header-text {
  min-width: 0;
}

.pos-cart-item-header strong,
.pos-cart-item-header small {
  display: block;
}

.pos-cart-item-header strong {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.pos-cart-item-header small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-cart-item-meta {
  display: grid;
  grid-template-columns: minmax(130px, 1.3fr) minmax(160px, 1.1fr) minmax(130px, 1fr) minmax(130px, 1.1fr);
  gap: 8px;
}

.pos-cart-item-total {
  display: grid;
  gap: 6px;
  justify-items: end;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 8px;
}

.pos-cart-item-total span {
  color: var(--muted);
  font-size: 11px;
}

.pos-cart-item-total b {
  color: var(--ink);
  font-size: 15px;
  direction: ltr;
}

.pos-line-label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pos-line-label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pos-line-label input {
  text-align: start;
  padding-inline-start: 8px;
  padding-inline-end: 8px;
}

.pos-line-label input,
.pos-line-input,
.pos-qty-input {
  min-height: 40px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.pos-line-label input::-webkit-outer-spin-button,
.pos-line-label input::-webkit-inner-spin-button,
.pos-line-input::-webkit-outer-spin-button,
.pos-line-input::-webkit-inner-spin-button,
.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.pos-qty-control {
  display: grid;
  grid-template-columns: 40px minmax(52px, 1fr) 40px;
  gap: 5px;
  align-items: center;
}

.pos-qty-control button {
  min-height: 36px;
  padding: 4px;
  font-size: 18px;
}

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

.pos-payment-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #f9fbff, #f7fbff);
}

.pos-payment-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.pos-payment-section h3::before {
  content: "";
  width: 6px;
  height: 16px;
  border-radius: 999px;
  background: var(--brand);
}

.pos-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pos-customer-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pos-full {
  grid-column: 1 / -1;
}

.pos-summary-box {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
}

.pos-form-mode-group.is-hidden {
  display: none !important;
}

.pos-shipment-section.is-hidden {
  display: none !important;
}

.pos-shipment-section {
  animation: section-in var(--motion-normal);
}

.pos-shipment-fields {
  display: none;
}

.pos-shipment-fields.is-visible {
  display: grid;
}

.pos-shipment-fields.pos-full {
  grid-column: 1 / -1;
}

.pos-payment-grid .pos-full,
.pos-payment-body .pos-full {
  grid-column: 1 / -1;
}

.pos-summary {
  display: grid;
  gap: 8px;
  padding: 13px;
  border-radius: var(--radius);
  background: #fbfdff;
  border: 1px solid var(--line-soft);
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.pos-summary-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pos-summary-row.is-main {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 19px;
  font-weight: 900;
}

.pos-summary-row.is-main b {
  color: var(--brand);
}

.pos-summary-row span {
  color: var(--muted);
}

.pos-total-main {
  font-size: 20px;
  font-weight: 900;
}

.pos-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.pos-actions .primary-btn,
.pos-actions .ghost-btn {
  flex: 1 1 auto;
}

.pos-actions .warning-btn {
  flex: 1 1 180px;
}

.pos-actions .primary-btn {
  min-height: 54px;
  font-size: 16px;
}

.pos-payment-title {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pos-cart-item-remove {
  min-width: 72px;
  white-space: nowrap;
}

.invoice-sale-page {
  display: grid;
  gap: 12px;
  max-width: 1240px;
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto 14px;
  direction: rtl;
}

.invoice-sale-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.invoice-sale-header h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 22px;
}

.invoice-sale-header small {
  color: var(--muted);
  font-size: 13px;
}

.invoice-sale-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-sale-badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.invoice-sale-badges b {
  color: var(--ink);
}

.invoice-section {
  overflow: visible;
}

.invoice-section .card-header {
  min-height: auto;
  padding: 12px 16px;
}

.invoice-section .card-header h2 {
  font-size: 16px;
}

.invoice-section .card-header small {
  font-size: 12px;
}

.invoice-section .card-body {
  padding: 14px 16px;
}

.invoice-main-grid {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.25fr);
  gap: 12px;
  align-items: stretch;
}

.invoice-mini-title h3 {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.invoice-mini-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.invoice-mini-title .ghost-btn {
  min-height: 34px;
  padding: 5px 13px;
}

.invoice-section .card-header {
  align-items: flex-start;
}

.invoice-form-grid,
.invoice-product-search,
.invoice-discount-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

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

.invoice-form-grid.compact .pos-full {
  grid-column: 1 / -1;
}

.invoice-product-search {
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: end;
}

.invoice-product-search.compact {
  grid-template-columns: minmax(0, 1fr) 160px;
}

.invoice-product-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compact-results {
  max-height: 190px;
  overflow: auto;
}

.invoice-product-suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

.invoice-product-suggestion:hover {
  border-color: var(--brand);
  background: #f8fbff;
}

.invoice-product-suggestion strong,
.invoice-product-suggestion small {
  display: block;
}

.invoice-product-suggestion small,
.invoice-product-suggestion em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.invoice-product-suggestion span {
  color: var(--brand);
  font-weight: 900;
  direction: ltr;
  text-align: left;
}

.invoice-product-suggestion.is-low {
  border-color: rgba(181, 71, 8, .32);
  background: #fffbeb;
}

.invoice-lines-wrap {
  overflow-x: auto;
}

.invoice-lines-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.invoice-lines-table th,
.invoice-lines-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  vertical-align: middle;
}

.invoice-lines-table th {
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.invoice-lines-table tr:last-child td {
  border-bottom: 0;
}

.invoice-line-row strong {
  color: var(--ink);
}

.invoice-line-row small {
  color: var(--muted);
}

.invoice-line-input {
  width: 108px;
  min-height: 36px;
}

.invoice-qty-control {
  width: 126px;
}

.invoice-qty-control input {
  text-align: center;
}

.invoice-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
}

.invoice-summary-payment-layout {
  grid-template-columns: minmax(0, .8fr) minmax(0, .8fr) minmax(360px, 430px);
}

.invoice-payment-inline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 12px;
}

.invoice-payment-board {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
  gap: 16px;
  align-items: start;
}

.invoice-payment-controls,
.invoice-summary-box {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.invoice-payment-board .installment-box {
  grid-column: 1 / -1;
}

.invoice-panel-title {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.invoice-payment-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.invoice-summary-box,
.invoice-payment-summary {
  background: #fff;
}

.invoice-readonly-amount {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 900;
  color: var(--ink);
}

.invoice-payment-summary {
  max-width: 420px;
  margin-top: 12px;
  margin-right: auto;
}

.invoice-final-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.invoice-final-actions button {
  min-height: 44px;
  min-width: 150px;
}

.invoice-sale-page .form-label {
  margin-bottom: 6px;
  font-size: 12px;
}

.invoice-sale-page .form-control,
.invoice-sale-page select,
.invoice-sale-page input,
.invoice-sale-page textarea {
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.invoice-sale-page #posBarcodeInput {
  min-height: 40px;
  font-size: 15px;
}

.invoice-sale-page .pos-summary {
  gap: 7px;
  padding: 12px 14px;
}

.invoice-sale-page .pos-summary-row {
  font-size: 13px;
}

.invoice-sale-page .pos-summary-row.is-main {
  font-size: 17px;
}

.invoice-sale-page .empty {
  min-height: 58px;
  padding: 16px;
}

.invoice-sale-page .compact-empty {
  min-height: 42px;
  padding: 10px;
}

.invoice-sale-page .pos-customer-suggestions {
  position: static;
  z-index: auto;
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.invoice-sale-page .pos-customer-suggestion {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}

.invoice-sale-page .pos-customer-suggestion:hover {
  border-color: var(--brand);
  background: #fff;
}

.invoice-sale-page .pos-customer-suggestion span {
  font-weight: 900;
}

.invoice-sale-page .pos-customer-suggestion small {
  color: var(--muted);
  font-size: 12px;
}

.invoice-sale-page .pos-customer-suggestion.is-new {
  border-color: rgba(37, 99, 235, .2);
  background: #eef6ff;
}

.invoice-sale-page .pos-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

.invoice-sale-page .pos-field-error {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.pos-customer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #f8fbff);
}

.pos-customer-summary > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, .8);
  border-radius: 8px;
  background: #fff;
}

.pos-customer-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pos-customer-summary strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pos-customer-summary .is-warning strong {
  color: #b45309;
}

.pos-customer-summary .is-good strong {
  color: #047857;
}

.pos-customer-summary.is-empty {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.invoice-sale-page,
.invoice-sale-page .invoice-section,
.invoice-sale-page .invoice-main-grid,
.invoice-sale-page .invoice-payment-board,
.invoice-sale-page .invoice-summary-payment-layout,
.invoice-sale-page .invoice-final-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.merchant-sale-shell {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.merchant-sale-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.merchant-sale-tools strong {
  color: var(--ink);
}

.supplier-purchase-shell {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.supplier-purchase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.supplier-purchase-head h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 20px;
}

.supplier-purchase-head small {
  color: var(--muted);
  font-weight: 800;
}

.supplier-purchase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 12px;
}

.supplier-line-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.supplier-line-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-sale-page .invoice-main-grid,
.invoice-sale-page .invoice-payment-board,
.invoice-sale-page .invoice-summary-payment-layout {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1320px) {
  .invoice-sale-page .invoice-main-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  }

  .invoice-sale-page .invoice-payment-board {
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr);
  }
}

@media (max-width: 1180px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }

  .pos-cart-panel {
    position: static;
  }

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

  .pos-form-grid,
  .pos-products-body,
  .pos-payment-body,
  .pos-customer-box,
  .pos-cart-body {
    padding-inline: 12px;
    padding-bottom: 12px;
  }
}

@media (max-width: 720px) {
  .settings-grid,
  .invoice-main-grid,
  .invoice-sale-header,
  .invoice-form-grid,
  .invoice-product-search,
  .invoice-discount-box,
  .invoice-payment-board,
  .invoice-payment-fields-grid,
  .installment-fields,
  .invoice-summary-layout,
  .pos-search-row,
  .pos-form-grid,
  .pos-payment-grid,
  .pos-customer-box,
  .pos-shipment-fields,
  .pos-actions {
    grid-template-columns: 1fr;
  }

  .invoice-sale-header,
  .invoice-final-actions {
    display: grid;
  }

  .invoice-sale-badges,
  .invoice-final-actions {
    justify-content: stretch;
  }

  .invoice-final-actions button {
    width: 100%;
  }

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

  .modal-section-title,
  .modal-summary-title {
    align-items: start;
    flex-direction: column;
  }

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

  .supplier-purchase-head {
    align-items: stretch;
    flex-direction: column;
  }

  .supplier-purchase-grid,
  .supplier-line-form {
    grid-template-columns: 1fr;
  }

  .pos-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .pos-kpi strong {
    font-size: 14px;
  }

  .pos-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .pos-cart-item-meta {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pos-customer-summary {
    grid-template-columns: 1fr;
  }

  .pos-cart-item-header {
    flex-direction: row;
  }

  .pos-cart-item-remove {
    align-self: start;
  }

  .pos-line-label input {
    min-height: 42px;
  }

  .pos-header h2 {
    font-size: 21px;
  }

  .pos-actions .primary-btn,
  .pos-actions .ghost-btn {
    min-height: 48px;
  }

.pos-header-actions {
    justify-content: flex-end;
  }
}

/* Reports Center final layout */
.reports-page.reports-center {
  gap: 20px;
  padding-bottom: 28px;
}

.reports-center .reports-header {
  position: relative;
  overflow: hidden;
  align-items: stretch;
  min-height: 190px;
  padding: 24px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(14, 165, 233, .05) 42%, rgba(255, 255, 255, .96)),
    #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .10);
}

.reports-center .reports-header::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 7px;
  background: linear-gradient(180deg, var(--brand), #0ea5e9);
}

.reports-center .reports-header > div:first-child {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.reports-center .reports-header span {
  width: fit-content;
  padding: 6px 10px;
  color: var(--brand-strong);
  background: rgba(37, 99, 235, .10);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 999px;
  font-size: 12px;
}

.reports-center .reports-header h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: 0;
}

.reports-center .reports-header p {
  max-width: 860px;
  font-size: 14px;
}

.reports-center .reports-header-actions {
  position: relative;
  align-content: center;
  align-items: center;
  min-width: 260px;
}

.reports-center .reports-header-actions button {
  min-height: 42px;
  border-radius: 10px;
  padding-inline: 16px;
}

.reports-center .reports-filter-card {
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line-soft);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .07);
}

.reports-center .reports-filter-head h2 {
  font-size: 20px;
}

.reports-center .reports-filter-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.reports-center .reports-filter-grid label {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.reports-filter-select {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  z-index: 3;
}

.reports-filter-select.is-open {
  z-index: 30;
}

.reports-filter-label {
  color: var(--ink-soft);
}

.reports-filter-select-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
  text-align: right;
}

.reports-filter-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reports-filter-select-button b {
  color: var(--muted);
  font-size: 15px;
}

.reports-filter-select.is-open .reports-filter-select-button {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.reports-filter-select.is-disabled {
  opacity: .72;
}

.reports-filter-options {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, .20);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .16);
}

.reports-filter-options button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  text-align: right;
}

.reports-filter-options button:hover,
.reports-filter-options button.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.custom-select {
  position: relative;
  min-width: 0;
  z-index: 4;
}

.custom-select.is-open {
  z-index: 60;
}

.custom-select-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
  text-align: right;
}

.custom-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-button b {
  color: var(--muted);
}

.custom-select.is-open .custom-select-button {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.custom-select.is-disabled {
  opacity: .7;
}

.custom-select-options {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 270px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, .20);
  border-radius: 12px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, .17);
}

.custom-select-options button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  text-align: right;
}

.custom-select-options button:hover,
.custom-select-options button.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.reports-period-card {
  width: 100%;
  grid-column: span 2;
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
}

.date-filter-card {
  width: 100%;
}

.reports-filter-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.reports-period-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
}

.reports-period-main label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reports-period-main select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, .02);
}

.reports-period-main select:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.reports-period-summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.reports-period-inputs label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-part-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.date-part-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
}

.date-picker-toggle {
  width: 34px;
  min-width: 34px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 9px;
  font-size: 17px;
  line-height: 1;
}

.date-part-selects {
  display: grid;
  grid-template-columns: .72fr 1.28fr .9fr;
  gap: 6px;
}

.date-part-picker {
  position: relative;
  min-width: 0;
  z-index: 2;
}

.date-part-picker.is-open {
  z-index: 40;
}

.date-part-picker > button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.date-part-picker > button::after {
  content: "⌄";
  color: var(--muted);
  font-size: 13px;
}

.date-part-picker.is-open > button {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.date-part-options {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 5px);
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(37, 99, 235, .20);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
}

.date-part-options button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 9px;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  text-align: right;
}

.date-part-options button:hover,
.date-part-options button.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.date-part-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.date-picker-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .12);
}

.date-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.date-picker-head strong {
  color: var(--ink);
  font-size: 14px;
}

.date-picker-head button {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 9px;
  font-size: 20px;
}

.date-picker-week,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.date-picker-week span {
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.date-picker-grid button,
.date-picker-empty {
  min-height: 34px;
  border-radius: 9px;
}

.date-picker-grid button {
  padding: 0;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 900;
}

.date-picker-grid button:hover,
.date-picker-grid button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.date-picker-today {
  justify-self: start;
  min-height: 34px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
}

.reports-period-inputs input,
.reports-period-inputs select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, .02);
}

.reports-period-inputs input:focus,
.reports-period-inputs select:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.reports-period-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reports-period-inputs.is-hidden {
  display: none;
}

.reports-period-inputs label {
  display: grid;
  gap: 5px;
}

.reports-period-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reports-period-shortcuts button {
  min-height: 32px;
  padding: 5px 10px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 999px;
  font-size: 12px;
}

.reports-period-shortcuts button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.reports-center .reports-filter-grid input,
.reports-center .reports-filter-grid select {
  min-height: 44px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
}

.reports-center .reports-filter-actions {
  justify-content: flex-end;
}

.reports-center .reports-filter-actions button {
  min-width: 112px;
  min-height: 42px;
  border-radius: 10px;
}

.reports-center .reports-tabs {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line-soft);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.reports-tabs-group {
  min-width: max-content;
  display: grid;
  align-content: start;
  gap: 7px;
}

.reports-tabs-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding-inline: 4px;
  white-space: nowrap;
}

.reports-tabs-group > div {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
}

.reports-center .reports-tab {
  width: auto;
  min-width: 108px;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ink-soft);
  border-color: #dfe8f4;
}

.reports-center .reports-tab:hover {
  border-color: rgba(37, 99, 235, .35);
  background: #fff;
}

.reports-center .reports-tab.active {
  color: #fff;
  background: var(--brand);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .2);
}

.reports-center .reports-tab span {
  overflow: visible;
  text-overflow: clip;
}

.reports-center .reports-tab-panel {
  gap: 18px;
}

.reports-center .reports-kpi-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
}

.reports-center .reports-kpi-card {
  min-height: 132px;
  padding: 16px 18px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .07);
}

.reports-center .reports-kpi-card::before {
  inset-block: auto 0;
  inset-inline: 18px;
  width: auto;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--brand), #0ea5e9);
}

.reports-center .reports-kpi-card::after {
  content: none;
}

.reports-center .reports-kpi-card span {
  font-size: 12px;
}

.reports-center .reports-kpi-card strong {
  margin-top: 12px;
  font-size: clamp(22px, 2vw, 30px);
  white-space: nowrap;
}

.reports-center .reports-analysis-grid,
.reports-center .reports-table-grid,
.reports-center .report-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.reports-center .reports-overview-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr);
  gap: 16px;
}

.reports-center .reports-chart-card,
.reports-center .reports-table-card,
.reports-center .reports-mini-card,
.reports-center .report-section,
.reports-center .report-card,
.reports-center .reports-directory {
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, .92);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
}

.reports-center .reports-chart-card,
.reports-center .reports-table-card {
  padding: 16px;
}

.reports-center .reports-chart-card > header,
.reports-center .reports-table-card > header,
.reports-center .report-section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.reports-center .reports-chart-card h3,
.reports-center .reports-table-card h3,
.reports-center .report-section-head h2 {
  font-size: 18px;
}

.reports-center .reports-chart-body {
  min-height: 270px;
}

.reports-center .reports-mini-card {
  min-height: 118px;
  padding: 16px;
}

.reports-center .reports-mini-card strong {
  font-size: 20px;
}

.reports-center .report-section {
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.reports-center .report-card .card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.reports-center .report-card .card-body {
  padding: 14px 16px;
}

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

.reports-center .report-directory-group {
  background: #f8fbff;
  border-radius: 14px;
}

.reports-center .table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: auto;
}

.reports-center .data-table {
  min-width: 720px;
}

.reports-center .rank-list {
  display: grid;
  gap: 10px;
}

.reports-center .rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fbfdff;
}

.reports-center .rank-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 900;
}

.reports-center .rank-row strong,
.reports-center .rank-row small {
  display: block;
}

.reports-center .rank-row small {
  color: var(--muted);
  font-size: 12px;
}

.reports-center .rank-row b {
  color: var(--ink);
  white-space: nowrap;
}

.reports-center .rank-row i {
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: var(--w);
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #0ea5e9);
}

@media (max-width: 1200px) {
  .reports-center .reports-filter-grid,
  .reports-center .reports-kpi-grid,
  .reports-center .reports-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-center .reports-overview-layout,
  .reports-center .reports-analysis-grid,
  .reports-center .reports-table-grid,
  .reports-center .report-section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .reports-center .reports-header {
    display: grid;
    min-height: 0;
  }

  .reports-center .reports-header-actions {
    min-width: 0;
    justify-content: stretch;
  }

  .reports-center .reports-header-actions button,
  .reports-center .reports-filter-actions button {
    width: 100%;
  }

  .reports-center .reports-filter-grid,
  .reports-center .reports-kpi-grid,
  .reports-center .reports-directory-grid {
    grid-template-columns: 1fr;
  }

  .reports-period-card,
  .date-filter-card {
    grid-column: span 1;
  }

  .reports-period-inputs {
    grid-template-columns: 1fr;
  }

  .reports-period-main {
    grid-template-columns: 1fr;
  }

  .reports-center .reports-tabs {
    gap: 10px;
  }
}




