:root {
  --ink: #14120f;
  --ink-2: #2e2a24;
  --muted: #716b62;
  --hair: #ded7ca;
  --paper: #fbfaf7;
  --panel: #fffefb;
  --wash: #f1ede5;
  --green: #12634a;
  --green-2: #dcefe7;
  --gold: #a97821;
  --gold-2: #f6ead2;
  --red: #a44336;
  --red-2: #f8dfdb;
  --blue: #295f87;
  --blue-2: #dfeaf1;
  --shadow: 0 18px 50px rgba(39, 31, 20, 0.11);
  --font-ui: "Manrope", "Aptos", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", "Manrope", "Aptos Display", "Segoe UI Variable Display", ui-sans-serif, system-ui, sans-serif;
  --font-doc: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(241, 237, 229, 0.68)),
    radial-gradient(circle at 82% 10%, rgba(169, 120, 33, 0.13), transparent 30%),
    var(--wash);
  color: var(--ink);
  font: 16px/1.58 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

body.theme-dark {
  --ink: #f5f5f7;
  --ink-2: #e8e8ed;
  --muted: #a1a1aa;
  --hair: rgba(255, 255, 255, 0.12);
  --paper: #050506;
  --panel: rgba(28, 28, 30, 0.82);
  --wash: #000;
  --green: #30d158;
  --green-2: rgba(48, 209, 88, 0.14);
  --gold: #ffd60a;
  --gold-2: rgba(255, 214, 10, 0.13);
  --red: #ff453a;
  --red-2: rgba(255, 69, 58, 0.14);
  --blue: #0a84ff;
  --blue-2: rgba(10, 132, 255, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  --dark-frost: rgba(28, 28, 30, 0.72);
  --dark-card: rgba(44, 44, 46, 0.74);
  --dark-card-strong: rgba(58, 58, 60, 0.76);
  --dark-field: rgba(118, 118, 128, 0.18);
  --dark-hover: rgba(255, 255, 255, 0.09);
  --dark-glow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 20px 58px rgba(0, 0, 0, 0.38);
  background:
    radial-gradient(circle at 18% -10%, rgba(10, 132, 255, 0.18), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(48, 209, 88, 0.09), transparent 26%),
    linear-gradient(180deg, #08080a 0%, #000 46%, #060608 100%),
    var(--wash);
}

strong,
b {
  font-weight: 700;
}

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

button {
  cursor: pointer;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 780;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.28;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(251, 250, 247, 0.86);
  border-right: 1px solid var(--hair);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: linear-gradient(135deg, #0f533d, #15120f);
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 760;
  overflow: hidden;
}

.mark.image-mark {
  background: var(--panel);
  border: 1px solid var(--hair);
}

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

.brand-block span,
.rail-card span,
.label {
  display: block;
  color: #5f594f;
  font-size: 12px;
  font-weight: 740;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

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

.nav-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
}

.nav-button.active {
  border-color: var(--hair);
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(39, 31, 20, 0.07);
  color: var(--green);
  font-weight: 730;
}

.rail-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px;
  border: 1px solid #cfc4b4;
  border-radius: 16px;
  background: #191611;
  color: white;
}

.rail-card strong {
  display: block;
  margin: 6px 0;
}

.rail-card p {
  margin: 0;
  color: #d9d0c1;
  font-size: 13px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--hair);
  background: rgba(251, 250, 247, 0.58);
  backdrop-filter: blur(12px);
}

.mast-actions,
.view-toolbar,
.toolbar-actions,
.tabs,
.filter-row,
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view {
  display: none;
  padding: 28px;
}

.view.active {
  display: block;
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 22px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid #d0c4b2;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(20, 18, 15, 0.96), rgba(18, 99, 74, 0.9)),
    var(--ink);
  color: white;
  box-shadow: var(--shadow);
}

.command-hero .label,
.command-hero .hero-copy {
  color: #e6dece;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.65;
}

.readiness {
  display: grid;
  align-content: center;
  gap: 12px;
  align-self: stretch;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.09);
}

.readiness-copy {
  display: grid;
  gap: 4px;
}

.readiness strong {
  font-size: 44px;
  line-height: 0.96;
  font-family: var(--font-display);
  font-weight: 780;
}

.readiness small {
  color: #e6dece;
  font-weight: 650;
  font-size: 13px;
  line-height: 1.35;
}

.readiness p {
  margin: 0;
  color: #d6ccbd;
  font-size: 12.5px;
  line-height: 1.42;
}

.readiness-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.readiness-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #30d158, #0a84ff);
}

.metric-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.8);
  box-shadow: 0 10px 28px rgba(39, 31, 20, 0.045);
  display: grid;
  grid-template-rows: auto minmax(30px, auto) auto;
  align-content: start;
  gap: 6px;
  overflow: visible;
}

.metric strong {
  display: block;
  margin: 0;
  font-size: clamp(20px, 1.6vw, 28px);
  font-family: var(--font-display);
  line-height: 1.05;
  font-weight: 735;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric small {
  color: #5f594f;
  font-size: 13px;
  line-height: 1.45;
  display: block;
  max-width: 100%;
}

.metric:first-child {
  border-color: #b8d4c8;
  background: linear-gradient(180deg, #f4fbf7, #fffefb);
}

.has-help {
  position: relative;
}

.has-help::before {
  content: "?";
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 254, 251, 0.82);
  font-size: 11px;
  font-weight: 800;
}

.tax-row.has-help::before,
.locked-row.has-help::before,
.timeline-row.has-help::before,
.summary-tile.has-help::before {
  display: none;
}

.has-help:hover::after {
  content: attr(data-help);
  position: absolute;
  right: 8px;
  top: 34px;
  z-index: 30;
  width: min(340px, 78vw);
  padding: 11px 12px;
  border: 1px solid var(--hair);
  border-radius: 13px;
  background: #191611;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.42;
  white-space: normal;
}

.metric.has-help:hover::after,
.ledger-tile.has-help:hover::after {
  top: calc(100% + 8px);
  left: 12px;
  right: auto;
  width: min(360px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
}

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

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.surface,
.table-card,
.smart-panel {
  border: 1px solid var(--hair);
  border-radius: 20px;
  background: rgba(255, 254, 251, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.surface {
  padding: 18px;
}

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

.period-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 340px;
}

.period-picker select,
.period-picker input {
  min-width: 132px;
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
}

.period-picker .chip {
  white-space: nowrap;
}

.dark,
.ghost,
.quick-filter,
.chip,
.tab,
.icon-button {
  border-radius: 10px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--hair);
  background: var(--panel);
  color: var(--ink);
  font-weight: 635;
}

.dark {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.ghost {
  background: rgba(255, 254, 251, 0.72);
}

.quick-filter {
  background: #fff6f3;
  color: var(--red);
  border-color: #e3b9ad;
}

.quick-filter span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red-2);
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.quick-filter.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.quick-filter.active span {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.small {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}

.tab {
  color: var(--muted);
  background: transparent;
  font-size: 13.5px;
}

.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 760;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.status-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.good-text {
  color: var(--green);
}

.action-link {
  border-radius: 9px;
}

.calm {
  color: var(--blue);
  background: var(--blue-2);
  border-color: #c4d5df;
}

.good,
.paid,
.fulfilled,
.master,
.ready,
.published {
  color: var(--green);
  background: var(--green-2);
  border-color: #bfd9ce;
}

.manual {
  color: var(--blue);
  background: var(--blue-2);
  border-color: #c4d5df;
}

.warn,
.pending,
.partially-paid,
.unfulfilled,
.review,
.queued {
  color: var(--gold);
  background: var(--gold-2);
  border-color: #e8d3a8;
}

.bad,
.missing,
.failed,
.voided,
.refunded {
  color: var(--red);
  background: var(--red-2);
  border-color: #edc4bd;
}

.muted {
  color: var(--muted);
  background: #ece7dd;
}

.action-stack,
.tax-lanes,
.locked-list,
.timeline,
.report-summary,
.settings-layout,
.commerce-grid {
  display: grid;
  gap: 10px;
}

.action-item,
.tax-row,
.locked-row,
.timeline-row,
.summary-tile,
.settings-card,
.commercial-card,
.template-option,
.report-card {
  border: 1px solid #e5ded2;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
}

.action-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
}

.action-item p,
.timeline-row p,
.commercial-card p,
.template-option p,
.settings-card p {
  margin: 4px 0 0;
  color: #5f594f;
  line-height: 1.55;
}

.tax-row,
.locked-row,
.timeline-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
}

.action-item strong,
.tax-row strong,
.locked-row span,
.timeline-row strong,
.commercial-card strong,
.template-option strong,
.setting-row strong {
  font-weight: 690;
}

.tax-meter {
  position: relative;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe3d7;
}

.tax-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.sync-monitor {
  display: grid;
  gap: 12px;
}

.sync-monitor.full {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e3dace;
  border-radius: 16px;
  background: #fff;
}

.sync-monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.sync-monitor-head strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: capitalize;
}

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

.sync-stat-grid > div {
  padding: 10px;
  border: 1px solid #e9dfd1;
  border-radius: 13px;
  background: #faf7f1;
}

.sync-stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.sync-stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.1;
}

.sync-log-list {
  display: grid;
  gap: 7px;
}

.sync-log-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid #eee6dc;
}

.sync-log-row > span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sync-log-row strong {
  display: block;
  font-size: 13.5px;
  text-transform: capitalize;
}

.sync-log-row p {
  margin: 2px 0 0;
  color: #514b43;
  font-size: 13px;
  line-height: 1.38;
}

.sequence-row.ok {
  border-left: 3px solid var(--green);
  padding-left: 11px;
}

.sequence-row.alert {
  border-left: 3px solid var(--red);
  padding-left: 11px;
}

.view-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.load-more-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  color: var(--muted);
  font-weight: 650;
}

.view-toolbar.centered {
  justify-content: center;
}

.filter-row {
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.8);
}

.filter-row.compact {
  align-items: stretch;
}

input,
select,
textarea {
  height: 40px;
  min-width: 150px;
  padding: 0 12px;
  border: 1px solid #cfc6b8;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

textarea {
  height: auto;
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}

.filter-row input {
  flex: 1;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.table-card {
  overflow: auto;
}

.table-card.flush {
  border-radius: 14px;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #e3dace;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  font-size: 14.5px;
  line-height: 1.5;
}

td small,
td .row-title small {
  display: block;
  margin-top: 4px;
}

th {
  color: #554f46;
  background: #f7f3ec;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

td input,
td select {
  width: 138px;
}

.row-title {
  display: grid;
  gap: 4px;
}

.order-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 18, 15, 0.34);
}

.order-link:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

body.theme-dark .rail,
body.theme-dark .masthead,
body.theme-dark .surface,
body.theme-dark .table-card,
body.theme-dark .smart-panel,
body.theme-dark .filter-row,
body.theme-dark .metric,
body.theme-dark .sync-monitor.full,
body.theme-dark .settings-card,
body.theme-dark .modal {
  background: linear-gradient(180deg, rgba(36, 36, 38, 0.84), rgba(28, 28, 30, 0.76));
  border-color: var(--hair);
  color: var(--ink);
  box-shadow: var(--dark-glow);
  backdrop-filter: blur(24px) saturate(1.25);
}

body.theme-dark .rail,
body.theme-dark .masthead {
  background: rgba(18, 18, 20, 0.72);
  box-shadow: none;
}

body.theme-dark .workspace {
  background: transparent;
}

body.theme-dark .brand-block .mark {
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.98), rgba(88, 86, 214, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.22);
}

body.theme-dark .nav-button {
  color: rgba(245, 245, 247, 0.72);
}

body.theme-dark .nav-button:hover {
  background: var(--dark-hover);
  color: var(--ink);
}

body.theme-dark .nav-button.active {
  background: rgba(10, 132, 255, 0.16);
  border-color: rgba(10, 132, 255, 0.36);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.08);
}

body.theme-dark .brand-block span,
body.theme-dark .rail-card span,
body.theme-dark .label,
body.theme-dark .metric small,
body.theme-dark .row-title small,
body.theme-dark .sync-log-row p,
body.theme-dark .sync-log-row > span,
body.theme-dark .locked-row span,
body.theme-dark .timeline-row p {
  color: var(--muted);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .ghost,
body.theme-dark .tab,
body.theme-dark .chip,
body.theme-dark .sync-stat-grid > div,
body.theme-dark .asset-preview,
body.theme-dark .asset-upload-line,
body.theme-dark .setting-row {
  background: var(--dark-field);
  border-color: var(--hair);
  color: var(--ink);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.76);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-dark th {
  background: rgba(58, 58, 60, 0.72);
  color: var(--ink-2);
}

body.theme-dark td,
body.theme-dark th,
body.theme-dark .sync-log-row {
  border-bottom-color: var(--hair);
  border-top-color: var(--hair);
}

body.theme-dark .dark {
  background: linear-gradient(180deg, #0a84ff, #0066d6);
  color: #fff;
  border-color: rgba(10, 132, 255, 0.78);
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.2);
}

body.theme-dark .good,
body.theme-dark .paid,
body.theme-dark .fulfilled,
body.theme-dark .master,
body.theme-dark .ready,
body.theme-dark .published {
  color: #72e0b7;
  background: #173c32;
  border-color: #2e6f59;
}

body.theme-dark .warn,
body.theme-dark .pending,
body.theme-dark .partially-paid,
body.theme-dark .unfulfilled,
body.theme-dark .review,
body.theme-dark .queued {
  color: #f2c46f;
  background: #42331c;
  border-color: #7d6131;
}

body.theme-dark .bad,
body.theme-dark .missing,
body.theme-dark .failed,
body.theme-dark .voided,
body.theme-dark .refunded {
  color: #ff9b8c;
  background: #45231f;
  border-color: #8f4c42;
}

body.theme-dark .command-hero {
  background:
    radial-gradient(circle at 86% 10%, rgba(10, 132, 255, 0.26), transparent 34%),
    linear-gradient(135deg, rgba(36, 36, 38, 0.92), rgba(18, 18, 20, 0.94));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

body.theme-dark .has-help::before {
  background: rgba(118, 118, 128, 0.22);
  border-color: var(--hair);
  color: var(--muted);
}

body.theme-dark .has-help:hover::after {
  background: rgba(44, 44, 46, 0.96);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px) saturate(1.3);
}

body.theme-dark .metric:first-child,
body.theme-dark .action-item,
body.theme-dark .tax-row,
body.theme-dark .locked-row,
body.theme-dark .timeline-row,
body.theme-dark .summary-tile,
body.theme-dark .commercial-card,
body.theme-dark .template-option,
body.theme-dark .report-card,
body.theme-dark .review-card,
body.theme-dark .empty-state,
body.theme-dark .layout-option,
body.theme-dark .setting-field,
body.theme-dark .asset-field,
body.theme-dark .gst-line-card,
body.theme-dark .master-suggestion,
body.theme-dark .muted-box {
  background: linear-gradient(180deg, rgba(58, 58, 60, 0.45), rgba(44, 44, 46, 0.34));
  border-color: rgba(255, 255, 255, 0.11);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-dark .action-item:hover,
body.theme-dark .tax-row:hover,
body.theme-dark .locked-row:hover,
body.theme-dark .timeline-row:hover,
body.theme-dark .summary-tile:hover,
body.theme-dark .report-card button:hover,
body.theme-dark .template-option:hover,
body.theme-dark .review-card:hover {
  background: linear-gradient(180deg, rgba(72, 72, 74, 0.58), rgba(58, 58, 60, 0.46));
  border-color: rgba(255, 255, 255, 0.18);
}

body.theme-dark .action-item p,
body.theme-dark .timeline-row p,
body.theme-dark .commercial-card p,
body.theme-dark .template-option p,
body.theme-dark .settings-card p,
body.theme-dark .suggestion-box span,
body.theme-dark .suggestion-box small,
body.theme-dark .empty-state p,
body.theme-dark .issue-remark,
body.theme-dark .setting-field span,
body.theme-dark .settings-card-head p,
body.theme-dark .asset-field small {
  color: var(--muted);
}

body.theme-dark .readiness {
  background: rgba(118, 118, 128, 0.16);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-dark .readiness p {
  color: var(--muted);
}

body.theme-dark .readiness-meter {
  background: rgba(118, 118, 128, 0.24);
}

body.theme-dark .readiness-meter span {
  background: linear-gradient(90deg, #30d158, #0a84ff);
}

body.theme-dark .tax-meter {
  background: rgba(118, 118, 128, 0.2);
}

body.theme-dark .tax-meter span {
  background: linear-gradient(90deg, #0a84ff, #30d158);
}

body.theme-dark .order-command {
  background: rgba(44, 44, 46, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 34px rgba(0, 0, 0, 0.28);
}

body.theme-dark .order-command.needs-attention {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.16), rgba(44, 44, 46, 0.78));
  border-color: rgba(255, 69, 58, 0.3);
}

body.theme-dark .command-button {
  color: rgba(245, 245, 247, 0.74);
}

body.theme-dark .command-button:hover,
body.theme-dark .download-cluster:hover > .command-button {
  background: var(--dark-hover);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
}

body.theme-dark .primary-command,
body.theme-dark .primary-command:hover {
  background: linear-gradient(180deg, #0a84ff, #0066d6);
  border-color: rgba(10, 132, 255, 0.72);
  color: #fff;
}

body.theme-dark .primary-command.missing-command,
body.theme-dark .primary-command.missing-command:hover {
  background: linear-gradient(180deg, #ff453a, #d92d25);
  border-color: rgba(255, 69, 58, 0.72);
  color: #fff;
}

body.theme-dark .pdf-command {
  background: rgba(48, 209, 88, 0.14);
  border-color: rgba(48, 209, 88, 0.28);
  color: #30d158;
}

body.theme-dark .copy-menu,
body.theme-dark .report-card button,
body.theme-dark .template-preview-shell,
body.theme-dark .template-editor,
body.theme-dark .template-sidebar,
body.theme-dark .template-editor-grid > section,
body.theme-dark .editor-card,
body.theme-dark .segmented button,
body.theme-dark .setting-toggle,
body.theme-dark .suggestion-box {
  background: rgba(44, 44, 46, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  box-shadow: var(--dark-glow);
}

body.theme-dark .template-preview-canvas {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    rgba(118, 118, 128, 0.14);
  background-size: 18px 18px;
}

body.theme-dark .layout-option span,
body.theme-dark .editor-card p {
  color: var(--muted);
}

body.theme-dark .report-card button.active,
body.theme-dark .tab.active,
body.theme-dark .layout-option.selected,
body.theme-dark .segmented button.active,
body.theme-dark .setting-toggle.on {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.46);
  color: #fff;
}

body.theme-dark .setting-toggle strong,
body.theme-dark .setting-toggle.on strong {
  color: #0a84ff;
}

body.theme-dark .connection-alert {
  background: rgba(255, 69, 58, 0.13);
  border-color: rgba(255, 69, 58, 0.32);
  color: #ffb4ad;
}

body.theme-dark .ca-pack-score,
body.theme-dark .rail-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(10, 132, 255, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(28, 28, 30, 0.96), rgba(10, 10, 12, 0.96));
  border-color: rgba(255, 255, 255, 0.14);
}

.row-title small {
  color: #625c52;
  font-size: 12.5px;
  line-height: 1.35;
}

.issue-remark {
  margin-top: 7px;
  max-width: 420px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.issue-remark strong {
  color: var(--red);
}

.source-links {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.source-links a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.source-links a:hover {
  text-decoration: underline;
}

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

.order-command {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 560px;
  padding: 6px;
  border: 1px solid #ded4c5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefb, #f8f3ec);
  box-shadow: 0 8px 20px rgba(39, 31, 20, 0.05);
  white-space: nowrap;
}

.order-command.needs-attention {
  border-color: #d9aaa4;
  background: linear-gradient(180deg, #fff7f5, #f9e3df);
}

.command-button {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 7px;
  min-width: 68px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #4d463d;
  font-weight: 670;
  font-size: 12.5px;
}

.command-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.command-button:hover,
.download-cluster:hover > .command-button {
  border-color: #d7cdbc;
  background: #fff;
  color: var(--ink);
  transform: translateY(-1px);
}

.primary-command,
.primary-command:hover {
  background: #191611;
  border-color: #191611;
  color: #fff;
}

.primary-command.missing-command,
.primary-command.missing-command:hover {
  background: #a44336;
  border-color: #8e3429;
  color: #fff;
  box-shadow: 0 8px 18px rgba(164, 67, 54, 0.24);
}

.pdf-command {
  background: #e8f0ec;
  border-color: #c9ddd4;
  color: var(--green);
}

.download-cluster {
  position: relative;
}

.copy-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 15;
  display: none;
  min-width: 168px;
  padding: 8px;
  border: 1px solid #d9cfc0;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.download-cluster:hover .copy-menu,
.download-cluster:focus-within .copy-menu {
  display: grid;
}

.copy-menu button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  font-weight: 720;
}

.copy-menu button:hover {
  background: #f2ede5;
}

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

.smart-panel h3 {
  max-width: 640px;
}

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

.commerce-grid {
  grid-template-columns: repeat(3, minmax(250px, 1fr));
}

.commercial-card {
  padding: 18px;
}

.commercial-card strong {
  display: block;
  font-size: 21px;
  line-height: 1.25;
  margin: 10px 0 4px;
}

.invoice-paper {
  background: white;
  border: 1px solid #201a13;
  padding: 0;
  color: #111;
  font-family: var(--font-doc);
  font-size: 9.6px;
  line-height: 1.22;
  box-shadow: var(--shadow);
  width: 560px;
  height: 792px;
  overflow: hidden;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.invoice-paper.page-a4 {
  width: 560px;
  height: 792px;
}

.invoice-paper.page-a5 {
  width: 420px;
  height: 595px;
}

.invoice-paper.page-a5 .invoice-document {
  width: 560px;
  height: 792px;
  transform: scale(0.75);
  transform-origin: top left;
}

.template-workbench {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 420px;
  gap: 16px;
  align-items: start;
}

.template-preview-shell,
.template-editor {
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.88);
}

.template-preview-shell {
  padding: 18px;
}

.template-preview-canvas {
  display: grid;
  place-items: center;
  min-height: 690px;
  padding: 24px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(20, 18, 15, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 18, 15, 0.035) 1px, transparent 1px),
    #ede8de;
  background-size: 18px 18px;
  overflow: hidden;
}

.template-preview-canvas .invoice-paper {
  zoom: 0.82;
}

.template-preview-canvas .invoice-paper.page-a5 {
  zoom: 0.96;
}

.template-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.editor-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e3dace;
  border-radius: 18px;
  background: #fff;
}

.editor-head {
  display: grid;
  gap: 4px;
}

.editor-head strong {
  font-size: 16px;
}

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

.layout-option {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e3dace;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.layout-option span,
.editor-card p {
  color: #5f594f;
  line-height: 1.45;
}

.layout-option.selected {
  border-color: #17130f;
  background: #f8f3ec;
  box-shadow: 0 10px 24px rgba(39, 31, 20, 0.08);
}

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

.segmented button {
  flex: 1;
  min-height: 36px;
  border: 1px solid #e3dace;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-transform: capitalize;
}

.segmented button.active {
  background: #191611;
  border-color: #191611;
  color: #fff;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #e3dace;
  border-radius: 14px;
  background: #faf7f1;
  color: var(--ink);
  text-align: left;
}

.setting-toggle strong {
  color: #8b6b2b;
}

.setting-toggle.on {
  background: #e9f3ee;
  border-color: #c7ded4;
}

.setting-toggle.on strong {
  color: var(--green);
}

.invoice-paper h3 {
  font-family: var(--font-doc);
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 10px;
}

.invoice-paper table th,
.invoice-paper table td {
  padding: 5px;
  border: 1px solid #302820;
  white-space: normal;
}

.invoice-paper.standard {
  font-size: 9.6px;
}

.invoice-paper.compact {
  font-size: 9px;
  line-height: 1.2;
}

.invoice-paper.classic {
  border-width: 2px;
  font-family: Georgia, "Times New Roman", serif;
}

.invoice-paper.minimal {
  border-color: #cfc6b8;
  font-size: 9.9px;
}

.invoice-document {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}

.invoice-header {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.invoice-header h3 {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0;
}

.invoice-header p {
  margin: 0;
}

.invoice-header-brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.invoice-header-brand span {
  line-height: 1.25;
}

.invoice-header-right {
  display: grid;
  justify-items: end;
  gap: 12px;
  text-align: right;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #201a13;
  border-bottom: 0;
}

.invoice-meta-grid div {
  min-height: 28px;
  padding: 5px 7px;
  border-right: 1px solid #201a13;
  border-bottom: 1px solid #201a13;
}

.invoice-meta-grid div:nth-child(3n) {
  border-right: 0;
}

.invoice-meta-grid span,
.invoice-summary-clean span {
  display: block;
  font-weight: 700;
}

.invoice-party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #201a13;
  border-top: 0;
}

.invoice-party-grid > div {
  min-height: 104px;
  padding: 7px;
  border-right: 1px solid #201a13;
  overflow: hidden;
}

.invoice-party-grid > div:last-child {
  border-right: 0;
}

.invoice-party-grid h4 {
  margin: -7px -7px 7px;
  padding: 5px 7px;
  border-bottom: 1px solid #201a13;
  background: #f5f1ea;
  text-transform: uppercase;
}

.invoice-party-grid p {
  margin: 2px 0;
}

.invoice-items {
  border: 1px solid #201a13;
  border-top: 0;
  min-height: 224px;
}

.invoice-line-table {
  width: 100%;
  height: 100%;
  min-height: 224px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.15px;
  line-height: 1.18;
}

.invoice-line-table .col-serial {
  width: 4%;
}

.invoice-line-table .col-item {
  width: 24%;
}

.invoice-line-table .col-qty {
  width: 5%;
}

.invoice-line-table .col-num {
  width: 8.7%;
}

.invoice-line-table .col-hsn {
  width: 9%;
}

.invoice-line-table .col-center {
  width: 6%;
}

.invoice-line-table.interstate .col-item {
  width: 28%;
}

.invoice-line-table.interstate .col-num {
  width: 9.2%;
}

.invoice-line-table th,
.invoice-line-table td {
  padding: 4px 4px;
  border: 1px solid #201a13;
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: normal;
}

.invoice-line-table th {
  background: #f5f1ea;
  font-weight: 850;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.08;
}

.invoice-line-table tbody tr {
  height: 44px;
}

.invoice-line-table .serial,
.invoice-line-table .qty,
.invoice-line-table .center {
  text-align: center;
}

.invoice-line-table .num {
  text-align: right;
}

.invoice-line-table .item strong {
  display: block;
  font-weight: 720;
  line-height: 1.18;
}

.invoice-line-table .item span {
  display: block;
  margin-top: 3px;
  color: #4a4137;
}

.amount-cell {
  display: inline-block;
  line-height: 1.14;
  white-space: normal;
}

.invoice-line-table tfoot td {
  height: 22px;
  vertical-align: middle;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  border: 1px solid #201a13;
  border-top: 0;
  min-height: 116px;
}

.invoice-notes-clean {
  border-right: 1px solid #201a13;
  padding: 7px;
  overflow: hidden;
}

.invoice-notes-clean p {
  margin: 0 0 7px;
}

.invoice-summary-clean {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.35px;
}

.invoice-summary-clean td {
  padding: 4px 6px;
  border: 1px solid #201a13;
  border-top: 0;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.invoice-summary-clean td:first-child {
  width: 62%;
  font-weight: 720;
}

.invoice-summary-clean td:last-child {
  text-align: right;
  font-weight: 720;
}

.invoice-summary-clean .grand td {
  background: #f5f1ea;
  text-transform: uppercase;
  font-weight: 900;
}

.invoice-footer-clean {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  gap: 12px;
  align-items: end;
  min-height: 48px;
  padding: 8px 8px 2px;
}

.invoice-footer-clean > div:nth-child(2) {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.invoice-top,
.invoice-pan {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.invoice-pan {
  margin-bottom: 8px;
}

.invoice-brand {
  display: grid;
  gap: 2px;
  margin: 4px 0 6px;
}

.invoice-brand.center {
  text-align: center;
  justify-items: center;
}

.invoice-brand.left {
  text-align: left;
  justify-items: start;
}

.invoice-brand.right {
  text-align: right;
  justify-items: end;
}

.invoice-brand span {
  display: block;
}

.logo {
  display: grid;
  place-items: center;
  border: 1px solid #302820;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.logo.image-logo {
  overflow: hidden;
  padding: 0;
  background: #fff;
}

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

.signature-image {
  display: block;
  max-width: 120px;
  max-height: 38px;
  margin: 0 0 5px auto;
  object-fit: contain;
}

.logo.small {
  width: 28px;
  height: 28px;
}

.logo.medium {
  width: 40px;
  height: 40px;
}

.logo.large {
  width: 52px;
  height: 52px;
}

.invoice-meta,
.party-table,
.item-table,
.total-table {
  margin-top: 5px;
}

.invoice-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 8px;
  align-items: start;
  margin-top: 5px;
}

.invoice-notes {
  min-height: 118px;
  border: 1px solid #302820;
  padding: 5px;
}

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

.total-table {
  margin-top: 0;
}

.invoice-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-top: 10px;
  min-height: 38px;
}

.paid-stamp {
  display: inline-flex;
  transform: rotate(-6deg);
  border: 2px solid #536b9b;
  color: #536b9b;
  padding: 2px 10px;
  font-weight: 900;
  font-size: 14px;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid #111;
  font-weight: 900;
}

.signature {
  font-weight: 800;
  text-align: right;
}

.invoice-terms {
  margin-bottom: 0;
  font-size: 8px;
}

.template-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
}

.report-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
}

.report-menu {
  display: grid;
  gap: 12px;
}

.report-card {
  padding: 14px;
}

.report-card h3 {
  margin-bottom: 10px;
}

.report-card button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #e5ded2;
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.35;
}

.report-card button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.report-detail {
  min-width: 0;
}

.report-summary {
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  margin-bottom: 14px;
}

.summary-tile {
  padding: 14px;
}

.summary-tile strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.summary-tile small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.smart-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.review-card,
.empty-state {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 250px;
  padding: 18px;
  border: 1px solid #e0d6c7;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.94), rgba(247, 242, 234, 0.82));
  box-shadow: 0 12px 32px rgba(39, 31, 20, 0.06);
}

.review-card h3 {
  font-size: 17px;
}

.suggestion-box {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #c8dfd3;
  border-radius: 16px;
  background: #edf8f2;
}

.suggestion-box strong {
  font-size: 21px;
}

.suggestion-box span,
.suggestion-box small,
.empty-state p {
  color: #5b554c;
}

.muted-box {
  border-color: #e5ded2;
  background: #f4efe7;
}

.ca-pack-board {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  grid-column: 1 / -1;
}

.ca-pack-score {
  padding: 18px;
  border: 1px solid #bad8ca;
  border-radius: 18px;
  background: linear-gradient(160deg, #103f31, #17130f);
  color: #fff;
}

.ca-pack-score .label,
.ca-pack-score p {
  color: #dbeee6;
}

.ca-pack-score strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 46px;
  line-height: 1;
}

.ca-pack-score p {
  margin-bottom: 0;
}

.ca-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.settings-layout {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.settings-card {
  padding: 20px;
}

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

.settings-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.shopify-connect-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) 140px 160px;
  gap: 14px;
}

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.connection-alert {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #edc4bd;
  border-radius: 14px;
  background: #fff1ef;
  color: #8f2f24;
  font-weight: 650;
  line-height: 1.45;
}

.editable-settings {
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.96), rgba(238, 248, 242, 0.62));
  border-color: #c7ddcf;
}

.setting-field {
  display: grid;
  gap: 7px;
  padding: 11px 0;
  border-bottom: 1px solid #e7dfd5;
}

.setting-field:last-child {
  border-bottom: 0;
}

.setting-field span {
  color: #5f594f;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.setting-field input,
.setting-field select,
.setting-field textarea {
  width: 100%;
  min-width: 0;
  background: #fffefb;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #e7dfd5;
  line-height: 1.45;
}

.setting-row:last-child {
  border-bottom: 0;
}

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

.asset-field {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e3dace;
  border-radius: 16px;
  background: #fff;
}

.asset-preview {
  display: grid;
  place-items: center;
  width: 112px;
  height: 76px;
  border: 1px dashed #d7ccbc;
  border-radius: 14px;
  background: #faf7f1;
  overflow: hidden;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.asset-preview strong {
  padding: 8px;
  text-align: center;
  font-size: 13px;
}

.upload-button,
.asset-upload-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 34px;
  margin: 8px 8px 0 0;
  padding: 7px 12px;
  border: 1px solid #191611;
  border-radius: 999px;
  background: #191611;
  color: #fff;
  font-weight: 720;
  cursor: pointer;
}

.asset-upload-line {
  justify-content: flex-start;
  max-width: 100%;
  border-color: var(--hair);
  background: #fffefb;
  color: var(--ink);
  border-radius: 14px;
}

.asset-upload-line strong {
  white-space: nowrap;
}

.asset-input {
  width: min(290px, 100%);
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.asset-field small {
  display: block;
  margin: 7px 0 9px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 18, 15, 0.54);
  z-index: 20;
}

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

.modal {
  width: min(980px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.invoice-modal {
  width: min(980px, 94vw);
}

.order-edit-modal {
  width: min(1040px, 94vw);
}

.modal-head,
.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--hair);
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--hair);
  border-bottom: 0;
}

.modal-copy,
#invoiceBody {
  padding: 18px;
}

.gst-editor {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.order-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

.order-edit-grid .setting-field:nth-child(9),
.order-edit-grid .setting-field:nth-child(14) {
  grid-column: span 2;
}

.gst-line-card {
  display: grid;
  grid-template-columns: minmax(420px, 1.8fr) 112px 156px minmax(240px, 0.9fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #e4dace;
  border-radius: 16px;
  background: #fff;
}

.gst-product-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.gst-product-copy strong {
  line-height: 1.3;
  font-size: 16px;
  font-weight: 760;
}

.locked-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.locked-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4efe7;
  color: #514b43;
  font-size: 12.5px;
  font-weight: 620;
}

.gst-line-card label {
  display: grid;
  gap: 6px;
  color: #5f594f;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.gst-line-card input {
  min-width: 0;
  width: 100%;
  height: 42px;
  border-radius: 13px;
}

.master-suggestion {
  min-width: 0;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid #eadfce;
  border-radius: 13px;
  background: #faf7f1;
}

.master-suggestion strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
}

.icon-button {
  width: 34px;
  padding: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .metric-ribbon {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .span-7,
  .span-5,
  .span-4 {
    grid-column: 1 / -1;
  }

  .report-layout,
  .template-workbench {
    grid-template-columns: 1fr;
  }

  .smart-review-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .ca-pack-board {
    grid-template-columns: 1fr;
  }

  .order-edit-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .gst-line-card {
    grid-template-columns: minmax(320px, 1fr) repeat(2, minmax(130px, 1fr));
  }

  .master-suggestion {
    grid-column: 1 / -1;
  }

  .order-command {
    min-width: 520px;
    flex-wrap: wrap;
    border-radius: 18px;
  }

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

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

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

  .rail-card {
    position: static;
    margin-top: 16px;
  }

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

  .masthead,
  .command-hero,
  .smart-panel,
  .view-toolbar,
  .filter-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .view {
    padding: 18px;
  }

  .metric-ribbon,
  .commerce-grid,
  .settings-layout,
  .brand-assets,
  .sync-stat-grid,
  .report-summary,
  .smart-review-grid,
  .ca-pack-grid,
  .shopify-connect-grid,
  .order-edit-grid {
    grid-template-columns: 1fr;
  }

  .order-edit-grid .setting-field:nth-child(9),
  .order-edit-grid .setting-field:nth-child(14) {
    grid-column: auto;
  }

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

  .asset-field {
    grid-template-columns: 1fr;
  }

  .master-suggestion {
    grid-column: auto;
  }

  .order-command {
    min-width: 0;
    width: 100%;
  }

  .command-button {
    flex: 1 1 92px;
    justify-content: center;
  }
}

/* GST Control Room 2.0 */
:root {
  --ink: #111113;
  --ink-2: #2a2a2d;
  --muted: #6b6f76;
  --hair: rgba(28, 28, 30, 0.105);
  --paper: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.78);
  --wash: #f2f3f5;
  --green: #087a5a;
  --green-2: #e4f6ef;
  --gold: #9b6a0f;
  --gold-2: #fff4d8;
  --red: #ba2f24;
  --red-2: #ffe8e5;
  --blue: #0a5bd3;
  --blue-2: #e7f0ff;
  --violet: #5e5ce6;
  --shadow: 0 18px 60px rgba(16, 24, 40, 0.11);
  --shadow-soft: 0 10px 32px rgba(16, 24, 40, 0.075);
  --ring: 0 0 0 4px rgba(10, 91, 211, 0.14);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-ui: "Inter", "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-display: "Instrument Sans", "Inter", "SF Pro Display", "Segoe UI Variable Display", ui-sans-serif, system-ui, sans-serif;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(245,246,248,0.96) 42%, rgba(239,241,244,0.96) 100%),
    var(--wash);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.52;
}

body.theme-dark {
  --ink: #f5f5f7;
  --ink-2: #e7e8ec;
  --muted: #a3a7b0;
  --hair: rgba(255, 255, 255, 0.12);
  --paper: #08090b;
  --panel: rgba(26, 27, 31, 0.74);
  --wash: #050608;
  --green: #5ee0af;
  --green-2: rgba(94, 224, 175, 0.14);
  --gold: #ffd166;
  --gold-2: rgba(255, 209, 102, 0.15);
  --red: #ff746b;
  --red-2: rgba(255, 116, 107, 0.15);
  --blue: #7ab7ff;
  --blue-2: rgba(122, 183, 255, 0.15);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.36);
  --ring: 0 0 0 4px rgba(122, 183, 255, 0.18);
  background:
    linear-gradient(180deg, #0d0e12 0%, #08090c 44%, #050608 100%),
    var(--wash);
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.06;
}

h2 {
  max-width: 880px;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 800;
  line-height: 0.98;
}

h3 {
  font-size: 18px;
  font-weight: 760;
}

button,
a,
input,
select,
textarea {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(10, 91, 211, 0.62);
  box-shadow: var(--ring);
}

.shell {
  grid-template-columns: 270px minmax(0, 1fr);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  background: rgba(250, 251, 253, 0.78);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.7) inset;
}

.brand-block {
  gap: 13px;
  min-height: 68px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--hair);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.brand-block strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.15;
}

.mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(145deg, #111113, #324038);
  box-shadow: 0 12px 26px rgba(17, 17, 19, 0.18);
}

.nav {
  gap: 8px;
}

.nav-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 18px;
  color: #3d4148;
  font-size: 14px;
}

.nav-button::before {
  content: "C";
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nav-button[data-view="orders"]::before { content: "O"; }
.nav-button[data-view="gst"]::before { content: "G"; }
.nav-button[data-view="commerce"]::before { content: "E"; }
.nav-button[data-view="templates"]::before { content: "T"; }
.nav-button[data-view="reports"]::before { content: "R"; }
.nav-button[data-view="settings"]::before { content: "S"; }

.nav-button span {
  grid-column: 2;
  font-weight: 760;
  line-height: 1.15;
}

.nav-button small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.2;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.62);
}

.nav-button.active {
  border-color: rgba(10, 91, 211, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(241,246,255,0.84));
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(10, 91, 211, 0.11);
}

.nav-button.active::before {
  background: #111113;
  border-color: #111113;
  color: #fff;
}

.rail-card {
  position: static;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(145deg, #111113, #1b241f 58%, #16231f);
  box-shadow: var(--shadow);
}

.workspace {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.52) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.52) 1px, transparent 1px);
  background-size: 34px 34px;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 92px;
  padding: 20px 30px;
  background: rgba(250, 251, 253, 0.74);
  border-bottom: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

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

.mast-status span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.mast-status span.ok {
  color: var(--green);
  background: var(--green-2);
}

.mast-status span.warn {
  color: var(--gold);
  background: var(--gold-2);
}

.mast-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view {
  padding: 30px;
  animation: viewIn 260ms ease both;
}

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

.label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dark,
.ghost,
.quick-filter,
.tab,
.icon-button {
  border-radius: 13px;
  min-height: 38px;
  border-color: var(--hair);
  font-size: 13.5px;
  font-weight: 720;
}

.dark {
  background: #111113;
  border-color: #111113;
  color: #fff;
  box-shadow: 0 12px 28px rgba(17, 17, 19, 0.14);
}

.ghost {
  background: rgba(255, 255, 255, 0.68);
}

.dark:hover,
.ghost:hover {
  box-shadow: var(--shadow-soft);
}

.small {
  min-height: 34px;
  padding: 6px 12px;
}

.chip {
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  letter-spacing: 0.035em;
}

.tab {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.tab.active {
  background: #111113;
  border-color: #111113;
  color: #fff;
}

.command-hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  min-height: 300px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 32px;
  background:
    linear-gradient(135deg, #101113 0%, #1b1f25 48%, #0b3b33 100%);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.hero-main {
  display: grid;
  align-content: center;
}

.command-hero .label,
.command-hero .hero-copy {
  color: rgba(255, 255, 255, 0.72);
}

.hero-copy {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.65;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  font-weight: 700;
}

.readiness {
  align-content: stretch;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.readiness strong {
  margin-top: 8px;
  font-size: 64px;
}

.readiness small,
.readiness p {
  color: rgba(255,255,255,0.74);
}

.readiness-meter {
  height: 10px;
}

.readiness-meter span {
  background: linear-gradient(90deg, #5ee0af 0%, #7ab7ff 68%, #c7b9ff 100%);
  animation: meterIn 600ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes meterIn {
  from { width: 0; }
}

.metric-ribbon,
.ledger-brief {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}

.metric,
.ledger-tile,
.surface,
.table-card,
.smart-panel,
.settings-card,
.template-preview-shell,
.template-editor,
.report-card,
.commercial-card,
.review-card,
.empty-state {
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255,255,255,0.78) inset, var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.18);
}

.metric,
.ledger-tile {
  position: relative;
  min-height: 116px;
  padding: 17px;
  display: grid;
  grid-template-rows: auto minmax(30px, auto) auto;
  align-content: start;
  gap: 6px;
  overflow: visible;
}

.metric::after,
.ledger-tile::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--green), var(--blue));
  opacity: 0.58;
}

.metric strong,
.ledger-tile strong {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 1.45vw, 26px);
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric small,
.ledger-tile small {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.ledger-brief {
  display: grid;
  margin: 0 0 14px;
}

.ledger-tile small {
  margin-top: 0;
}

.surface,
.smart-panel {
  padding: 20px;
}

.section-head {
  align-items: center;
}

.action-item,
.tax-row,
.locked-row,
.timeline-row,
.summary-tile,
.setting-row,
.gst-line-card,
.asset-field,
.layout-option,
.setting-toggle,
.suggestion-box {
  border-color: var(--hair);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 0 rgba(255,255,255,0.68) inset;
}

.action-item,
.tax-row,
.locked-row,
.timeline-row,
.summary-tile,
.commercial-card,
.review-card,
.layout-option {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.action-item:hover,
.tax-row:hover,
.locked-row:hover,
.timeline-row:hover,
.summary-tile:hover,
.commercial-card:hover,
.review-card:hover,
.layout-option:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 91, 211, 0.2);
  box-shadow: var(--shadow-soft);
}

.action-item {
  grid-template-columns: minmax(0, 1fr) auto;
  border-radius: 18px;
}

.action-item.critical {
  border-color: rgba(186, 47, 36, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 232, 229, 0.64));
}

.action-copy {
  min-width: 0;
}

.action-control {
  display: flex;
  align-items: center;
}

.tax-row,
.locked-row,
.timeline-row {
  border-radius: 16px;
}

.tax-row {
  align-items: center;
}

.tax-value {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.tax-meter {
  width: min(180px, 32vw);
  background: rgba(107, 111, 118, 0.14);
}

.filter-row {
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  flex-wrap: wrap;
}

.filter-row > input,
.filter-row > select {
  flex: 1 1 170px;
}

.filter-row > button,
.filter-row > .toggle {
  flex: 0 0 auto;
}

input,
select,
textarea {
  min-height: 42px;
  border-color: rgba(28, 28, 30, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(107, 111, 118, 0.74);
}

.table-card {
  border-radius: 22px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(246, 247, 250, 0.96);
  color: #515762;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(10, 91, 211, 0.035);
}

td:first-child,
td:nth-child(4),
td .row-title,
.row-title strong,
.row-title small {
  white-space: normal;
}

.row-title strong {
  color: var(--ink);
}

.row-title small {
  color: var(--muted);
}

.order-command {
  min-width: 0;
  width: max-content;
  max-width: 100%;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(245, 246, 248, 0.86);
  box-shadow: none;
}

.order-command.needs-attention {
  border-color: rgba(186, 47, 36, 0.28);
  background: rgba(255, 232, 229, 0.58);
}

.command-button {
  grid-template-columns: 18px auto;
  min-width: 42px;
  height: 38px;
  padding: 0 9px;
  border-radius: 12px;
  color: #454b54;
  font-size: 12px;
}

.command-button span {
  font-weight: 740;
}

.primary-command {
  min-width: 64px;
}

.primary-command,
.primary-command:hover {
  background: #111113;
  border-color: #111113;
  color: #fff;
}

.primary-command.missing-command,
.primary-command.missing-command:hover {
  background: var(--red);
  border-color: var(--red);
}

.pdf-command {
  color: var(--green);
  background: var(--green-2);
  border-color: rgba(8, 122, 90, 0.18);
}

.copy-menu {
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.smart-panel {
  align-items: flex-start;
  border-radius: 26px;
}

.smart-stats .chip {
  min-height: 30px;
  background: rgba(255,255,255,0.72);
}

.smart-review-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.review-card {
  min-height: 230px;
}

.suggestion-box {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(228, 246, 239, 0.9), rgba(255,255,255,0.68));
}

.template-workbench {
  grid-template-columns: minmax(620px, 1fr) 390px;
  gap: 18px;
}

.template-preview-shell,
.template-editor {
  border-radius: 26px;
}

.template-preview-shell {
  padding: 18px;
}

.template-preview-canvas {
  min-height: 730px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(17, 17, 19, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 19, 0.045) 1px, transparent 1px),
    #e8e8ec;
  background-size: 22px 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.template-preview-canvas .invoice-paper {
  zoom: 0.86;
  box-shadow: 0 22px 70px rgba(17, 17, 19, 0.18);
}

.editor-card {
  border-color: var(--hair);
  border-radius: 20px;
  background: rgba(255,255,255,0.62);
}

.layout-option {
  border-radius: 17px;
  padding: 13px;
}

.layout-option.selected,
.segmented button.active,
.setting-toggle.on {
  background: #111113;
  border-color: #111113;
  color: #fff;
}

.layout-option.selected span,
.setting-toggle.on strong {
  color: rgba(255,255,255,0.74);
}

.segmented button {
  min-height: 38px;
  border-color: var(--hair);
}

.setting-toggle {
  border-radius: 16px;
}

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

.report-menu {
  align-content: start;
}

.report-card {
  padding: 15px;
}

.report-card button {
  align-items: center;
  border-color: var(--hair);
  border-radius: 15px;
  background: rgba(255,255,255,0.62);
}

.report-card button strong {
  min-width: 0;
  white-space: normal;
  text-align: left;
}

.report-card button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-card button.active {
  background: #111113;
  border-color: #111113;
  color: #fff;
}

.report-card button.active span {
  color: rgba(255,255,255,0.62);
}

.report-summary {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.summary-tile {
  border-radius: 18px;
}

.ca-pack-board {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
}

.ca-pack-score {
  border-radius: 24px;
  background: linear-gradient(145deg, #111113, #183a32);
}

.ca-pack-score strong {
  font-size: 58px;
}

.ca-pack-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.settings-layout {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  grid-column: span 6;
  border-radius: 24px;
  padding: 20px;
}

.settings-card.wide,
.settings-card.editable-settings.wide {
  grid-column: 1 / -1;
}

.editable-settings {
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(247, 252, 250, 0.74));
}

.settings-card-head {
  align-items: flex-start;
  padding-bottom: 2px;
}

.shopify-connect-grid {
  grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1.4fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr);
}

.setting-field {
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: rgba(255,255,255,0.56);
}

.setting-field + .setting-field {
  margin-top: 10px;
}

.shopify-connect-grid .setting-field + .setting-field,
.order-edit-grid .setting-field + .setting-field {
  margin-top: 0;
}

.setting-field span {
  color: var(--muted);
  letter-spacing: 0.07em;
}

.setting-row {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  margin-top: 10px;
}

.brand-assets {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.asset-field {
  border-radius: 18px;
}

.asset-preview {
  border-radius: 16px;
}

.asset-upload-line {
  border-radius: 999px;
}

.sync-monitor.full {
  border-color: var(--hair);
  border-radius: 18px;
}

.sync-stat-grid > div {
  border-color: var(--hair);
  border-radius: 16px;
  background: rgba(255,255,255,0.6);
}

.modal-backdrop {
  background: rgba(5, 6, 8, 0.56);
  backdrop-filter: blur(10px);
}

.modal {
  border: 1px solid var(--hair);
  border-radius: 28px;
  background: rgba(250, 251, 253, 0.96);
  box-shadow: 0 28px 100px rgba(0,0,0,0.28);
}

.modal-head,
.modal-foot {
  padding: 20px 22px;
}

.icon-button {
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}

.gst-editor {
  gap: 10px;
}

.gst-line-card {
  grid-template-columns: minmax(480px, 2fr) 116px 170px minmax(260px, 1fr);
  border-radius: 19px;
  padding: 14px;
}

.gst-product-copy strong {
  font-size: 15.5px;
}

.locked-meta span {
  background: rgba(107, 111, 118, 0.09);
  color: var(--muted);
}

.master-suggestion {
  border-radius: 16px;
}

.order-edit-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.toast {
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  background: rgba(17, 17, 19, 0.92);
  backdrop-filter: blur(18px);
}

body.theme-dark .rail,
body.theme-dark .masthead,
body.theme-dark .brand-block,
body.theme-dark .metric,
body.theme-dark .ledger-tile,
body.theme-dark .surface,
body.theme-dark .table-card,
body.theme-dark .smart-panel,
body.theme-dark .settings-card,
body.theme-dark .template-preview-shell,
body.theme-dark .template-editor,
body.theme-dark .report-card,
body.theme-dark .commercial-card,
body.theme-dark .review-card,
body.theme-dark .empty-state,
body.theme-dark .modal {
  background: rgba(26, 27, 31, 0.72);
  border-color: var(--hair);
  box-shadow: 0 1px 0 rgba(255,255,255,0.055) inset, var(--shadow-soft);
}

body.theme-dark .workspace {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 34px 34px;
}

body.theme-dark .brand-block,
body.theme-dark .nav-button:hover,
body.theme-dark .mast-status span,
body.theme-dark .filter-row,
body.theme-dark .action-item,
body.theme-dark .tax-row,
body.theme-dark .locked-row,
body.theme-dark .timeline-row,
body.theme-dark .summary-tile,
body.theme-dark .setting-row,
body.theme-dark .setting-field,
body.theme-dark .asset-field,
body.theme-dark .layout-option,
body.theme-dark .setting-toggle,
body.theme-dark .suggestion-box,
body.theme-dark .sync-stat-grid > div,
body.theme-dark .order-command,
body.theme-dark .editor-card,
body.theme-dark .report-card button {
  background: rgba(44, 45, 51, 0.58);
  border-color: var(--hair);
  color: var(--ink);
}

body.theme-dark .nav-button {
  color: rgba(245,245,247,0.72);
}

body.theme-dark .nav-button small,
body.theme-dark .mast-status span,
body.theme-dark .report-card button span,
body.theme-dark .row-title small,
body.theme-dark .setting-field span,
body.theme-dark .asset-field small {
  color: var(--muted);
}

body.theme-dark .nav-button::before {
  background: rgba(255,255,255,0.06);
  border-color: var(--hair);
}

body.theme-dark .nav-button.active,
body.theme-dark .nav-button.active::before,
body.theme-dark .tab.active,
body.theme-dark .dark,
body.theme-dark .layout-option.selected,
body.theme-dark .segmented button.active,
body.theme-dark .setting-toggle.on,
body.theme-dark .report-card button.active {
  background: #f5f5f7;
  border-color: #f5f5f7;
  color: #0b0c0f;
  box-shadow: 0 16px 38px rgba(0,0,0,0.28);
}

body.theme-dark .layout-option.selected span,
body.theme-dark .setting-toggle.on strong,
body.theme-dark .report-card button.active span {
  color: rgba(11, 12, 15, 0.62);
}

body.theme-dark .ghost,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .tab,
body.theme-dark .chip,
body.theme-dark .segmented button {
  background: rgba(255,255,255,0.07);
  border-color: var(--hair);
  color: var(--ink);
}

body.theme-dark th {
  background: rgba(34, 35, 40, 0.96);
  color: rgba(245,245,247,0.72);
}

body.theme-dark tbody tr:hover {
  background: rgba(122, 183, 255, 0.07);
}

body.theme-dark .command-hero {
  background: linear-gradient(135deg, #17181d 0%, #101114 48%, #102a25 100%);
  box-shadow: 0 30px 90px rgba(0,0,0,0.44);
}

body.theme-dark .template-preview-canvas {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    #191a1f;
  background-size: 22px 22px;
}

body.theme-dark .quick-filter {
  background: rgba(255, 116, 107, 0.13);
  color: var(--red);
  border-color: rgba(255, 116, 107, 0.32);
}

body.theme-dark .quick-filter.active {
  background: var(--red);
  color: #0b0c0f;
}

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

@media (max-width: 1280px) {
  .metric-ribbon,
  .ledger-brief {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .template-workbench,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .template-preview-canvas .invoice-paper {
    zoom: 0.78;
  }
}

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

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

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

  .masthead,
  .command-hero,
  .smart-panel,
  .view-toolbar,
  .filter-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-card,
  .settings-card.wide,
  .settings-card.editable-settings.wide {
    grid-column: 1 / -1;
  }

  .brand-assets,
  .shopify-connect-grid,
  .order-edit-grid {
    grid-template-columns: 1fr;
  }

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

  .template-preview-canvas {
    min-height: 560px;
    overflow: auto;
  }
}

@media (max-width: 620px) {
  .view,
  .masthead {
    padding: 18px;
  }

  .command-hero {
    padding: 22px;
    border-radius: 24px;
  }

  h2 {
    font-size: 36px;
  }

  .metric-ribbon,
  .ledger-brief,
  .report-summary,
  .ca-pack-grid {
    grid-template-columns: 1fr;
  }

  .order-command {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .command-button {
    flex: 1 1 88px;
  }
}
