: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);
}

: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;
  }
}
