:root {
  --ink: #17212b;
  --muted: #62717a;
  --line: #dbe4e5;
  --paper: #ffffff;
  --surface: #ffffff;
  --teal: #0f5d9b;
  --green: #2e6b59;
  --gold: #bd9141;
  --red: #b64242;
  --blue: #315d8f;
  --shadow: 0 18px 48px rgba(18, 37, 46, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #ffffff;
  overflow-x: hidden;
}

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

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 270px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  color: #ffffff;
  background:
    linear-gradient(180deg, #123f6d 0%, #0b3158 58%, #08243f 100%),
    #0b3158;
  transform: translateX(0);
  transition: transform 0.22s ease;
  box-shadow: 20px 0 46px rgba(8, 36, 63, 0.22);
}

body.nav-collapsed .sidebar {
  transform: translateX(-105%);
  pointer-events: none;
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(18, 37, 46, 0.36);
  cursor: default;
}

body:not(.nav-collapsed) .menu-backdrop {
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 900;
  font-size: 1.15rem;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.side-nav a,
.nav-group-toggle {
  min-height: 38px;
  padding: 8px 10px 8px 14px;
  border-radius: 7px;
  color: rgba(234, 244, 255, 0.76);
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.side-nav a.active,
.side-nav a:hover,
.nav-group-toggle:hover,
.nav-group.open > .nav-group-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.side-nav a.active {
  color: #0b3158;
  background: #ffffff;
  border-color: #ffffff;
}

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

.nav-group-toggle {
  position: relative;
  width: 100%;
  padding-right: 34px;
}

.nav-group-toggle::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
}

.nav-group.open > .nav-group-toggle::after {
  content: "-";
}

.nav-group-links {
  display: none;
  gap: 4px;
  padding-left: 0;
}

.nav-group.open .nav-group-links {
  display: grid;
}

.nav-group-links a {
  padding: 8px 10px 8px 18px;
  font-size: 13px;
  border-left: 0;
  border-radius: 7px;
}

.root-link {
  margin-bottom: 4px;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

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

.sidebar-note span {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.5;
}

.app {
  margin-left: 270px;
  padding: 28px;
  min-width: 0;
  transition: margin-left 0.22s ease;
  background: #ffffff;
}

body.nav-collapsed .app {
  margin-left: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.top-actions,
.filters,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button,
.danger-button,
.primary-button,
.menu-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.menu-button {
  margin-bottom: 12px;
  color: #ffffff;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.ghost-button {
  color: var(--teal);
  background: #ffffff;
  border: 1px solid var(--line);
}

.danger-button {
  color: var(--red);
  background: #fff7f4;
  border: 1px solid #efd0c8;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.row-actions button[data-po-action="cancel"] {
  color: var(--red);
  background: #fff7f4;
  border-color: #efd0c8;
}

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

.primary-button {
  width: 100%;
  color: #ffffff;
  background: var(--teal);
  border: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.app:not(.show-dashboard) .dashboard-only {
  display: none;
}

.stat-card {
  min-height: 116px;
  padding: 20px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(18, 37, 46, 0.06);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  color: var(--teal);
  font-size: 2.1rem;
  line-height: 1;
}

.stat-card.alert strong {
  color: var(--red);
}

.stat-card.money strong {
  color: var(--green);
  font-size: 1.65rem;
}

.quick-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.quick-options a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(18, 37, 46, 0.06);
}

.quick-options span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 900;
}

.quick-options strong {
  color: var(--ink);
  line-height: 1.2;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.module-launcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.module-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 260px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(18, 37, 46, 0.06);
}

.module-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 900;
}

.module-card h2 {
  font-size: 1.25rem;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}

.module-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.module-card a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--teal);
  background: #e8f1ee;
  font-size: 0.88rem;
  font-weight: 900;
}

.dashboard-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  background: #ffffff;
  font-weight: 900;
}

.dashboard-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: #f8f6ef;
  border: 1px solid var(--line);
}

.dash-row span {
  color: var(--muted);
  font-weight: 900;
}

.dash-row strong {
  color: var(--teal);
  font-size: 1.05rem;
  text-align: right;
}

.dash-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.panel,
.entry-form,
.help-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.panel-head > * {
  min-width: 0;
}

.embedded-module-panel {
  padding: 0;
  overflow: hidden;
}

.embedded-module-panel .panel-head {
  padding: 18px 20px;
}

.panel-subtext {
  max-width: 920px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.embedded-module-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 760px;
  border: 0;
  background: #f7f3ea;
}

.po-module-frame {
  min-height: 980px;
  background: #eef2f5;
}

.filters input,
.filters select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.filters input {
  width: min(270px, 100%);
  min-width: 0;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.stock-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 18px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
  font-weight: 800;
}

.legend {
  width: 13px;
  height: 13px;
  border-radius: 3px;
}

.legend.ok {
  background: #dff0e8;
}

.legend.low {
  background: #fff1c7;
}

.legend.finished {
  background: #ffe0da;
}

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

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

th {
  color: var(--muted);
  background: #f8f6ef;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  font-weight: 700;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--teal);
  background: #e8f1ee;
  font-size: 0.86rem;
  font-weight: 900;
}

.pill.out {
  color: var(--red);
  background: #fff0ec;
}

.pill.warn {
  color: #8b6200;
  background: #fff1c7;
}

.stock-lines-panel {
  margin-top: 18px;
}

.compact-head {
  padding-top: 18px;
  padding-bottom: 18px;
}

.matrix-table {
  min-width: 1040px;
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  padding: 3px;
  border: 1px solid #cfdadb;
  text-align: center;
  font-size: 0.64rem;
}

.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef3f0;
  color: var(--ink);
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 118px;
  text-align: left !important;
  background: #ffffff !important;
  box-shadow: 8px 0 14px rgba(18, 37, 46, 0.06);
}

.material-cell strong,
.material-cell span,
.matrix-cell strong,
.matrix-cell span,
.matrix-total strong,
.matrix-total span {
  display: block;
}

.material-cell span,
.matrix-cell span,
.matrix-total span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1;
}

.matrix-cell {
  height: 34px;
  min-width: 48px;
}

.matrix-cell.ok {
  background: #eaf5ef;
  color: var(--green);
}

.matrix-cell.low {
  background: #fff4d2;
  color: #8b6200;
}

.matrix-cell.finished {
  background: #ffe4df;
  color: var(--red);
}

.matrix-cell.blank {
  color: #a4afb3;
  background: #faf8f1;
}

.matrix-total {
  color: var(--teal);
  background: #edf4f5;
  font-weight: 900;
}

.matrix-material-head {
  min-width: 68px;
  padding: 4px 3px;
  vertical-align: middle;
}

.matrix-material-head span {
  display: block;
  line-height: 1.05;
}

.matrix-column-delete-button {
  min-height: 18px;
  margin: 3px auto 0;
  padding: 0 5px;
  border: 1px solid #efd0c8;
  border-radius: 5px;
  color: var(--red);
  background: #fff7f4;
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: 900;
}

.matrix-action-cell {
  width: 58px;
  background: #fff;
  vertical-align: middle;
}

.matrix-delete-button {
  min-height: 20px;
  margin: 0;
  padding: 0 5px;
  border: 1px solid #efd0c8;
  border-radius: 5px;
  color: var(--red);
  background: #fff7f4;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 900;
}

.matrix-edit-button {
  min-height: 18px;
  margin-top: 2px;
  padding: 0 5px;
  border: 1px solid #b9d2dc;
  border-radius: 5px;
  color: var(--teal);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.56rem;
  font-weight: 900;
}

.matrix-no-action {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.edit-stock-table input {
  width: 100%;
  min-width: 86px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  font: inherit;
  font-size: 0.78rem;
}

.edit-stock-table th,
.edit-stock-table td {
  padding: 7px;
}

.center-cell {
  text-align: center;
  vertical-align: middle;
}

.center-cell input {
  min-width: 0;
  width: 16px;
  height: 16px;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 18px;
}

.entry-layout > * {
  min-width: 0;
}

.entry-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.multi-order-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.multi-order-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.multi-order-list .muted-text {
  margin: 0;
  font-size: 0.78rem;
}

.multi-order-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.multi-order-summary span {
  color: var(--muted);
}

.compact-order-wrap.table-wrap {
  padding: 0;
  border-radius: 6px;
}

.compact-order-wrap table {
  min-width: 520px;
  font-size: 0.72rem;
}

.compact-order-wrap th,
.compact-order-wrap td {
  padding: 5px 6px;
  line-height: 1.15;
}

.compact-order-wrap button {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 0.66rem;
}

.inline-stock-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.inline-stock-form .primary-button {
  align-self: end;
}

.form-head {
  margin-bottom: 8px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

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

.custom-material-fields {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #cfe0ef;
  border-radius: 8px;
  background: #f5f9fc;
}

.custom-material-fields[hidden] {
  display: none;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.help-panel {
  align-self: start;
  padding: 24px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--teal), var(--ink));
  border-color: transparent;
}

.help-panel.outgoing {
  background: linear-gradient(145deg, var(--green), var(--ink));
}

.help-panel h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

.help-panel p,
.help-panel li {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

.help-panel ul {
  margin: 18px 0 0;
  padding-left: 18px;
}

.selected-stock {
  padding: 14px;
  border-radius: 8px;
  color: var(--muted);
  background: #f8f6ef;
  border: 1px solid var(--line);
  font-weight: 800;
  line-height: 1.55;
}

.party-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  min-width: 0;
}

.party-card,
.empty-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(18, 37, 46, 0.04);
}

.empty-card {
  padding: 28px;
  color: var(--muted);
  font-weight: 800;
}

.party-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.contact-label {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.party-head h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.12;
}

.party-total {
  text-align: right;
  color: var(--teal);
}

.party-total strong,
.party-total span {
  display: block;
}

.party-total span {
  margin-top: 1px;
  color: var(--muted);
  font-weight: 800;
}

.party-total strong {
  font-size: 0.9rem;
  line-height: 1.1;
}

.party-total span {
  font-size: 0.72rem;
}

.mini-wrap.table-wrap {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.mini-wrap table {
  min-width: 720px;
  font-size: 0.66rem;
}

.mini-wrap th,
.mini-wrap td {
  padding: 4px 5px;
  line-height: 1.12;
}

.mini-wrap th {
  font-size: 0.58rem;
}

.party-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.party-order-actions button {
  min-height: 20px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.56rem;
  line-height: 1;
}

.party-order-actions button[data-customer-order-action="delete"] {
  color: var(--red);
  border-color: #efd0c8;
  background: #fff7f4;
}

.party-order-actions button[data-customer-order-action="return"] {
  color: #8b6200;
  border-color: #f0d78a;
  background: #fff8df;
}

.returned-order-row {
  color: var(--muted);
  background: #fafafa;
}

.returned-order-row td:not(:last-child) {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.mini-wrap {
  width: 100%;
  min-width: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 29, 43, 0.42);
}

.app-confirm[hidden] {
  display: none;
}

.app-confirm-card {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(18, 37, 46, 0.24);
}

.app-confirm-card h2 {
  margin-bottom: 10px;
  font-size: 1.45rem;
}

.app-confirm-card p:last-of-type {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 700;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 1040px) {
  .sidebar {
    position: fixed;
    width: 270px;
    min-height: 100vh;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .app {
    margin-left: 0;
  }

  .entry-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 18px;
  }

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

  .stats-grid,
  .quick-options,
  .dashboard-grid,
  .module-launcher,
  .form-grid,
  .inline-stock-form,
  .side-nav {
    grid-template-columns: 1fr;
  }

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

  .party-total {
    text-align: left;
  }

  .filters input {
    min-width: 0;
  }
}

button,
.ghost-button,
.danger-button,
.primary-button,
.menu-button,
.row-actions button,
.party-order-actions button,
.matrix-column-delete-button,
.matrix-delete-button,
.matrix-edit-button {
  border-radius: 2px !important;
}

/* Corporate visual refresh */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d9e1ea;
  --paper: #ffffff;
  --surface: #ffffff;
  --teal: #0b3158;
  --green: #0f5d9b;
  --gold: #a97822;
  --red: #b42318;
  --blue: #1f6fb2;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body {
  color: var(--ink);
  background: #f4f6fa;
  font-family: "Manrope", Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

.sidebar {
  background: #0b3158;
  box-shadow: 18px 0 44px rgba(8, 25, 47, 0.22);
}

.brand {
  font-size: 1rem;
  letter-spacing: 0;
}

.side-nav a,
.nav-group-toggle {
  color: rgba(237, 246, 255, 0.78);
  font-weight: 750;
}

.side-nav a.active,
.nav-group.open > .nav-group-toggle {
  color: #0b3158;
  background: #ffffff;
  border-color: #ffffff;
}

.side-nav a:hover,
.nav-group-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.nav-group.open .nav-group-links a.active {
  color: #0b3158;
  background: #ffffff;
}

.app {
  background: #f4f6fa;
}

.topbar,
.panel,
.stat-card,
.module-card,
.party-card,
.app-confirm-card,
.table-wrap {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  padding: 18px 20px;
  border: 1px solid var(--line);
}

.eyebrow {
  color: #0f5d9b;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 900;
}

.menu-button,
button.primary,
.primary-button {
  color: #ffffff;
  background: #0b3158;
  border-color: #0b3158;
  box-shadow: 0 8px 18px rgba(11, 49, 88, 0.16);
}

.menu-button:hover,
button.primary:hover,
.primary-button:hover {
  background: #0f5d9b;
  border-color: #0f5d9b;
}

button,
.ghost-button {
  color: #0b3158;
  background: #f8fafc;
  border-color: #cfd8e3;
}

button:hover,
.ghost-button:hover {
  background: #eaf3fb;
  border-color: #a8c7de;
}

input,
select,
textarea {
  color: var(--ink);
  background: #ffffff;
  border-color: #cfd8e3;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #1f6fb2;
  box-shadow: 0 0 0 3px rgba(31, 111, 178, 0.16);
}

thead th {
  color: #334155;
  background: #eef3f8;
  border-bottom: 1px solid #cfd8e3;
  font-size: 11px;
  letter-spacing: 0.06em;
}

tbody td {
  border-bottom: 1px solid #e7ecf2;
}

tbody tr:hover {
  background: #f8fbff;
}

/* Keep page content visible while the slide-out menu is open. */
.menu-backdrop,
body:not(.nav-collapsed) .menu-backdrop {
  display: none !important;
  background: transparent !important;
  pointer-events: none !important;
}

.stat-card strong {
  color: #0b3158;
}

.toast {
  background: #0b3158;
}
