:root {
  --bg: #f5f7f6;
  --panel: #ffffff;
  --ink: #17211c;
  --muted: #68756e;
  --line: #dce5df;
  --soft: #eef4f0;
  --nav: #14251d;
  --nav-2: #1d3429;
  --green: #187452;
  --green-2: #dff4e9;
  --blue: #285fd4;
  --red: #b84242;
  --amber: #a9680b;
  --shadow: 0 14px 32px rgba(25, 42, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 37, 29, 0.94), rgba(24, 116, 82, 0.82)),
    var(--nav);
}

.login-panel {
  width: min(420px, 100%);
  padding: 30px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(6, 20, 13, 0.28);
}

.login-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.login-panel p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-form input {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  text-transform: none;
}

.login-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 116, 82, 0.13);
}

.login-error {
  padding: 10px 12px;
  color: #7b1c1c;
  background: #fff0f0;
  border: 1px solid #f0c5c5;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.user-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  color: var(--green);
  background: var(--green-2);
  border: 1px solid #bfe7d1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  color: #e9f2ed;
  background: var(--nav);
  border-right: 1px solid #274438;
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 20px;
}

.logo {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  border-radius: 8px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

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

.brand span {
  margin-top: 2px;
  color: #a8baaf;
  font-size: 12px;
  font-weight: 750;
}

.brand-switcher {
  display: grid;
  gap: 6px;
  margin: -6px 0 16px;
}

.brand-switcher span {
  color: #94aa9e;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.brand-switcher select {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  color: #f5fbf7;
  background: #0e1d16;
  border: 1px solid #345547;
  border-radius: 7px;
  outline: none;
  font-size: 12px;
  font-weight: 850;
}

.brand-switcher select:focus {
  border-color: #57d794;
  box-shadow: 0 0 0 3px rgba(87, 215, 148, 0.15);
}

nav {
  display: grid;
  gap: 1px;
}

nav button {
  min-height: 30px;
  padding: 5px 8px;
  color: #c8d7ce;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
}

nav button.active,
nav button:hover {
  color: #ffffff;
  background: var(--nav-2);
  border-color: #345547;
}

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

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

.title h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0;
}

.title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.btn {
  min-height: 36px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
}

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

.btn.danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.btn.icon {
  width: 36px;
  padding: 0;
}

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

.stat,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  position: relative;
  min-height: 118px;
  padding: 15px;
  overflow: hidden;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
  line-height: 1.12;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f3faf6 100%);
}

.dashboard-hero span,
.dashboard-hero h2,
.dashboard-hero p {
  display: block;
  margin: 0;
}

.dashboard-hero span {
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  margin-top: 4px;
  font-size: 22px;
  letter-spacing: 0;
}

.dashboard-hero p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

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

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.analytics-lists .analytics-panel {
  min-height: 280px;
}

.analytics-panel {
  min-height: 254px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row-head,
.insight-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-row-head span,
.bar-row-head strong,
.insight-line span,
.insight-line strong {
  font-size: 12px;
  font-weight: 900;
}

.bar-row-head span,
.insight-line span {
  color: #4a5b52;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  background: #eef4f0;
  border-radius: 999px;
}

.bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #39a36f);
  border-radius: inherit;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.rank-row > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #126044;
  background: var(--green-2);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
}

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

.rank-row strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insight-line {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compact-empty {
  padding: 18px;
}

.salary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.salary-form {
  padding: 16px;
}

.salary-form .section-title {
  grid-column: 1 / -1;
}

.salary-side {
  display: grid;
  gap: 14px;
}

.customer-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.customer-detail-head span,
.customer-detail-head h2,
.customer-detail-head p {
  display: block;
  margin: 0;
}

.customer-detail-head span {
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.customer-detail-head h2 {
  margin-top: 3px;
  font-size: 22px;
}

.customer-detail-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

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

.detail-list div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.detail-list span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-list strong {
  font-size: 12px;
}

.panel {
  padding: 16px;
  overflow: hidden;
}

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

.panel h2 {
  margin: 0;
  font-size: 17px;
}

.panel small {
  color: var(--muted);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

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

.row-actions .btn {
  min-height: 30px;
  padding: 6px 9px;
}

.link-button {
  display: grid;
  gap: 2px;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.link-button strong {
  color: var(--green);
}

.link-button:hover strong {
  text-decoration: underline;
}

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

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

th {
  color: #55635b;
  background: #f8fbf9;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  margin-top: 2px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.status.paid,
.status.delivered,
.status.in-stock {
  color: #126044;
  background: var(--green-2);
}

.status.pending,
.status.partial,
.status.packed,
.status.low-stock {
  color: #8a5607;
  background: #fff1ce;
}

.status.cancelled,
.status.out-stock {
  color: #9d2828;
  background: #ffe7e7;
}

.status.ready-to-dispatch,
.status.dispatched,
.status.in-transit,
.status.rto {
  color: #8a5607;
  background: #fff1ce;
}

.status-select {
  min-height: 30px;
  max-width: 170px;
  padding: 5px 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 850;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.field,
.form label {
  display: grid;
  gap: 6px;
  color: #334139;
  font-size: 12px;
  font-weight: 900;
}

.field input,
.field select,
.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.field input:focus,
.field select:focus,
.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: #22a36f;
  box-shadow: 0 0 0 3px rgba(34, 163, 111, 0.14);
}

.compact-field {
  min-width: 190px;
}

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

.staff-sales-report {
  margin-bottom: 14px;
}

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

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

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

.combo-builder {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.combo-lines {
  display: grid;
  gap: 10px;
}

.combo-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 130px 38px;
  gap: 10px;
  align-items: end;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

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

.line-item {
  display: grid;
  grid-template-columns: 1.3fr 80px 110px 42px;
  gap: 8px;
  align-items: end;
}

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 18px;
  align-items: start;
}

.order-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.order-section {
  padding: 16px;
  border-color: #e2ebe5;
  box-shadow: 0 10px 24px rgba(25, 42, 33, 0.05);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid #eef3ef;
}

.section-title.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title h2 {
  font-size: 15px;
  letter-spacing: 0;
}

.section-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

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

.clean-form label {
  min-width: 0;
}

.clean-form input,
.clean-form select,
.clean-form textarea,
.product-item input,
.product-item select {
  min-height: 40px;
  background: #fbfdfc;
}

.clean-form textarea {
  resize: vertical;
}

.inventory-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: start;
  margin-bottom: 16px;
  padding: 14px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 13px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #eef3ef;
}

.form-section-title h3 {
  margin: 0;
  font-size: 14px;
}

.form-section-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

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

.inventory-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.customer-lookup-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customer-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(25, 42, 33, 0.16);
}

.customer-suggestions.open {
  display: grid;
  gap: 4px;
}

.customer-suggestion {
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
}

.customer-suggestion:hover {
  background: #f2f8f5;
  border-color: #d3e8dc;
}

.customer-suggestion strong,
.customer-suggestion span {
  display: block;
}

.customer-suggestion strong {
  font-size: 12px;
}

.customer-suggestion span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.empty-suggestion {
  color: var(--muted);
  cursor: default;
  font-weight: 850;
}

.empty-suggestion:hover {
  background: #fff;
  border-color: transparent;
}

.pro-lines {
  display: grid;
  gap: 9px;
}

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

.add-complementary-btn {
  color: #126044;
  background: var(--green-2);
  border-color: #bfe7d1;
}

.product-item {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 76px 104px 112px 34px;
  gap: 8px;
  align-items: end;
  padding: 11px;
  background: #fbfdfc;
  border: 1px solid #dfe9e3;
  border-radius: 8px;
}

.product-picker,
.product-qty,
.product-rate {
  min-width: 0;
}

.product-total {
  display: grid;
  gap: 5px;
}

.stock-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  color: #126044;
  background: var(--green-2);
  border: 1px solid #bfe7d1;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.product-total {
  min-height: 40px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

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

.product-total span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.product-total strong {
  margin-top: 1px;
  font-size: 13px;
}

.remove-product {
  width: 34px;
  min-height: 40px;
  color: #8f3434;
  background: #fff6f6;
  border-color: #f1cccc;
}

.stock-chip.low-stock {
  color: #8a5607;
  background: #fff1ce;
  border-color: #f1dca4;
}

.stock-chip.out-stock {
  color: #9d2828;
  background: #ffe7e7;
  border-color: #ffc8c8;
}

.order-summary {
  position: sticky;
  top: 18px;
  padding: 15px;
  border-color: #d9e6df;
  box-shadow: 0 16px 34px rgba(25, 42, 33, 0.09);
}

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

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

.summary-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.summary-head strong {
  text-align: right;
  font-size: 14px;
}

.summary-lines {
  display: grid;
  gap: 8px;
  padding: 12px 0;
}

.summary-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.summary-lines strong {
  color: var(--ink);
}

.summary-lines .total {
  margin-top: 4px;
  padding-top: 11px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.summary-lines .total strong {
  font-size: 18px;
}

.summary-lines .balance {
  color: #8a5607;
}

.summary-lines .balance strong {
  color: #8a5607;
}

.summary-actions {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.summary-actions .btn {
  width: 100%;
}

.mini-bill-wrap {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.invoice {
  color: #19231d;
  background: #fff;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  overflow: hidden;
}

.invoice-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  color: #526159;
  background: #f7faf8;
  border-bottom: 1px solid #dfe7e2;
  font-size: 11px;
  font-weight: 900;
}

.invoice-topline strong {
  color: #15241c;
  font-size: 14px;
  text-transform: uppercase;
}

.invoice-topline span:last-child {
  text-align: right;
}

.invoice-header,
.invoice-parties {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
}

.invoice-header {
  align-items: center;
}

.invoice-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.invoice-brand img {
  width: 96px;
  max-height: 54px;
  object-fit: contain;
}

.invoice-brand strong,
.invoice-brand span,
.invoice-company span,
.invoice-parties span,
.invoice-parties strong,
.invoice-parties p {
  display: block;
}

.invoice-brand strong {
  font-size: 17px;
}

.invoice-brand span,
.invoice-company,
.invoice-parties p {
  color: #617067;
  font-size: 12px;
  font-weight: 750;
}

.invoice-company {
  text-align: right;
}

.invoice-parties {
  padding-top: 0;
}

.invoice-parties section {
  min-height: 100px;
  padding: 13px;
  background: #f9fbfa;
  border: 1px solid #e4ebe7;
  border-radius: 7px;
}

.invoice-parties span {
  color: #718077;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.invoice-parties strong {
  margin-top: 6px;
  font-size: 14px;
}

.invoice-parties p {
  margin: 5px 0 0;
}

.invoice-table-wrap {
  padding: 0 16px;
  overflow-x: auto;
}

.invoice-table {
  min-width: 620px;
  border: 1px solid #e1e9e4;
}

.invoice-table td span {
  color: #68756e;
  font-size: 11px;
}

.invoice-empty {
  color: #68756e;
  text-align: center;
}

.invoice-notes {
  margin: 12px 16px 0;
  padding: 12px;
  background: #f9fbfa;
  border: 1px solid #e4ebe7;
  border-radius: 7px;
}

.invoice-notes strong,
.invoice-notes p {
  margin: 0;
}

.invoice-notes p {
  margin-top: 4px;
  color: #617067;
  font-size: 12px;
  font-weight: 750;
}

.invoice-totals {
  display: grid;
  gap: 7px;
  width: min(310px, calc(100% - 32px));
  margin: 14px 16px 0 auto;
}

.invoice-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #617067;
  font-size: 12px;
  font-weight: 850;
}

.invoice-totals strong {
  color: #16231b;
}

.invoice-grand {
  margin-top: 4px;
  padding-top: 10px;
  color: #16231b !important;
  border-top: 1px solid #dfe7e2;
  font-size: 15px !important;
}

.invoice-grand strong {
  font-size: 18px;
}

.invoice-footer {
  margin-top: 16px;
  padding: 12px 16px;
  color: #526159;
  background: #f7faf8;
  border-top: 1px solid #dfe7e2;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.mini-invoice {
  border-radius: 7px;
  box-shadow: none;
}

.mini-invoice .invoice-topline {
  padding: 8px 10px;
}

.mini-invoice .invoice-table-wrap,
.mini-invoice .invoice-notes,
.mini-invoice .invoice-footer {
  display: none;
}

.mini-invoice .invoice-header,
.mini-invoice .invoice-parties {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.mini-invoice .invoice-brand img {
  width: 76px;
  max-height: 40px;
}

.mini-invoice .invoice-company {
  display: none;
}

.mini-invoice .invoice-parties section {
  min-height: auto;
  padding: 10px;
}

.mini-invoice .invoice-parties section:first-child {
  display: none;
}

.mini-invoice .invoice-totals {
  width: auto;
  margin: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(11, 19, 15, 0.58);
}

.bill-modal {
  width: min(940px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.bill-modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

.bill-modal-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.bill-modal > .invoice {
  border: 0;
  border-radius: 0;
}

.print-bill-only {
  display: none;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #f9fbfa;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-weight: 850;
}

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

.card {
  padding: 13px;
  box-shadow: none;
}

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

.card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.progress {
  height: 9px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 999px;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--green);
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

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

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

  .stats,
  .dashboard-stats,
  .dashboard-analytics,
  .analytics-summary-grid,
  .dashboard-grid,
  .salary-layout,
  .customer-profile-grid,
  .form,
  .order-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-summary {
    position: static;
  }

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

  .product-item {
    grid-template-columns: minmax(0, 1fr) 86px 100px;
  }

  .product-picker {
    grid-column: span 3;
  }

  .product-total {
    grid-column: span 2;
  }

  .remove-product {
    grid-column: 3;
  }

  .invoice-header,
  .invoice-parties {
    grid-template-columns: 1fr;
  }

  .invoice-company {
    text-align: left;
  }

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

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

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

@media (max-width: 620px) {
  body {
    background: #ffffff;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid #274438;
  }

  .brand {
    grid-template-columns: 38px minmax(0, 1fr);
    margin-bottom: 10px;
  }

  .logo {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 14px;
  }

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

  .brand-switcher {
    margin: 0 0 9px;
  }

  nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

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

  nav button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 11px;
    white-space: nowrap;
  }

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

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .title h1 {
    font-size: 21px;
  }

  .title p {
    font-size: 12px;
  }

  .actions {
    width: 100%;
    gap: 7px;
  }

  .actions .btn,
  .actions .user-chip {
    min-height: 38px;
  }

  .dashboard-hero,
  .panel,
  .order-section {
    border-radius: 7px;
    box-shadow: none;
  }

  .panel,
  .order-section {
    padding: 13px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head .field,
  .compact-field {
    width: 100%;
    min-width: 0;
  }

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

  .stat {
    min-height: 96px;
    padding: 12px;
  }

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

  .toolbar {
    gap: 8px;
  }

  .field input,
  .field select,
  .form input,
  .form select,
  .form textarea,
  .btn {
    min-height: 44px;
  }

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

  .combo-line {
    grid-template-columns: 1fr;
  }

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

  .product-picker,
  .product-total {
    grid-column: auto;
  }

  .remove-product {
    width: 100%;
  }

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

  .inventory-form,
  .form-section-grid,
  .form-section-grid.two-col {
    grid-template-columns: 1fr;
  }

  .form-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .section-title,
  .section-title.compact {
    grid-template-columns: 1fr;
  }

  .bill-modal-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

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

  tr {
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  td {
    min-height: 32px;
    padding: 8px 0;
    border-bottom: 1px solid #eef3ef;
  }

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

  td[data-label] {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .row-actions .btn,
  .status-select {
    width: 100%;
    max-width: none;
  }

  .customer-detail-head {
    grid-template-columns: 1fr;
  }
}

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

  body.printing-bill > *:not(.print-bill-only) {
    display: none !important;
  }

  body.printing-bill {
    background: #fff !important;
  }

  .print-bill-only {
    display: block !important;
  }

  .print-bill-only .invoice {
    width: 100% !important;
    min-height: calc(297mm - 16mm);
    border: 0;
    border-radius: 0;
    transform: none !important;
  }

  .print-bill-only .invoice-table-wrap {
    overflow: visible;
  }
}
