:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #edf6f3;
  --ink: #15211f;
  --muted: #66736f;
  --line: #dce7e3;
  --brand: #67baa8;
  --brand-dark: #2d8374;
  --brand-soft: #def1ed;
  --blue: #326b9f;
  --amber: #9b6a14;
  --rose: #e7b8b8;
  --red: #a84646;
  --shadow: 0 18px 42px rgba(34, 72, 64, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(103, 186, 168, 0.11), transparent 34%),
    radial-gradient(circle at top right, rgba(45, 131, 116, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
.file-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

button:hover,
.file-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(103, 186, 168, 0.18);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.login-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 33, 31, 0.46);
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(21, 33, 31, 0.24);
  padding: 20px;
}

.login-card h2,
.login-card p {
  margin: 0;
}

.login-card .eyebrow {
  color: var(--brand-dark);
}

.login-card p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #19312d, #234a43);
  color: #fff;
  border-bottom: 4px solid var(--brand);
}

.app-header h1,
.app-header p {
  margin: 0;
}

.app-header h1 {
  font-size: 1.4rem;
  letter-spacing: 0;
}

.eyebrow {
  color: #a9d8cf;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.session-status {
  min-height: 44px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #dcefea;
  font-size: 0.78rem;
  font-weight: 800;
}

.session-status span {
  overflow-wrap: anywhere;
}

.header-actions button,
.header-actions .file-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.file-button input {
  display: none;
}

.tools-trigger {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tools-trigger svg {
  width: 16px;
  height: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px;
}

.workspace {
  min-width: 0;
}

.panel-section,
.workspace {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
}

.panel-section {
  padding: 16px;
}

.panel-section.read-only {
  background: #fbfcfb;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(21, 33, 31, 0.32);
}

.task-drawer,
.tools-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  box-shadow: -18px 0 40px rgba(21, 33, 31, 0.18);
  animation: drawer-slide-in 180ms ease-out;
}

.task-drawer {
  width: min(100%, 460px);
}

.tools-drawer {
  width: min(100%, 360px);
}

.task-drawer .panel-section,
.tools-drawer .panel-section {
  box-shadow: none;
}

.drawer-open {
  overflow: hidden;
}

.log-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(21, 33, 31, 0.36);
}

.log-card {
  width: min(100%, 42rem);
  max-height: min(82vh, 42rem);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(21, 33, 31, 0.24);
}

.log-card > .section-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.log-list {
  overflow-y: auto;
  padding: 12px 16px 16px;
}

.log-event {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.log-event:last-child {
  border-bottom: 0;
}

.log-event strong,
.log-event span,
.log-event p,
.log-event time {
  display: block;
}

.log-event span,
.log-event p,
.log-event time,
.log-empty {
  color: var(--muted);
}

.log-event p {
  margin-top: 4px;
}

.log-event time {
  font-weight: 800;
}

.log-empty {
  padding: 20px 0;
}

@media (min-width: 768px) {
  .log-modal {
    align-items: center;
    padding: 24px;
  }

  .log-event {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

@keyframes drawer-slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tools-panel {
  min-height: 100%;
}

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

.tool-action {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  font-weight: 900;
}

.tool-action:hover,
.tool-action:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.tool-action svg {
  width: 18px;
  height: 18px;
  color: var(--brand-dark);
}

.section-heading,
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.view-toolbar > div:first-child {
  min-width: 0;
}

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

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.95rem;
}

.section-heading p,
.view-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.panel-section form,
.panel-section {
  display: grid;
  gap: 12px;
}

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

.hidden {
  display: none !important;
}

.sizes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.inline-actions button {
  min-height: 44px;
  padding: 0 9px;
  font-size: 0.78rem;
}

.size-lines,
.daily-lines {
  display: grid;
  gap: 8px;
}

.size-line,
.daily-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfdfc;
}

.size-line button,
.daily-line button {
  padding: 0 10px;
  grid-column: 1 / -1;
}

.primary-action {
  width: 100%;
  border-color: var(--brand-dark);
  background: var(--brand);
  color: #10221e;
  font-weight: 850;
}

.primary-action:hover {
  background: #5ab09f;
  color: #0f201d;
}

.workspace {
  padding: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  background: var(--surface-2);
  font-weight: 850;
}

.tab.active {
  border-color: var(--brand-dark);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.quick-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 10px;
}

.quick-filters button {
  min-width: 150px;
  border-color: var(--brand-dark);
  color: var(--brand-dark);
  font-weight: 850;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.metrics span {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.metrics p,
.empty-state p,
.meta-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.annual-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -4px 0 16px;
  border: 1px solid #bfe2da;
  border-radius: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef9f6, #ffffff);
}

.annual-strip div {
  display: grid;
  gap: 2px;
}

.annual-strip div:last-child {
  text-align: right;
}

.annual-strip span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.annual-strip strong {
  color: var(--brand-dark);
  font-size: 1rem;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.4fr) minmax(260px, 1fr);
  gap: 10px;
  margin: -2px 0 16px;
}

.insight-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.insight-card > div:first-child {
  display: grid;
  gap: 2px;
}

.insight-card > div:first-child > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.insight-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.insight-title svg {
  width: 18px;
  height: 18px;
  color: var(--brand-dark);
  flex: 0 0 auto;
}

.donut-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.chart-canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 136px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.compact-donut {
  width: 108px;
  min-height: 108px;
}

.chart-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  pointer-events: none;
  text-align: center;
}

.chart-center svg {
  width: 15px;
  height: 15px;
  color: var(--brand-dark);
}

.chart-center strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
}

.chart-center span {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.1;
  text-transform: none;
}

.chart-legend {
  display: grid;
  gap: 7px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
  font-size: 0.78rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.alert-dot {
  background: var(--rose);
}

.done-dot {
  background: var(--brand-dark);
}

.bar-chart {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.simple-load-summary svg,
.simple-method-count svg,
.pressure-row svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.simple-load-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.simple-load-summary span {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfa;
  color: var(--muted);
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 850;
}

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

.simple-load-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.simple-load-card {
  width: 100%;
  min-width: 0;
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 5rem;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: #f8fbfa;
  padding: 8px 10px;
  text-align: left;
}

.simple-load-card:hover,
.simple-load-card:focus-visible {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}

.simple-load-card.has-load {
  border-color: rgba(45, 131, 116, 0.38);
  background: linear-gradient(180deg, #ffffff, #eef8f5);
}

.simple-load-date {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 2px;
  line-height: 1;
}

.simple-load-date span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.simple-load-date strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.simple-load-total {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.simple-load-total strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.simple-load-main {
  width: 100%;
  min-width: 0;
  display: block;
}

.simple-methods {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.simple-method-count {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  text-align: left;
}

.simple-method-count span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
}

.simple-method-count strong {
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1;
  justify-self: end;
  white-space: nowrap;
}

.printing-count {
  border-color: rgba(50, 107, 159, 0.24);
  background: rgba(50, 107, 159, 0.06);
}

.embroidery-count {
  border-color: rgba(155, 106, 20, 0.24);
  background: rgba(155, 106, 20, 0.07);
}

.printing-count svg {
  color: var(--blue);
}

.embroidery-count svg {
  color: var(--amber);
}

.pressure-list {
  display: grid;
  gap: 8px;
}

.pressure-row {
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
  padding: 7px;
  justify-content: stretch;
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(60px, 0.8fr) auto;
  gap: 8px;
}

.pressure-copy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  text-align: left;
  text-transform: none;
}

.pressure-copy > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pressure-copy svg {
  color: var(--red);
  margin-top: 1px;
}

.pressure-row strong {
  font-size: 0.78rem;
}

.pressure-row small {
  color: var(--muted);
  font-size: 0.68rem;
}

.pressure-track {
  height: 7px;
  border-radius: 999px;
  background: #e8eeee;
  align-self: center;
  overflow: hidden;
}

.pressure-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--amber));
}

.pressure-row em {
  color: var(--ink);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  align-self: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.order-list,
.day-list {
  display: grid;
  gap: 10px;
}

.procurement-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.procurement-table table {
  width: 100%;
  min-width: 62rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.procurement-table .order-date-col {
  width: 6.25rem;
}

.procurement-table .product-info-col {
  width: 28%;
}

.procurement-table .production-col {
  width: 5.5rem;
}

.procurement-table .purchase-status-col,
.procurement-table .production-status-col {
  width: 7rem;
}

.procurement-table .pickup-date-col {
  width: 6.25rem;
}

.procurement-table .payment-col {
  width: 9.5rem;
}

.procurement-table .actions-col {
  width: 12rem;
}

.procurement-table th,
.procurement-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.82rem;
}

.procurement-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2f7f5;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.procurement-table tr:last-child td {
  border-bottom: 0;
}

.procurement-table select {
  width: 6.25rem;
  min-width: 0;
  min-height: 38px;
  padding: 5px 7px;
  font-size: 0.78rem;
}

.date-cell {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.date-main {
  white-space: nowrap;
}

.date-weekday {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.table-title {
  font-size: 0.9rem;
  font-weight: 900;
}

.table-detail,
.table-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.table-note {
  color: var(--blue);
}

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

.table-actions button {
  min-height: 44px;
  padding: 0 8px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.payment-summary {
  display: grid;
  gap: 4px;
  align-content: start;
  max-width: 8.5rem;
}

.payment-headline {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1;
  white-space: nowrap;
}

.payment-status-label {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
}

.payment-summary.alert .payment-status-label {
  background: #fae7e7;
  color: var(--red);
}

.payment-summary.purchase .payment-status-label {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.payment-breakdown {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  color: var(--muted);
}

.payment-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.payment-breakdown dt,
.payment-breakdown dd {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.2;
}

.payment-breakdown dd {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

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

.add-order-shortcut {
  min-width: 132px;
  border-color: var(--brand-dark);
  color: var(--brand-dark);
  font-weight: 850;
}

.status-ownership-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.status-ownership-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid #d8e9e4;
  border-radius: 999px;
  padding: 0 9px;
  white-space: nowrap;
}

.status-ownership-strip strong {
  color: var(--ink);
}

.table-footer-action {
  border-top: 1px solid var(--line);
  padding: 10px;
  background: #fbfdfc;
}

.status-cell {
  position: relative;
}

.ordered-row,
.completed-row {
  background: #f5f6f5;
  color: #707b77;
}

.ordered-row .table-title,
.ordered-row .table-detail,
.completed-row .table-title,
.completed-row .table-detail {
  text-decoration: line-through;
  text-decoration-color: #111;
  text-decoration-thickness: 1px;
}

.day-order {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.day-order.completed {
  background: #f0f3f1;
  color: #74817d;
}

.day-order.completed::after {
  content: none;
}

.day-order.completed h3,
.day-order.completed .meta-line {
  text-decoration: line-through;
  text-decoration-color: #111;
  text-decoration-thickness: 1px;
  text-decoration-skip-ink: auto;
}

.order-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  align-items: start;
}

.order-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
}

.method-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.production-summary {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.production-quantity {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.pill.printing {
  background: #e8f1ff;
  color: var(--blue);
}

.pill.embroidery {
  background: #fff2d9;
  color: var(--amber);
}

.pill.purchase,
.pill.task-type {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pill.alert {
  background: #fae7e7;
  color: var(--red);
}

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

.compact-actions {
  align-items: end;
}

.compact-actions label {
  min-width: 132px;
  position: relative;
}

.sparkle-burst {
  position: absolute;
  right: 8px;
  top: -18px;
  color: #111;
  font-size: 1rem;
  font-weight: 900;
  pointer-events: none;
  animation: sparkle-pop 1s ease-out both;
}

@keyframes sparkle-pop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.7);
  }
  35% {
    opacity: 1;
    transform: translateY(-3px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.92);
  }
}

.weekday-grid,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.weekday-grid {
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.month-grid {
  gap: 8px;
}

.month-cell {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 7px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.month-cell:hover,
.month-cell:focus-visible {
  border-color: var(--brand);
  background: #fbfffd;
  box-shadow: 0 8px 18px rgba(34, 78, 69, 0.1);
  outline: none;
}

.month-cell.has-work {
  border-color: #cfe3de;
}

.month-cell.today {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.cell-date {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.month-cell.has-work .cell-date span:last-child {
  color: var(--brand-dark);
}

.load-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 6px 7px;
  background: var(--surface-2);
  font-size: 0.78rem;
}

.muted-line {
  background: #f3f6f5;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.week-day {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.week-day.today {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--brand);
  background: #fbfffd;
}

.week-day.today h3 {
  color: var(--brand-dark);
}

.week-day h3 {
  margin-bottom: 8px;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 3px solid var(--brand);
  padding: 8px 8px 8px 10px;
  background: #f7fbfa;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}

.todo-item.completed {
  color: #75807c;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  background: #f0f3f1;
}

.date-picker {
  max-width: 210px;
}

.task-section {
  display: grid;
  gap: 9px;
}

.task-section + .task-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-section h3 {
  color: var(--brand-dark);
}

.task-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  margin-top: 7px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(103, 186, 168, 0.15);
}

.task-dot.embroidery {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(155, 106, 20, 0.13);
}

.task-dot.printing {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(50, 107, 159, 0.13);
}

.share-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #b8ddd5;
  background: #edf8f5;
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.share-notice.hidden {
  display: none;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  background: #fbfdfc;
}

@media (max-width: 1100px) {
  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .app-header,
  .view-toolbar,
  .order-top {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .app-header {
    padding: 18px;
  }

  .header-actions,
  .order-actions {
    justify-content: stretch;
  }

  .session-status {
    max-width: none;
    justify-content: space-between;
  }

  .header-actions > *,
  .order-actions > * {
    flex: 1 1 140px;
  }

  .app-shell {
    padding: 12px;
  }

  .metrics,
  .insight-grid,
  .quick-filters {
    grid-template-columns: 1fr;
  }

  .insight-card.wide {
    grid-column: auto;
  }

  .annual-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .annual-strip div:last-child {
    text-align: left;
  }

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

  .bar-chart {
    overflow-x: visible;
    grid-template-columns: 1fr;
  }

  .simple-load-card {
    grid-template-columns: 3.4rem minmax(0, 1fr) 4.4rem;
    gap: 8px;
    padding: 8px;
  }

  .simple-method-count {
    gap: 5px;
    padding: 5px 6px;
  }

  .pressure-row {
    grid-template-columns: 1fr;
  }

  .size-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .size-line button {
    grid-column: 1 / -1;
  }

  .weekday-grid,
  .month-grid {
    grid-template-columns: repeat(7, minmax(86px, 1fr));
    overflow-x: auto;
  }
}
