:root {
  --bg: #eaf1ee;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e4e1;
  --brand: #123d35;
  --brand-2: #0f766e;
  --accent: #caa24d;
  --asquilo: #3f1374;
  --asquilo-2: #188da0;
  --warning-bg: #fff7e6;
  --danger: #b42318;
  --ok: #087f5b;
  --shadow: 0 16px 42px rgba(20, 61, 53, 0.09);
  --shadow-soft: 0 8px 22px rgba(20, 61, 53, 0.06);
  --field-line: rgba(18, 61, 53, 0.055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    radial-gradient(circle at top left, rgba(24, 141, 160, 0.13), transparent 32%),
    radial-gradient(circle at 90% 8%, rgba(202, 162, 77, 0.12), transparent 26%),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Arial, Tahoma, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(135deg, transparent 0 28px, var(--field-line) 29px 30px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0));
}

body::after {
  content: "";
  position: fixed;
  inset-inline-end: 0;
  bottom: 0;
  width: min(720px, 58vw);
  height: 34vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(ellipse at bottom, rgba(18, 61, 53, 0.16), transparent 66%),
    repeating-linear-gradient(18deg, transparent 0 22px, rgba(15, 118, 110, 0.08) 23px 25px);
  clip-path: polygon(0 34%, 100% 7%, 100% 100%, 0 100%);
}

body.locked .sidebar,
body.locked .shell {
  filter: blur(2px);
  pointer-events: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 16, 20, 0.74);
}

body.locked .login-screen {
  display: flex;
}

.login-card {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.login-logo {
  width: 124px;
  height: 124px;
  object-fit: contain;
  border-radius: 10px;
  justify-self: center;
  background: #fff;
  padding: 3px;
  border: 1px solid var(--line);
}

.login-card strong,
.login-card span {
  text-align: center;
}

.login-card strong {
  font-size: 24px;
  color: var(--brand);
}

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

.login-developer {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(19, 63, 43, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 248, 0.90)),
    radial-gradient(circle at 18% 12%, rgba(32, 201, 180, 0.11), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.login-developer img {
  width: min(210px, 72%);
  height: auto;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
}

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

.login-developer b {
  color: var(--brand);
  font-size: 12px;
}

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

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.96) 0%, rgba(18, 61, 53, 0.98) 100%),
    repeating-linear-gradient(145deg, rgba(255,255,255,.04) 0 1px, transparent 1px 24px);
  color: #fff;
  min-height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  box-shadow: 12px 0 38px rgba(18, 61, 53, 0.18);
}

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

.brand::after {
  content: "";
  position: absolute;
  inset-inline: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--asquilo-2), transparent);
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #fff;
  padding: 3px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.brand span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.35;
}

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

.nav-item {
  width: 100%;
  border: 0;
  color: rgba(255, 255, 255, 0.84);
  background: transparent;
  padding: 10px 12px;
  text-align: right;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: translateX(-2px);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-end: 5px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.side-note {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.side-note strong,
.side-note span {
  display: block;
}

.side-note span {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 6px;
  line-height: 1.6;
}

.developer-card {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04)),
    rgba(6, 40, 34, 0.46);
  border-radius: 8px;
  color: #fff;
}

.developer-card span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.developer-card img {
  width: min(152px, 100%);
  height: auto;
  object-fit: contain;
}

.developer-card strong {
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}

.shell {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.shell::before {
  content: "";
  position: fixed;
  top: 0;
  right: 280px;
  left: 0;
  height: 4px;
  z-index: 12;
  background: linear-gradient(90deg, var(--brand), var(--accent), var(--asquilo-2), var(--brand));
  background-size: 230% 100%;
  animation: harvestLine 8s linear infinite;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(217, 228, 225, 0.8);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.90), rgba(247,250,249,0.74)),
    radial-gradient(circle at 20% 20%, rgba(202, 162, 77, 0.10), transparent 28%);
  box-shadow: 0 18px 40px rgba(18, 61, 53, 0.09);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  color: var(--brand);
  font-size: 24px;
}

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

.top-actions,
.form-actions,
.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand);
  background: var(--surface);
  white-space: nowrap;
}

button {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(18, 61, 53, 0.09);
}

.primary {
  background: linear-gradient(135deg, var(--brand), #0f5c50);
  color: #fff;
  border-color: var(--brand);
}

.ghost {
  background: var(--surface);
  color: var(--brand);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.kpi,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,253,252,0.92) 100%);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.kpi {
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.kpi::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(18, 61, 53, 0.13);
}

.kpi span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.kpi strong {
  font-size: 26px;
  color: var(--brand);
}

.daily-panel {
  margin-bottom: 14px;
}

.grid.two {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  min-width: 0;
}

.panel {
  padding: 14px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--brand);
}

.panel-head span {
  color: var(--muted);
}

.operations-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

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

.bulk-actions span,
#operationDeleteStatus {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.30);
  background: #fff7f5;
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  background: #fee4df;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.table-wrap.tall {
  max-height: calc(100vh - 190px);
}

.table-wrap.mini {
  max-height: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  background: #fff;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
  font-size: 12.5px;
}

th {
  background: linear-gradient(180deg, #f9fbfa 0%, var(--surface-soft) 100%);
  color: var(--brand);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: inset 0 -1px 0 var(--line);
}

td {
  color: var(--ink);
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
}

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

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

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

.wide {
  grid-column: span 4;
}

.span-two {
  grid-column: span 2;
}

.form-actions {
  grid-column: span 4;
  justify-content: flex-start;
}

.multi-items {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

.multi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.multi-head strong,
.multi-head span {
  display: block;
}

.multi-head strong {
  color: var(--brand);
  margin-bottom: 4px;
}

.multi-head span {
  color: var(--muted);
  font-weight: 400;
}

#saveStatus {
  color: var(--muted);
}

.search,
.inline-search input {
  min-width: min(260px, 100%);
}

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

.table-action {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--brand);
  border-radius: 7px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
}

.table-action:hover {
  border-color: var(--brand);
}

.select-col {
  width: 58px;
  text-align: center;
}

.row-check {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
  cursor: pointer;
}

.doc-link {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand);
  padding: 6px 8px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.doc-link:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.user-link {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--brand);
  padding: 7px 9px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.user-link:hover {
  background: var(--brand);
  color: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.active {
  background: rgba(9, 146, 104, 0.12);
  color: #087443;
}

.status-pill.paused {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.description-cell {
  color: #263247;
  line-height: 1.55;
}

.statement-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

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

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

.statement-summary div {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 12px;
}

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

.daily-cards div {
  border-top: 3px solid var(--brand-2);
}

.statement-summary span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.statement-summary strong {
  color: var(--brand);
  font-size: 20px;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.summary-strip span {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 10px;
  max-width: 100%;
}

.summary-strip strong {
  color: var(--brand);
}

.sub-details {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
}

.danger-text {
  color: var(--danger) !important;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 22, 26, 0.54);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(9, 24, 29, 0.30);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
}

.modal-head span {
  color: var(--muted);
  font-size: 12px;
}

.modal-head h2 {
  margin: 4px 0 0;
  color: var(--brand);
  font-size: 20px;
  direction: ltr;
  text-align: right;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

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

.file-summary div,
.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
  min-width: 0;
}

.file-summary span,
.detail-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.file-summary strong,
.detail-item strong {
  display: block;
  color: var(--brand);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

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

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
}

.subhead {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tab {
  background: var(--surface-soft);
  color: var(--brand);
}

.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: var(--brand);
  color: #fff;
}

@keyframes harvestLine {
  from {
    background-position: 0 50%;
  }
  to {
    background-position: 230% 50%;
  }
}

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

.store-tab {
  display: none;
}

.store-tab.active {
  display: block;
}

.store-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.store-metric {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.96), rgba(244, 250, 247, 0.92)),
    radial-gradient(circle at 10% 10%, rgba(15, 118, 110, 0.12), transparent 38%);
  box-shadow: var(--shadow);
}

.store-metric::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: var(--brand);
}

.store-metric span,
.store-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.store-metric strong {
  display: block;
  margin: 8px 0 2px;
  color: var(--brand);
  font-size: 28px;
  line-height: 1.1;
  direction: ltr;
  text-align: right;
}

.store-metric.inbound::after {
  background: var(--ok);
}

.store-metric.inbound strong {
  color: var(--ok);
}

.store-metric.issued::after {
  background: #0f6f97;
}

.store-metric.issued strong {
  color: #0f6f97;
}

.store-metric.waste::after {
  background: var(--danger);
}

.store-metric.waste strong {
  color: var(--danger);
}

.store-metric-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.store-metric-grid.compact .store-metric {
  min-height: 92px;
  padding: 12px;
}

.store-metric-grid.compact .store-metric strong {
  font-size: 21px;
}

.agro-toolbox {
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(242, 248, 245, .92)),
    repeating-linear-gradient(145deg, rgba(15, 118, 110, .045) 0 1px, transparent 1px 22px);
  box-shadow: var(--shadow);
}

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

.toolbox-head strong {
  display: block;
  color: var(--brand);
  font-size: 18px;
}

.toolbox-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.toolbox-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agro-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.required-field {
  position: relative;
}

.required-field::after {
  content: "مطلوب";
  justify-self: start;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(180, 35, 24, 0.10);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.num {
  direction: ltr;
  text-align: left;
  white-space: nowrap;
  overflow-wrap: normal;
}

.credit {
  color: var(--ok);
  font-weight: 700;
}

.debit {
  color: var(--danger);
  font-weight: 700;
}

.warn-row td {
  background: var(--warning-bg);
}

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

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

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

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

  .grid.two,
  .kpi-grid,
  .statement-summary,
  .file-summary,
  .detail-grid,
  .store-metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .toolbox-head {
    flex-direction: column;
  }

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

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

  .wide,
  .span-two,
  .form-actions {
    grid-column: span 1;
  }

  .topbar,
  .panel-head,
  .multi-head {
    align-items: stretch;
    flex-direction: column;
  }

  .shell {
    padding: 12px;
  }

  .shell::before {
    right: 0;
  }

  .top-actions,
  .inline-search {
    width: 100%;
  }

  button,
  .top-actions .user-chip {
    max-width: 100%;
  }
}

@media (max-width: 1180px) {
  .store-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .store-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
