:root {
  --bg: #f4f3ef;
  --ink: #101218;
  --muted: #59606a;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --accent: #e86a33;
  --accent-soft: #f7d9c6;
  --accent-contrast: #ffffff;
  --stroke: #e2e4e8;
  --shadow: 0 18px 40px rgba(15, 18, 24, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --bg-grad-a: #f6efe9;
  --bg-grad-b: #f4f3ef;
  --bg-grad-c: #f1f2f5;
  --auth-grad-a: #11131b;
  --auth-grad-b: #1f2430;
  --auth-grad-c: #151821;
  --sidebar-bg: #151821;
  --sidebar-ink: #e9edf5;
  --sidebar-sub: #9aa4b2;
  --nav-ink: #c9d2de;
  --nav-hover-bg: rgba(232, 106, 51, 0.18);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #f5b981;
  --brand-grad-b: #e86a33;
  --brand-ink: #111111;
  --chip-bg: #0b1220;
  --chip-ink: #f8fafc;
  --chip-stroke: rgba(148, 163, 184, 0.2);
  --pill-bg: rgba(255, 255, 255, 0.08);
  --dot-idle: #f2b04c;
  --dot-ok: #5bd16a;
  --ghost-bg: #ffffff;
  --highlight-a: #fff6ee;
  --highlight-b: #ffffff;
  --table-hover: #f8fafc;
}

:root[data-theme="ocean"] {
  --bg: #edf7fb;
  --ink: #0d1d2a;
  --muted: #4b6172;
  --panel: #ffffff;
  --panel-soft: #f3f9ff;
  --accent: #0ea5e9;
  --accent-soft: #d9f0ff;
  --accent-contrast: #ffffff;
  --stroke: #d6e6f3;
  --shadow: 0 18px 40px rgba(8, 47, 73, 0.12);
  --bg-grad-a: #e0f2fe;
  --bg-grad-b: #edf7fb;
  --bg-grad-c: #e2eef8;
  --auth-grad-a: #0a1b2b;
  --auth-grad-b: #12324b;
  --auth-grad-c: #0d2235;
  --sidebar-bg: #0f2435;
  --sidebar-ink: #e8f4ff;
  --sidebar-sub: #9bc0dc;
  --nav-ink: #c9e3f8;
  --nav-hover-bg: rgba(14, 165, 233, 0.22);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #7dd3fc;
  --brand-grad-b: #0284c7;
  --brand-ink: #03263d;
  --chip-bg: #0b2a41;
  --chip-ink: #e6f6ff;
  --chip-stroke: rgba(125, 211, 252, 0.24);
  --pill-bg: rgba(125, 211, 252, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #ecfeff;
  --highlight-b: #ffffff;
  --table-hover: #eff8ff;
}

:root[data-theme="forest"] {
  --bg: #edf7f1;
  --ink: #10221b;
  --muted: #4d6758;
  --panel: #ffffff;
  --panel-soft: #f3fbf6;
  --accent: #16a34a;
  --accent-soft: #daf6e5;
  --accent-contrast: #ffffff;
  --stroke: #d7eadf;
  --shadow: 0 18px 40px rgba(12, 59, 37, 0.11);
  --bg-grad-a: #dcfce7;
  --bg-grad-b: #edf7f1;
  --bg-grad-c: #e5f5ea;
  --auth-grad-a: #0f1f18;
  --auth-grad-b: #19382b;
  --auth-grad-c: #12261d;
  --sidebar-bg: #11261d;
  --sidebar-ink: #e9f7ef;
  --sidebar-sub: #99b7a7;
  --nav-ink: #cce6d7;
  --nav-hover-bg: rgba(22, 163, 74, 0.24);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #86efac;
  --brand-grad-b: #16a34a;
  --brand-ink: #0e2419;
  --chip-bg: #143322;
  --chip-ink: #ecfdf3;
  --chip-stroke: rgba(134, 239, 172, 0.24);
  --pill-bg: rgba(134, 239, 172, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #f0fdf4;
  --highlight-b: #ffffff;
  --table-hover: #eefbf3;
}

:root[data-theme="slate"] {
  --bg: #f0f2f6;
  --ink: #131c2b;
  --muted: #5a6476;
  --panel: #ffffff;
  --panel-soft: #f6f8fc;
  --accent: #4f46e5;
  --accent-soft: #e5e7ff;
  --accent-contrast: #ffffff;
  --stroke: #dce2ee;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  --bg-grad-a: #e8ecf8;
  --bg-grad-b: #f0f2f6;
  --bg-grad-c: #e4e9f3;
  --auth-grad-a: #121827;
  --auth-grad-b: #232d45;
  --auth-grad-c: #161f31;
  --sidebar-bg: #161e30;
  --sidebar-ink: #e8edf8;
  --sidebar-sub: #98a6c4;
  --nav-ink: #c9d5ee;
  --nav-hover-bg: rgba(79, 70, 229, 0.24);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #a5b4fc;
  --brand-grad-b: #4f46e5;
  --brand-ink: #10162a;
  --chip-bg: #1b2740;
  --chip-ink: #eef2ff;
  --chip-stroke: rgba(165, 180, 252, 0.26);
  --pill-bg: rgba(165, 180, 252, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #eef2ff;
  --highlight-b: #ffffff;
  --table-hover: #eef2ff;
}

:root[data-theme="sunset"] {
  --bg: #fcf3ec;
  --ink: #2a1710;
  --muted: #6c4b3f;
  --panel: #ffffff;
  --panel-soft: #fff8f4;
  --accent: #f97316;
  --accent-soft: #ffe3cf;
  --accent-contrast: #ffffff;
  --stroke: #f2ded1;
  --shadow: 0 18px 42px rgba(127, 48, 6, 0.12);
  --bg-grad-a: #ffedd5;
  --bg-grad-b: #fcf3ec;
  --bg-grad-c: #fff0e5;
  --auth-grad-a: #2b160e;
  --auth-grad-b: #4f2815;
  --auth-grad-c: #32190f;
  --sidebar-bg: #2e170f;
  --sidebar-ink: #fff0e5;
  --sidebar-sub: #d6ad96;
  --nav-ink: #ffd9c5;
  --nav-hover-bg: rgba(249, 115, 22, 0.26);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #fdba74;
  --brand-grad-b: #ea580c;
  --brand-ink: #2c140a;
  --chip-bg: #452213;
  --chip-ink: #fff4ed;
  --chip-stroke: rgba(253, 186, 116, 0.3);
  --pill-bg: rgba(253, 186, 116, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #fff7ed;
  --highlight-b: #ffffff;
  --table-hover: #fff7ed;
}

:root[data-theme="rose"] {
  --bg: #fbf0f4;
  --ink: #2a1722;
  --muted: #6f4c5f;
  --panel: #ffffff;
  --panel-soft: #fff7fb;
  --accent: #e11d48;
  --accent-soft: #ffd8e4;
  --accent-contrast: #ffffff;
  --stroke: #f0dae5;
  --shadow: 0 18px 42px rgba(115, 20, 55, 0.12);
  --bg-grad-a: #ffe4e6;
  --bg-grad-b: #fbf0f4;
  --bg-grad-c: #fff1f6;
  --auth-grad-a: #2b1121;
  --auth-grad-b: #4a1833;
  --auth-grad-c: #331426;
  --sidebar-bg: #2d1223;
  --sidebar-ink: #fce7f3;
  --sidebar-sub: #d8a8c2;
  --nav-ink: #f9cadd;
  --nav-hover-bg: rgba(225, 29, 72, 0.24);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #f9a8d4;
  --brand-grad-b: #e11d48;
  --brand-ink: #2a1020;
  --chip-bg: #441729;
  --chip-ink: #ffeaf4;
  --chip-stroke: rgba(249, 168, 212, 0.28);
  --pill-bg: rgba(249, 168, 212, 0.17);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #fff1f2;
  --highlight-b: #ffffff;
  --table-hover: #fff1f2;
}

:root[data-theme="aqua"] {
  --bg: #edf9f8;
  --ink: #0f2426;
  --muted: #4c6a6f;
  --panel: #ffffff;
  --panel-soft: #f2fcfb;
  --accent: #0d9488;
  --accent-soft: #d7f5f1;
  --accent-contrast: #ffffff;
  --stroke: #d7ece8;
  --shadow: 0 18px 40px rgba(6, 78, 74, 0.12);
  --bg-grad-a: #ccfbf1;
  --bg-grad-b: #edf9f8;
  --bg-grad-c: #e2f7f5;
  --auth-grad-a: #0d1f21;
  --auth-grad-b: #154045;
  --auth-grad-c: #113136;
  --sidebar-bg: #10252a;
  --sidebar-ink: #e6fffc;
  --sidebar-sub: #9bc4c1;
  --nav-ink: #c8ece8;
  --nav-hover-bg: rgba(13, 148, 136, 0.24);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #5eead4;
  --brand-grad-b: #0d9488;
  --brand-ink: #082022;
  --chip-bg: #13373a;
  --chip-ink: #e7fffd;
  --chip-stroke: rgba(94, 234, 212, 0.26);
  --pill-bg: rgba(94, 234, 212, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #ecfeff;
  --highlight-b: #ffffff;
  --table-hover: #ecfeff;
}

:root[data-theme="mono"] {
  --bg: #f4f4f5;
  --ink: #18181b;
  --muted: #52525b;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --accent: #27272a;
  --accent-soft: #e4e4e7;
  --accent-contrast: #ffffff;
  --stroke: #e4e4e7;
  --shadow: 0 16px 38px rgba(39, 39, 42, 0.12);
  --bg-grad-a: #f5f5f5;
  --bg-grad-b: #f4f4f5;
  --bg-grad-c: #efeff1;
  --auth-grad-a: #111113;
  --auth-grad-b: #222225;
  --auth-grad-c: #17171a;
  --sidebar-bg: #161618;
  --sidebar-ink: #f4f4f5;
  --sidebar-sub: #a1a1aa;
  --nav-ink: #d4d4d8;
  --nav-hover-bg: rgba(113, 113, 122, 0.24);
  --nav-hover-ink: #ffffff;
  --brand-grad-a: #d4d4d8;
  --brand-grad-b: #52525b;
  --brand-ink: #0f0f10;
  --chip-bg: #27272a;
  --chip-ink: #fafafa;
  --chip-stroke: rgba(212, 212, 216, 0.28);
  --pill-bg: rgba(212, 212, 216, 0.18);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #ffffff;
  --highlight-a: #fafafa;
  --highlight-b: #ffffff;
  --table-hover: #f4f4f5;
}

:root[data-theme-scheme="dark"] {
  --bg: #0b1220;
  --ink: #e6edf7;
  --muted: #9aa9bd;
  --panel: #111a2a;
  --panel-soft: #162235;
  --accent-soft: rgba(148, 163, 184, 0.2);
  --stroke: #2a3a52;
  --shadow: 0 18px 42px rgba(2, 6, 23, 0.55);
  --bg-grad-a: #0f172a;
  --bg-grad-b: #0b1220;
  --bg-grad-c: #0e1626;
  --auth-grad-a: #070c18;
  --auth-grad-b: #111d32;
  --auth-grad-c: #0a1222;
  --sidebar-bg: #091323;
  --sidebar-ink: #dfe8f7;
  --sidebar-sub: #89a0bf;
  --nav-ink: #c0d2ed;
  --nav-hover-bg: rgba(148, 163, 184, 0.2);
  --nav-hover-ink: #ffffff;
  --chip-bg: #14223a;
  --chip-ink: #e8f0ff;
  --chip-stroke: rgba(148, 163, 184, 0.26);
  --pill-bg: rgba(148, 163, 184, 0.16);
  --dot-idle: #f59e0b;
  --dot-ok: #22c55e;
  --ghost-bg: #152338;
  --highlight-a: #162439;
  --highlight-b: #111a2a;
  --table-hover: #1a2a42;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", sans-serif;
  background: radial-gradient(
    circle at top left,
    var(--bg-grad-a),
    var(--bg-grad-b) 45%,
    var(--bg-grad-c)
  );
  color: var(--ink);
}

.admin-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(
    135deg,
    var(--auth-grad-a),
    var(--auth-grad-b) 55%,
    var(--auth-grad-c)
  );
}

.auth-card {
  background: var(--panel);
  border-radius: 22px;
  padding: 32px;
  width: min(420px, 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.auth-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
}

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

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.auth-form input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.alert {
  background: #ffe9e4;
  color: #9f3a1c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-chip {
  background: var(--chip-bg);
  color: var(--chip-ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--chip-stroke);
}

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

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--brand-grad-a), var(--brand-grad-b));
  color: var(--brand-ink);
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  display: grid;
  place-items: center;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  color: var(--sidebar-sub);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  text-decoration: none;
  color: var(--nav-ink);
  padding: 12px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-ink);
}

.sidebar-footer {
  margin-top: auto;
}

.status-pill {
  font-size: 12px;
  padding: 10px 12px;
  background: var(--pill-bg);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-idle);
}

.dot.ok {
  background: var(--dot-ok);
}

.content {
  padding: 32px 36px 48px;
}

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

.page-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 600;
}

.page-subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: var(--ghost-bg);
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn {
  background: transparent;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 20px;
}

.stat-card {
  background: var(--panel);
  padding: 18px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-size: 28px;
  font-family: "Space Grotesk", sans-serif;
  margin-top: 8px;
}

.update-row {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.panel.highlight {
  background: linear-gradient(150deg, var(--highlight-a), var(--highlight-b) 55%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
}

.panel-body {
  overflow-x: auto;
}

.badge {
  background: var(--accent-soft);
  color: #7a3a1a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-success {
  background: rgba(46, 160, 67, 0.16);
  color: #1f7a3a;
}

.badge-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #8a4b12;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.status-actions .ghost-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table.full-table {
  min-width: 100%;
}

.data-table.full-table select,
.data-table.full-table input {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

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

.data-table.full-table td:last-child {
  width: 100px;
}

.erp-table {
  width: 100%;
  overflow-x: auto;
}

.erp-table textarea,
.panel-body textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.inline-search {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  z-index: 20;
}

.dropdown-panel .dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}

.dropdown-panel .dropdown-item:hover {
  background: var(--table-hover);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--stroke);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.finance-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.finance-value {
  font-size: 32px;
  font-family: "Space Grotesk", sans-serif;
}

.divider {
  height: 1px;
  background: var(--stroke);
  margin: 16px 0;
}

.pill {
  background: var(--chip-bg);
  color: var(--chip-ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

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

.table-actions .ghost-btn {
  min-width: 80px;
  text-align: center;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.2;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--stroke);
  border-radius: 999px;
  transition: all 0.2s ease;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: var(--panel);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

.label-settings-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 14px;
}

.label-left,
.label-right,
.label-center {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
}

.label-field-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.label-field-list .ghost-btn {
  width: 100%;
  justify-content: flex-start;
}

.label-canvas-wrap {
  width: 100%;
  overflow: auto;
  border: 1px dashed var(--stroke);
  border-radius: 10px;
  min-height: 420px;
  padding: 12px;
  background: var(--panel-soft);
}

.label-canvas {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.label-item {
  position: absolute;
  border: 1px dashed var(--muted);
  background: var(--accent-soft);
  color: var(--ink);
  box-sizing: border-box;
  padding: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: move;
  user-select: none;
}

.label-item.active {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

.resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  cursor: se-resize;
  box-shadow: 0 0 0 1px var(--panel) inset;
}

.label-inline {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.label-inline.label {
  color: var(--muted);
  font-weight: 600;
  margin-right: 6px;
}

.label-inline.value {
  color: var(--ink);
}

.label-inline.barcode-preview {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

@media (max-width: 1280px) {
  .label-settings-layout {
    grid-template-columns: 1fr;
  }
}

.insight p {
  color: var(--muted);
  line-height: 1.5;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: min(560px, 100%);
  box-shadow: var(--shadow);
}

.modal-card.wide {
  width: min(760px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Manrope", sans-serif;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.order-items {
  background: var(--panel-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.order-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-list .order-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--panel);
}

.order-list .order-item span {
  font-size: 13px;
}

.order-list .order-item button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: var(--ghost-bg);
  cursor: pointer;
}

.order-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 40px;
  gap: 10px;
  margin-bottom: 8px;
}

.order-item-row input,
.order-item-row select {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.remove-btn {
  background: #ffe5e0;
  color: #b33a1b;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.upload-form {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.file-drop {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--stroke);
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  background: #f2f3f6;
  color: var(--muted);
  font-size: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.product-card .product-name {
  font-weight: 600;
}

.file-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-switcher-wrap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
}

.theme-fab {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16);
  cursor: pointer;
}

.theme-fab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(290px, calc(100vw - 24px));
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.2);
  padding: 12px;
}

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

.theme-panel-head h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
}

.theme-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: var(--ghost-bg);
  color: var(--muted);
  cursor: pointer;
}

.theme-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.theme-field select {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-family: "Manrope", sans-serif;
}

.theme-field select:disabled {
  opacity: 0.66;
}

.theme-toggle {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
}

.theme-toggle input {
  accent-color: var(--accent);
}

.theme-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* Customers page simplified card design */
.page-customers {
  --customer-bg: #f4f5f7;
  --customer-panel: #ffffff;
  --customer-border: #d7dbe2;
  --customer-text: #22252d;
  --customer-muted: #6c7280;
  --customer-primary: #5b7cfa;
  --customer-primary-soft: rgba(91, 124, 250, 0.14);
  --customer-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.page-customers .content {
  display: grid;
  gap: 14px;
  padding: 22px 26px 34px;
  background: var(--customer-bg);
}

.page-customers .customer-simple-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-customers .customer-simple-title h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  color: var(--customer-text);
}

.page-customers .customer-simple-title p {
  margin: 6px 0 0;
  color: var(--customer-muted);
  font-size: 14px;
}

.page-customers .customer-simple-header .primary-btn {
  background: var(--customer-primary);
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: none;
}

.page-customers .customer-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.page-customers .customer-control-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--customer-muted);
}

.page-customers .customer-control-field input,
.page-customers .customer-control-field select,
.page-customers .customer-modal-form input,
.page-customers .customer-modal-form select {
  border: 1px solid var(--customer-border);
  border-radius: 8px;
  min-height: 54px;
  padding: 0 14px;
  font-size: 16px;
  line-height: 1.1;
  color: var(--customer-text);
  background: #ffffff;
}

.page-customers .customer-control-field input:focus,
.page-customers .customer-control-field select:focus,
.page-customers .customer-modal-form input:focus,
.page-customers .customer-modal-form select:focus {
  outline: none;
  border-color: var(--customer-primary);
  box-shadow: 0 0 0 3px var(--customer-primary-soft);
}

.page-customers .customer-view-toggle {
  display: inline-flex;
  justify-self: end;
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.page-customers .customer-view-btn {
  border: 0;
  background: transparent;
  color: var(--customer-text);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
}

.page-customers .customer-view-btn.active {
  background: var(--customer-primary);
  color: #ffffff;
}

.page-customers .customer-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.page-customers .customer-mini-card {
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: var(--customer-panel);
  box-shadow: var(--customer-shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.page-customers .customer-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-customers .customer-card-code {
  justify-self: start;
  border-radius: 999px;
  background: #22c7ad;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
}

.page-customers .customer-card-title {
  margin: 2px 0 0;
  color: #171a21;
  font-size: 28px;
  line-height: 1.12;
  text-transform: uppercase;
}

.page-customers .customer-card-line {
  color: #404655;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-icon {
  color: #5b7cfa;
  font-size: 16px;
  line-height: 1;
}

.page-customers .customer-card-info {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfcfd;
  display: grid;
  gap: 10px;
}

.page-customers .customer-card-info div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: #3f4654;
}

.page-customers .customer-card-info strong {
  color: #1b1f2a;
  font-weight: 700;
}

.page-customers .customer-balance-grid {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  background: #fcfcfd;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.page-customers .customer-balance-grid div {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.page-customers .customer-balance-grid div + div {
  border-left: 1px solid var(--customer-border);
}

.page-customers .customer-balance-grid span {
  color: #6b7280;
  font-size: 12px;
}

.page-customers .customer-balance-grid strong {
  font-size: 14px;
  color: #111827;
}

.page-customers .customer-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
}

.page-customers .customer-status-pill.is-complete {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.16);
  border-color: rgba(15, 118, 110, 0.26);
}

.page-customers .customer-status-pill.is-missing {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(180, 83, 9, 0.28);
}

.page-customers .customer-card-footer {
  border-top: 1px solid var(--customer-border);
  padding-top: 10px;
  color: var(--customer-muted);
  font-size: 13px;
}

.page-customers .customer-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.page-customers .customer-card-actions .ghost-btn,
.page-customers .customer-edit-btn {
  border: 1px solid var(--customer-border);
  border-radius: 9px;
  min-height: 48px;
  font-size: 13px;
  background: #ffffff;
}

.page-customers .customer-card-actions .customer-action-edit {
  border-color: #22c7ad;
  color: #0f766e;
}

.page-customers .customer-card-actions .customer-action-detail {
  border-color: #5b7cfa;
  color: #3558d7;
}

.page-customers .customer-card-actions .customer-action-status {
  border-color: #bfc4ce;
  color: #4b5563;
}

.page-customers .customer-table-shell {
  margin: 0;
  padding: 0;
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--customer-shadow);
}

.page-customers .customer-table-wrap {
  overflow: auto;
}

.page-customers #customersTable {
  min-width: 860px;
  margin: 0;
}

.page-customers #customersTable th,
.page-customers #customersTable td {
  border-bottom: 1px solid var(--customer-border);
  padding: 12px 10px;
}

.page-customers #customersTable thead th {
  color: var(--customer-muted);
  font-size: 13px;
  text-transform: uppercase;
}

.page-customers .customer-name-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--customer-primary-soft);
  color: var(--customer-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.page-customers .customer-name-meta {
  display: grid;
  gap: 2px;
}

.page-customers .customer-name-meta strong {
  font-size: 14px;
}

.page-customers .customer-name-meta span {
  font-size: 11px;
  color: var(--customer-muted);
}

.page-customers .customer-code-cell,
.page-customers .customer-shipping-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--customer-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fafbfc;
}

.page-customers .customer-action-col {
  width: 128px;
  text-align: right;
}

.page-customers .customer-empty-state {
  border: 1px dashed var(--customer-border);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.page-customers .customer-empty-state strong {
  color: var(--customer-text);
  font-size: 15px;
}

.page-customers .customer-empty-state p {
  margin: 6px 0 0;
  color: var(--customer-muted);
  font-size: 13px;
}

.page-customers .customer-table-footer {
  color: var(--customer-muted);
  font-size: 13px;
}

.page-customers .customer-modal-form {
  gap: 12px;
}

.page-customers .customer-modal-section {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  background: #fbfcfd;
  padding: 12px;
}

.page-customers .customer-modal-section h5 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--customer-muted);
  text-transform: uppercase;
}

.page-customers .customer-modal-form .field {
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .page-customers .customer-simple-title h2 {
    font-size: 26px;
  }

  .page-customers .customer-simple-title p {
    font-size: 14px;
  }

  .page-customers .customer-control-field input,
  .page-customers .customer-control-field select,
  .page-customers .customer-modal-form input,
  .page-customers .customer-modal-form select {
    font-size: 15px;
  }

  .page-customers .customer-cards-grid {
    grid-template-columns: 1fr;
  }

  .page-customers .customer-card-title {
    font-size: 24px;
  }

  .page-customers .customer-card-line,
  .page-customers .customer-card-info div {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .page-customers .content {
    padding: 16px 14px 28px;
  }

  .page-customers .customer-simple-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-customers .customer-view-toggle {
    justify-self: start;
  }
}

:root[data-theme-scheme="dark"] .alert {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

:root[data-theme-scheme="dark"] .badge {
  color: #e6edf7;
}

:root[data-theme-scheme="dark"] .badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

:root[data-theme-scheme="dark"] .badge-warn {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}

:root[data-theme-scheme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

:root[data-theme-scheme="dark"] .thumb.placeholder {
  background: var(--panel-soft);
  color: var(--muted);
}

:root[data-theme-scheme="dark"] .remove-btn {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .content {
    padding: 20px;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .upload-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 22px;
  }

  .panel {
    padding: 18px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 6px;
    font-size: 13px;
  }

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

  .theme-switcher-wrap {
    right: 10px;
    bottom: 10px;
  }
}

/* ERP customers redesign: public customers page */
.page-customers {
  --customer-bg: #edf3fb;
  --customer-surface: #ffffff;
  --customer-surface-soft: #f6f9fe;
  --customer-surface-strong: #e7eefb;
  --customer-border: #d0ddee;
  --customer-border-strong: #b7c9e4;
  --customer-text: #0f1f35;
  --customer-muted: #5f7394;
  --customer-primary: #1e67f0;
  --customer-primary-soft: rgba(30, 103, 240, 0.14);
  --customer-success: #10967a;
  --customer-warning: #c77a12;
  --customer-danger: #ce3843;
  --customer-info: #1275a8;
  --customer-shadow: 0 18px 34px rgba(14, 40, 84, 0.1);
}

.page-customers .content {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px 24px 34px;
  min-width: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 0% 0%, rgba(30, 103, 240, 0.16), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(16, 150, 122, 0.14), transparent 38%),
    linear-gradient(180deg, #f5f9ff 0%, var(--customer-bg) 55%);
}

.page-customers .sidebar {
  position: relative;
  z-index: 2;
}

.page-customers .customer-erp-topbar,
.page-customers .customer-page-header,
.page-customers .customer-kpi-row,
.page-customers .customer-enterprise-filters,
.page-customers .customer-bulk-toolbar,
.page-customers .customer-cards-grid,
.page-customers .customer-table-shell,
.page-customers .customer-empty-state,
.page-customers .customer-table-footer {
  animation: customerFadeUp 0.36s ease both;
}

.page-customers .customer-erp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--customer-border);
  border-radius: 16px;
  background: var(--customer-surface);
  box-shadow: 0 10px 22px rgba(21, 54, 104, 0.08);
}

.page-customers .customer-erp-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: var(--customer-surface-soft);
  min-height: 48px;
  padding: 0 12px;
}

.page-customers .customer-erp-search-icon {
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-customers #customerSearchInput {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--customer-text);
  font-size: 14px;
  font-family: "Manrope", sans-serif;
}

.page-customers #customerSearchInput::placeholder {
  color: #8ba0be;
}

.page-customers .customer-erp-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-customers .customer-icon-btn,
.page-customers .customer-profile-chip {
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: var(--customer-surface-soft);
  color: var(--customer-text);
  padding: 10px 12px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.page-customers .customer-icon-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--customer-primary);
  color: #ffffff;
  font-size: 11px;
}

.page-customers .customer-profile-chip {
  background: linear-gradient(135deg, #eaf2ff, #f2fff7);
}

.page-customers .customer-profile-chip span {
  color: var(--customer-muted);
}

.page-customers .customer-profile-menu-wrap {
  position: relative;
}

.page-customers .customer-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: var(--customer-surface);
  box-shadow: 0 18px 28px rgba(14, 40, 84, 0.2);
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 30;
}

.page-customers .customer-profile-menu a,
.page-customers .customer-profile-menu button {
  border: 0;
  background: transparent;
  color: var(--customer-text);
  text-align: left;
  text-decoration: none;
  border-radius: 8px;
  min-height: 34px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: "Manrope", sans-serif;
  cursor: pointer;
}

.page-customers .customer-profile-menu a:hover,
.page-customers .customer-profile-menu button:hover {
  background: var(--customer-primary-soft);
}

.page-customers .customer-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--customer-border);
  border-radius: 18px;
  background: var(--customer-surface);
  box-shadow: var(--customer-shadow);
}

.page-customers .customer-breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 600;
}

.page-customers .customer-breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 8px;
  color: #9fb2cd;
}

.page-customers .customer-page-header-main h2 {
  margin: 8px 0 0;
  font-size: 30px;
  line-height: 1.08;
  color: var(--customer-text);
}

.page-customers .customer-page-header-main p {
  margin: 8px 0 0;
  color: var(--customer-muted);
  max-width: 760px;
}

.page-customers .customer-page-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-page-header .primary-btn,
.page-customers .customer-bulk-actions .primary-btn {
  background: linear-gradient(135deg, #1e67f0, #1f8efa);
  color: #ffffff;
  border: 0;
  border-radius: 11px;
  box-shadow: 0 10px 18px rgba(30, 103, 240, 0.26);
}

.page-customers .customer-page-header .ghost-btn,
.page-customers .customer-reset-btn,
.page-customers .customer-pagination-controls .ghost-btn {
  border: 1px solid var(--customer-border);
  color: var(--customer-text);
  border-radius: 11px;
  background: var(--customer-surface-soft);
}

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

.page-customers .customer-kpi-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--customer-border);
  background: var(--customer-surface);
  box-shadow: 0 10px 20px rgba(13, 44, 95, 0.08);
  display: grid;
  gap: 8px;
}

.page-customers .customer-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 14px 14px 0 0;
  opacity: 0.95;
}

.page-customers .customer-kpi-total::before {
  background: linear-gradient(90deg, #1e67f0, #44b7ff);
}

.page-customers .customer-kpi-active::before {
  background: linear-gradient(90deg, #10967a, #40c39d);
}

.page-customers .customer-kpi-missing::before {
  background: linear-gradient(90deg, #c77a12, #f8ad44);
}

.page-customers .customer-kpi-balance::before {
  background: linear-gradient(90deg, #4d53d9, #8c67ff);
}

.page-customers .customer-kpi-card span {
  font-size: 12px;
  color: var(--customer-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-customers .customer-kpi-card strong {
  color: var(--customer-text);
  font-size: 24px;
  line-height: 1.1;
}

.page-customers .customer-enterprise-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--customer-border);
  border-radius: 14px;
  background: var(--customer-surface);
  padding: 14px;
}

.page-customers .customer-control-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--customer-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-customers .customer-control-field select,
.page-customers .customer-modal-form input,
.page-customers .customer-modal-form select {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--customer-text);
  background: var(--customer-surface-soft);
  font-size: 14px;
}

.page-customers .customer-control-field select:focus,
.page-customers .customer-modal-form input:focus,
.page-customers .customer-modal-form select:focus {
  outline: none;
  border-color: var(--customer-primary);
  box-shadow: 0 0 0 3px var(--customer-primary-soft);
}

.page-customers .customer-view-toggle {
  display: inline-flex;
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  overflow: hidden;
  align-self: stretch;
}

.page-customers .customer-view-btn {
  border: 0;
  background: var(--customer-surface-soft);
  color: var(--customer-muted);
  font-size: 13px;
  font-weight: 700;
  min-width: 78px;
  cursor: pointer;
}

.page-customers .customer-view-btn.active {
  background: var(--customer-primary);
  color: #ffffff;
}

.page-customers .customer-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed var(--customer-border-strong);
  border-radius: 14px;
  background: var(--customer-surface-soft);
  padding: 12px 14px;
}

.page-customers .customer-bulk-summary {
  color: var(--customer-muted);
}

.page-customers .customer-bulk-summary strong {
  color: var(--customer-text);
}

.page-customers .customer-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-bulk-actions label {
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-customers .customer-bulk-actions select {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--customer-text);
}

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

.page-customers .customer-mini-card {
  border: 1px solid var(--customer-border);
  border-radius: 14px;
  background: var(--customer-surface);
  box-shadow: 0 10px 22px rgba(12, 43, 89, 0.08);
  padding: 14px;
  display: grid;
  gap: 10px;
  animation: customerFadeUp 0.36s ease both;
  animation-delay: calc(var(--stagger-index, 0) * 0.05s);
}

.page-customers .customer-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-customers .customer-card-code {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e67f0, #2ea4f9);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.page-customers .customer-card-title {
  margin: 0;
  color: var(--customer-text);
  font-size: 24px;
  line-height: 1.08;
}

.page-customers .customer-card-line {
  color: #3f5678;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 22px;
  border-radius: 999px;
  background: var(--customer-primary-soft);
  color: var(--customer-primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-customers .customer-card-info {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--customer-surface-soft);
  display: grid;
  gap: 8px;
}

.page-customers .customer-card-info div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #436086;
}

.page-customers .customer-card-info strong {
  color: var(--customer-text);
}

.page-customers .customer-balance-grid {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  background: var(--customer-surface-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.page-customers .customer-balance-grid div {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.page-customers .customer-balance-grid div + div {
  border-left: 1px solid var(--customer-border);
}

.page-customers .customer-balance-grid span {
  font-size: 11px;
  color: var(--customer-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-customers .customer-balance-grid strong {
  font-size: 13px;
  color: var(--customer-text);
}

.page-customers .customer-card-footer {
  border-top: 1px solid var(--customer-border);
  padding-top: 8px;
  color: var(--customer-muted);
  font-size: 12px;
}

.page-customers .customer-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.page-customers .customer-card-actions .ghost-btn,
.page-customers .customer-row-actions .ghost-btn {
  border: 1px solid var(--customer-border);
  border-radius: 9px;
  min-height: 36px;
  font-size: 12px;
  background: var(--customer-surface-soft);
  color: var(--customer-text);
}

.page-customers .customer-action-detail {
  border-color: #8cb4f5;
  color: #1255c4;
}

.page-customers .customer-action-edit {
  border-color: #63c6ab;
  color: #10816a;
}

.page-customers .customer-action-delete,
.page-customers .customer-row-actions .remove-btn {
  border-color: #f0b5b9;
  color: var(--customer-danger);
}

.page-customers .customer-table-shell {
  margin: 0;
  padding: 0;
  border: 1px solid var(--customer-border);
  border-radius: 14px;
  background: var(--customer-surface);
  box-shadow: var(--customer-shadow);
}

.page-customers .customer-table-wrap {
  overflow: auto;
}

.page-customers #customersTable {
  width: 100%;
  min-width: 1160px;
  margin: 0;
}

.page-customers #customersTable th,
.page-customers #customersTable td {
  border-bottom: 1px solid var(--customer-border);
  padding: 10px 10px;
  white-space: nowrap;
}

.page-customers #customersTable thead th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--customer-muted);
  background: var(--customer-surface-soft);
}

.page-customers #customersTable tbody tr:hover td {
  background: #f0f5ff;
}

.page-customers .customer-sort-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-transform: inherit;
}

.page-customers .customer-sort-btn::after {
  content: "";
  margin-left: 6px;
}

.page-customers .customer-sort-btn.is-sorted-asc::after {
  content: "?";
}

.page-customers .customer-sort-btn.is-sorted-desc::after {
  content: "?";
}

.page-customers .customer-checkbox-col {
  width: 44px;
  text-align: center;
}

.page-customers .customer-checkbox-col input[type="checkbox"] {
  accent-color: var(--customer-primary);
}

.page-customers .customer-name-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--customer-primary-soft);
  color: var(--customer-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
}

.page-customers .customer-name-meta {
  display: grid;
  gap: 1px;
}

.page-customers .customer-name-meta strong {
  font-size: 13px;
  color: var(--customer-text);
}

.page-customers .customer-name-meta span {
  font-size: 11px;
  color: var(--customer-muted);
}

.page-customers .customer-code-cell,
.page-customers .customer-shipping-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--customer-border);
  border-radius: 999px;
  background: var(--customer-surface-soft);
  padding: 4px 9px;
  font-size: 12px;
  color: var(--customer-text);
}

.page-customers .customer-status-stack {
  display: inline-flex;
  align-items: center;
}

.page-customers .customer-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.page-customers .customer-status-pill.is-complete {
  color: var(--customer-success);
  background: rgba(16, 150, 122, 0.14);
  border-color: rgba(16, 150, 122, 0.3);
}

.page-customers .customer-status-pill.is-missing {
  color: var(--customer-warning);
  background: rgba(199, 122, 18, 0.13);
  border-color: rgba(199, 122, 18, 0.3);
}

.page-customers .customer-status-pill.is-passive {
  color: var(--customer-danger);
  background: rgba(206, 56, 67, 0.14);
  border-color: rgba(206, 56, 67, 0.3);
}

.page-customers .balance-positive {
  color: var(--customer-warning);
  font-weight: 700;
}

.page-customers .balance-zero {
  color: var(--customer-info);
  font-weight: 700;
}

.page-customers .customer-action-col {
  width: 280px;
}

.page-customers .customer-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-customers .customer-empty-state {
  border: 1px dashed var(--customer-border-strong);
  border-radius: 12px;
  padding: 14px;
  background: var(--customer-surface);
}

.page-customers .customer-empty-state strong {
  color: var(--customer-text);
}

.page-customers .customer-empty-state p {
  margin: 6px 0 0;
  color: var(--customer-muted);
}

.page-customers .customer-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--customer-muted);
  font-size: 13px;
}

.page-customers .customer-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-customers .customer-pagination-controls label {
  font-size: 12px;
  color: var(--customer-muted);
}

.page-customers .customer-pagination-controls select {
  border: 1px solid var(--customer-border);
  border-radius: 10px;
  min-height: 36px;
  padding: 0 8px;
  background: var(--customer-surface-soft);
  color: var(--customer-text);
}

.page-customers .customer-modal-form {
  gap: 12px;
}

.page-customers .customer-modal-section {
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: var(--customer-surface-soft);
  padding: 12px;
}

.page-customers .customer-modal-section h5 {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--customer-muted);
  text-transform: uppercase;
}

.page-customers .customer-modal-form .field {
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 700;
}

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

@media (max-width: 1200px) {
  .page-customers .customer-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-customers .customer-enterprise-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-customers .content {
    padding: 16px 14px 24px;
  }

  .page-customers .customer-erp-topbar,
  .page-customers .customer-page-header,
  .page-customers .customer-table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .page-customers .customer-page-header-main h2 {
    font-size: 25px;
  }

  .page-customers .customer-enterprise-filters {
    grid-template-columns: 1fr 1fr;
  }

  .page-customers .customer-cards-grid {
    grid-template-columns: 1fr;
  }

  .page-customers .customer-bulk-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 680px) {
  .page-customers .customer-kpi-row,
  .page-customers .customer-enterprise-filters {
    grid-template-columns: 1fr;
  }

  .page-customers .customer-page-header-actions,
  .page-customers .customer-erp-topbar-actions,
  .page-customers .customer-pagination-controls,
  .page-customers .customer-row-actions {
    flex-wrap: wrap;
  }

  .page-customers .customer-card-title {
    font-size: 20px;
  }
}

:root[data-theme-scheme="dark"] .page-customers {
  --customer-bg: #0f1d31;
  --customer-surface: #13243c;
  --customer-surface-soft: #182d4a;
  --customer-surface-strong: #1f385b;
  --customer-border: #2b4567;
  --customer-border-strong: #3a5a82;
  --customer-text: #e7f0ff;
  --customer-muted: #9fb4d3;
  --customer-primary: #5aa4ff;
  --customer-primary-soft: rgba(90, 164, 255, 0.18);
  --customer-success: #44d2ad;
  --customer-warning: #f2b356;
  --customer-danger: #f08893;
  --customer-info: #8ad5ff;
  --customer-shadow: 0 20px 34px rgba(5, 12, 22, 0.42);
}

:root[data-theme-scheme="dark"] .page-customers .content {
  background:
    radial-gradient(circle at 0% 0%, rgba(64, 142, 255, 0.22), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(47, 181, 157, 0.16), transparent 40%),
    linear-gradient(180deg, #11243d 0%, #0f1d31 64%);
}

:root[data-theme-scheme="dark"] .page-customers #customersTable tbody tr:hover td {
  background: rgba(90, 164, 255, 0.14);
}

/* Customers page responsive hardening */
@media (max-width: 1024px) {
  body.page-customers {
    min-height: 100dvh;
    height: auto;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .page-customers .layout {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .page-customers .sidebar {
    position: static;
    top: auto;
    padding: 12px 12px 10px;
    gap: 10px;
    border-bottom: 1px solid rgba(159, 178, 205, 0.35);
  }

  .page-customers .brand {
    gap: 10px;
  }

  .page-customers .brand-title {
    font-size: 15px;
  }

  .page-customers .brand-sub {
    font-size: 11px;
  }

  .page-customers .nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .page-customers .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 12px;
    border-radius: 10px;
  }

  .page-customers .sidebar-footer {
    display: none;
  }

  .page-customers .content {
    padding: 14px 12px 22px;
    min-height: auto;
    overflow: visible !important;
  }

  .page-customers .customer-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-customers .customer-erp-topbar,
  .page-customers .customer-page-header,
  .page-customers .customer-table-footer {
    padding: 12px;
  }

  .page-customers .customer-enterprise-filters,
  .page-customers .customer-kpi-row {
    grid-template-columns: 1fr;
  }

  .page-customers .customer-erp-topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .page-customers .customer-icon-btn,
  .page-customers .customer-profile-chip {
    flex: 1 1 calc(33.33% - 8px);
    justify-content: center;
    min-height: 38px;
    padding: 8px 10px;
  }

  .page-customers .customer-profile-chip span {
    display: none;
  }

  .page-customers .customer-page-header-main h2 {
    font-size: 22px;
  }

  .page-customers .customer-pagination-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .page-customers .customer-page-header-actions,
  .page-customers .customer-bulk-actions,
  .page-customers .customer-row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-customers .customer-page-header .primary-btn,
  .page-customers .customer-page-header .ghost-btn,
  .page-customers .customer-bulk-actions .primary-btn,
  .page-customers .customer-bulk-actions select {
    width: 100%;
  }

  .page-customers .customer-card-actions {
    grid-template-columns: 1fr;
  }

  .page-customers .customer-profile-menu {
    left: 0;
    right: auto;
    min-width: 170px;
  }
}

/* Customers desktop compact density */
@media (min-width: 1025px) {
  .page-customers .content {
    padding: 14px 16px 20px;
    gap: 12px;
  }

  .page-customers .customer-erp-topbar {
    padding: 9px 10px;
    border-radius: 12px;
  }

  .page-customers .customer-erp-search-wrap {
    min-height: 40px;
  }

  .page-customers .customer-icon-btn,
  .page-customers .customer-profile-chip {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .page-customers .customer-page-header {
    padding: 12px 14px;
    border-radius: 14px;
    gap: 10px;
  }

  .page-customers .customer-page-header-main h2 {
    font-size: 22px;
    margin-top: 4px;
  }

  .page-customers .customer-page-header-main p {
    margin-top: 5px;
    font-size: 13px;
    max-width: 620px;
  }

  .page-customers .customer-kpi-card {
    padding: 10px 11px;
    min-height: auto;
  }

  .page-customers .customer-kpi-card strong {
    font-size: 20px;
  }

  .page-customers .customer-enterprise-filters {
    padding: 10px;
  }

  .page-customers .customer-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .page-customers .customer-mini-card {
    padding: 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .page-customers .customer-card-title {
    font-size: 18px;
  }

  .page-customers .customer-card-line,
  .page-customers .customer-card-info div {
    font-size: 12px;
  }

  .page-customers .customer-card-actions .ghost-btn,
  .page-customers .customer-row-actions .ghost-btn {
    min-height: 32px;
    font-size: 11px;
  }
}

@media (min-width: 1440px) {
  .page-customers .customer-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
