:root {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a;
  background-color: #f6f6f6;
  --surface: #ffffff;
  --surface-alt: #f1f1f1;
  --border: #e1e1e1;
  --muted: #757575;
  --accent: #ff7a18;
  --accent-strong: #d86105;
  --accent-soft: #ffe0c5;
  --danger: #c92c4b;
  --shadow: 0 14px 32px rgb(0 0 0 / 0.12);
  --page-gutter: clamp(1rem, 5vw, 3rem);
  --content-max: 1300px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #fafafa, #f1f1f1 60%);
  color: inherit;
  display: flex;
  flex-direction: column;
}

.hero {
  background: linear-gradient(140deg, #0f0f0f, #2b2b2b);
  color: #fff;
  padding: 2.75rem var(--page-gutter) 2rem;
}

.hero h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero__content {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__titles h1 {
  margin: 0;
}

.hero__subtitle {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.hero__logout {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.5rem 0;
  flex-shrink: 0;
}

.hero__logout:hover {
  color: #fff;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  opacity: 0.75;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.app-nav {
  margin-top: -1.35rem;
  padding: 0 var(--page-gutter);
  position: relative;
  z-index: 20;
}

.app-nav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight: 650;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.nav-dropdown__trigger:hover {
  border-color: #ffc089;
  color: #000;
}

.nav-dropdown.is-open > .nav-dropdown__trigger,
.nav-dropdown.has-active > .nav-dropdown__trigger {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 122, 24, 0.28);
}

.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
  margin-left: 0.15rem;
  transition: transform 0.15s ease;
}

.nav-dropdown.is-open .nav-caret {
  transform: rotate(180deg);
}

.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 240px;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.14);
  z-index: 30;
}

.nav-dropdown.is-open > .nav-dropdown__menu {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--accent-soft);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.nav-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-section-badge {
  position: static;
  transform: none;
  margin-left: 0.15rem;
}

.nav-dropdown.has-active .nav-section-badge,
.nav-dropdown.is-open .nav-section-badge,
.nav-tab.active .nav-section-badge {
  border-color: #fff;
}

.nav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 122, 24, 0.28);
}

.nav-item .tab-badge {
  position: static;
  transform: none;
  margin-left: auto;
}

.tab-badge {
  display: none;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #e41e3f;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 10px rgba(228, 30, 63, 0.45);
  pointer-events: none;
}

.tab-badge.is-visible {
  display: inline-flex;
}

.main {
  padding: clamp(1.5rem, 6vw, 3rem) var(--page-gutter) 3rem;
  min-height: calc(100vh - 220px);
  flex: 1;
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #111;
  color: rgba(255, 255, 255, 0.82);
}

.app-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.85rem var(--page-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.app-footer__history {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.app-footer__history:hover,
.app-footer__history.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.app-footer__clock {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.app-footer__version {
  margin: 0 0 0 auto;
  font-size: 0.85rem;
  opacity: 0.7;
}

@media (max-width: 800px) {
  .app-nav__inner {
    flex-direction: column;
  }

  .nav-dropdown,
  .nav-dropdown__trigger,
  .nav-tab {
    width: 100%;
  }

  .nav-dropdown__menu {
    position: static;
    margin-top: 0.35rem;
    box-shadow: none;
  }

  .app-footer__version {
    margin-left: 0;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-wide {
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  max-width: var(--content-max);
  margin: 0 auto 2rem;
  border: 1px solid var(--border);
}

.panel-wide--crm {
  max-width: 1700px;
}

#crm-search {
  flex: 1 1 300px;
  min-width: 240px;
}

@media (min-width: 900px) {
  .material-row.crm-row {
    display: grid;
    grid-template-columns:
      minmax(220px, 1.8fr)
      minmax(170px, 1fr)
      minmax(220px, 1.4fr)
      minmax(90px, 0.6fr)
      minmax(130px, 0.8fr)
      minmax(130px, 0.8fr)
      minmax(190px, 1.1fr)
      minmax(145px, auto);
    align-items: center;
  }
}

.crm-status-pill {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-weight: 700;
  font-size: 0.84rem;
  background: #f2f4f7;
  color: #3f3f46;
  width: 100%;
}

.crm-status-pill--not_contacted {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.crm-status-pill--email_sent {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.crm-status-pill--replied {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.crm-status-pill--meeting_scheduled {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.crm-status-pill--won {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.crm-status-pill--lost {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.crm-row.crm-row--not_contacted {
  background: #ffffff;
}

.crm-row.crm-row--email_sent {
  background: #f8fbff;
}

.crm-row.crm-row--replied {
  background: #f9f9ff;
}

.crm-row.crm-row--meeting_scheduled {
  background: #f7fff9;
}

.crm-row.crm-row--won {
  background: #f2fff5;
  border-color: #b7e4c7;
}

.crm-row.crm-row--lost {
  background: #fff7f7;
  border-color: #f1c7c7;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.panel-subheader {
  margin: 1.5rem 0 0.5rem;
}

.panel-subheader h3 {
  margin: 0;
}

.warehouse-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.label-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.label-toolbar__selection,
.label-toolbar__cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  background: var(--surface-alt);
}

input[type='file'] {
  padding: 0.35rem 0;
  background: transparent;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  background: #fff;
}

#material-search {
  flex: 1 1 260px;
  min-width: 200px;
}

.primary {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.7rem 1.35rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(255, 122, 24, 0.25);
  background: var(--accent-strong);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 0.75rem;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.primary.ghost {
  background: rgba(255, 122, 24, 0.08);
  color: var(--accent);
  border: none;
}

.ghost.danger {
  border-color: rgba(201, 44, 75, 0.3);
  color: var(--danger);
}

.ghost.danger:hover {
  background: rgba(201, 44, 75, 0.08);
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #1a1a1a;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pill[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent);
}

.counter-pill {
  background: var(--surface);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
}

.material-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.material-list .material-row {
  overflow: visible;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.04);
  overflow: hidden;
}

.material-list .material-row--alert {
  border-color: rgba(201, 44, 75, 0.45);
  background: #fff1f2;
}

.material-list .material-row--pending-order {
  border-color: rgba(194, 65, 12, 0.4);
  background: #fff7ed;
}

.material-list .material-row--ordered-status {
  border-color: rgba(31, 115, 183, 0.45);
  background: #f0f4ff;
}

.material-row--selected {
  border-color: rgba(255, 122, 24, 0.6);
  box-shadow: 0 6px 20px rgba(255, 122, 24, 0.15);
}

.material-list .material-row--selected.material-row--alert {
  background: #fff1f2;
}

.material-list .material-row--selected.material-row--pending-order {
  background: #fff7ed;
}

.material-list .material-row--selected.material-row--ordered-status {
  background: #f0f4ff;
}

.material-row--empty {
  display: flex;
  justify-content: center;
  color: var(--muted);
}

.material-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.material-select input {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
}

.material-thumb {
  width: 56px;
  height: 56px;
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--surface-alt);
  flex: 0 0 auto;
  position: relative;
}

.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.material-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  white-space: nowrap;
}

.material-cell--name {
  min-width: 200px;
  flex: 1 1 auto;
  overflow: hidden;
}

.material-list .material-cell--qty {
  min-width: 7.5rem;
  max-width: 9.5rem;
  flex: 0 1 9.5rem;
  align-items: flex-start;
  text-align: left;
  white-space: normal;
  overflow: visible;
}

.material-cell--qty {
  min-width: 160px;
  align-items: flex-start;
  text-align: left;
}

.material-list .material-cell--location {
  min-width: 140px;
  max-width: 200px;
  flex: 1 1 160px;
}

.material-cell--location {
  min-width: 160px;
  max-width: 220px;
  align-items: flex-start;
  text-align: left;
}

.material-list .material-cell--notes {
  flex: 1 1 180px;
  max-width: 280px;
}

.material-cell--notes {
  flex: 1 1 220px;
  max-width: 320px;
  overflow: hidden;
  align-items: flex-start;
  text-align: left;
}

.material-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.material-value {
  font-weight: 600;
  color: #1f1f1f;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-title {
  font-weight: 600;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-sub {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-sub--meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.supplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  color: #444;
  font-size: 0.78rem;
}

.supplier-badge img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: contain;
  padding: 1px;
  background: #fff;
}

.supplier-badge--empty {
  opacity: 0.75;
}

.country-badge {
  display: inline-flex;
  align-items: center;
}

.country-badge img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border: 1px solid #d8d8d8;
  border-radius: 2px;
}

.country-badge--empty {
  color: #999;
  font-size: 0.8rem;
}

.material-value--qty {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.material-list .material-qty-with-tip {
  cursor: help;
  text-decoration: underline dotted rgba(31, 31, 31, 0.35);
  text-underline-offset: 0.2em;
}

.material-list .material-order-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 0.2rem;
  max-width: 100%;
}

.material-pending-order,
.material-ordered {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.material-list .material-pending-order {
  background: rgba(255, 255, 255, 0.65);
  color: #9a3412;
  border: 1px solid rgba(194, 65, 12, 0.25);
}

.material-list .material-ordered {
  background: rgba(255, 255, 255, 0.65);
  color: #1f73b7;
  border: 1px solid rgba(31, 115, 183, 0.25);
}

.material-pending-order {
  background: #fff7ed;
  color: #c2410c;
}

.material-ordered {
  background: #f0f4ff;
  color: #1f73b7;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.badge--warning {
  background: #fff1f2;
  border-color: rgba(201, 44, 75, 0.4);
  color: var(--danger);
}

.material-actions {
  display: inline-flex;
  gap: 0.3rem;
  margin-left: auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.material-actions button {
  width: auto;
  padding: 0.45rem 0.9rem;
}

.material-actions .icon-only {
  width: 34px;
  min-width: 34px;
  padding: 0.3rem;
  text-align: center;
}

.material-actions .primary {
  padding-left: 1rem;
  padding-right: 1rem;
}

.material-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (min-width: 721px) {
  .material-row {
    display: grid;
    grid-template-columns:
      minmax(32px, 0.4fr)
      auto
      minmax(150px, 2fr)
      minmax(70px, 0.7fr)
      minmax(90px, 0.9fr)
      minmax(110px, 1.1fr)
      minmax(160px, auto);
    align-items: center;
  }

  .material-list .material-row {
    grid-template-columns:
      minmax(32px, 0.35fr)
      auto
      minmax(140px, 1.65fr)
      minmax(7.5rem, 9.5rem)
      minmax(140px, 1fr)
      minmax(150px, 1.15fr)
      minmax(168px, auto);
    align-items: center;
    column-gap: 0.75rem;
  }

  .material-actions {
    margin-left: 0;
    justify-self: end;
  }
}

.pagination {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pagination .pager-buttons {
  display: flex;
  gap: 0.5rem;
}

.pagination button {
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0.5rem 1.15rem;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 20, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal__content {
  background: #fff;
  border-radius: 1rem;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.modal__content--wide {
  width: min(900px, 100%);
}

.modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.adjust-identity {
  align-items: center;
}

.adjust-identity img {
  width: 56px;
  height: 56px;
  border-radius: 0.75rem;
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.icon-button {
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.inline-field {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.inline-field select {
  flex: 1 1 auto;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.full-width {
  grid-column: 1 / -1;
}

#material-form.editing [data-create-only] {
  display: none;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

#timesheet-employee-delete {
  margin-right: auto;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 1.2rem;
  font-size: 0.9rem;
}

.stock-backup-history {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.stock-backup-history h4 {
  margin: 0 0 0.75rem;
}

.stock-backup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stock-backup-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--surface-alt);
}

.stock-backup-item__meta {
  min-width: 0;
}

.stock-backup-item__meta strong {
  display: block;
}

.stock-backup-item__note {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.stock-backup-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.stock-backup-item__actions a.ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.inventory-preview {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inventory-preview__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inventory-preview__table-wrap {
  max-height: min(60vh, 720px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.inventory-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.inventory-preview th,
.inventory-preview td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #eceef3;
  text-align: left;
}

.inventory-preview th:not(:first-child),
.inventory-preview td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.inventory-preview thead th {
  position: sticky;
  top: 0;
  background: #fafbfd;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666d80;
}

.inventory-delta--up {
  color: #1f9254;
}

.inventory-delta--down {
  color: var(--danger);
}

.inventory-missing {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.adjust-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.adjust-form .form-actions {
  margin-top: 0.15rem;
}

.adjust-form textarea {
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0;
}

.adjust-highlight {
  grid-column: 1 / -1;
  background: var(--surface-alt);
  border-radius: 0.8rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.adjust-highlight-ordered {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--muted);
}

.adjust-highlight-ordered strong {
  color: #1a5fb4;
  font-weight: 700;
}

.adjust-mode {
  display: inline-flex;
  gap: 0.5rem;
  grid-column: 1 / -1;
}

.mode {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 0.45rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.mode:not(.active) {
  opacity: 0.55;
}

.mode.mode-add {
  border-color: rgba(16, 152, 73, 0.4);
  color: #14903c;
}

.mode.mode-add.active {
  background: rgba(20, 144, 60, 0.12);
  color: #0e6d2d;
  border-color: rgba(14, 109, 45, 0.6);
}

.mode.mode-subtract {
  border-color: rgba(191, 55, 55, 0.4);
  color: #c02626;
}

.mode.mode-subtract.active {
  background: rgba(192, 38, 38, 0.12);
  color: #8f1717;
  border-color: rgba(143, 23, 23, 0.6);
}

.adjust-form .form-actions {
  margin-top: 0.15rem;
}

.adjust-log {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

#adjust-log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.adjust-log-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.adjust-log-item strong {
  color: var(--danger);
}

.blueprint-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.blueprint-list.empty {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  color: var(--muted);
}

.blueprint-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--surface-alt);
}

.blueprint-card h3 {
  margin: 0 0 0.35rem;
}

.blueprint-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
}

.blueprint-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.history-item__action {
  font-weight: 700;
  color: #1f1f1f;
}

.history-item__details {
  color: var(--muted);
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.history-item__time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.procurement-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.procurement-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.procurement-row--selected {
  border-color: rgba(255, 122, 24, 0.7);
  background: #fff8ef;
}

.procurement-row--ordered {
  opacity: 0.65;
  background: #efefef;
}

.procurement-material-row {
  width: 100%;
}

.procurement-material-row .material-cell {
  white-space: normal;
}

@keyframes procurement-negative-pulse {
  0%,
  100% {
    border-color: rgba(201, 44, 75, 0.45);
    box-shadow: 0 0 0 0 rgba(201, 44, 75, 0.15);
  }

  50% {
    border-color: rgba(201, 44, 75, 0.95);
    box-shadow: 0 0 0 5px rgba(201, 44, 75, 0.2);
  }
}

.procurement-row--negative-stock {
  border-color: rgba(201, 44, 75, 0.7) !important;
  animation: procurement-negative-pulse 1.6s ease-in-out infinite;
}

.material-value--negative {
  color: #c42c4b;
}

.material-actions--procurement {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

button.procurement-delete.ghost.icon-only,
button.ghost.icon-only.procurement-delete {
  color: #8c8c8c;
  border-color: transparent;
  font-size: 0.95rem;
  line-height: 1;
}

button.procurement-delete.ghost.icon-only:hover,
button.ghost.icon-only.procurement-delete:hover {
  color: var(--danger);
  background: rgba(201, 44, 75, 0.06);
}

@media (min-width: 721px) {
  .material-row.procurement-material-row:not(.procurement-material-row--ordered) {
    grid-template-columns:
      minmax(32px, 0.35fr)
      auto
      minmax(140px, 1.8fr)
      minmax(90px, 0.88fr)
      minmax(72px, 0.7fr)
      minmax(150px, 1.05fr)
      minmax(105px, 0.95fr)
      minmax(105px, 1fr)
      minmax(185px, auto);
  }

  .material-row.procurement-material-row--ordered {
    grid-template-columns:
      auto
      minmax(112px, 1.25fr)
      minmax(88px, 0.75fr)
      minmax(70px, 0.62fr)
      minmax(125px, 0.88fr)
      minmax(95px, 0.85fr)
      minmax(100px, 0.95fr)
      minmax(95px, 0.95fr)
      minmax(40px, auto);
    align-items: center;
  }
}

.material-select--placeholder {
  width: 1.15rem;
  height: 1.15rem;
}

.procurement-material-row .material-actions .primary.success {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.procurement-notes-cell {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.procurement-notes-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  resize: vertical;
  min-height: 2.6rem;
}

.procurement-material-row .material-cell--material-mag-notes .material-value,
.procurement-material-row .material-cell--procurement-pos-notes .material-value {
  white-space: normal;
  word-break: break-word;
}

.procurement-material-row .material-cell--stock {
  min-width: 72px;
}

.procurement-mark-ordered-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  margin: 0.5rem 0 0.75rem;
}

.procurement-mark-row {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.procurement-mark-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.procurement-mark-row input[type='number'] {
  max-width: 12rem;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.order-card--completed {
  background: #f7f7f7;
}

.order-card__header {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(220px, 0.6fr);
  align-items: start;
  gap: 0.6rem 1rem;
  margin-bottom: 0.2rem;
}

.order-card__header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.order-card__meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.8rem;
  width: 100%;
}

.order-card__meta-grid > div {
  grid-column: 1 / -1;
}

.order-status {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0.05rem 0;
}

.order-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.order-details {
  width: 100%;
}

.order-details summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #3a3a3a;
  user-select: none;
  margin-bottom: 0.2rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0;
}

.order-item__thumb {
  width: 28px;
  height: 28px;
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--surface-alt);
  flex: 0 0 auto;
}

.order-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-item__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.order-item__meta strong {
  display: block;
  font-size: 0.84rem;
}

.order-item__meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.order-item__qty {
  font-weight: 600;
  font-size: 0.8rem;
  color: #1f1f1f;
  flex: 0 0 auto;
  text-align: right;
}

.order-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-top: 0.2rem;
}

.order-actions .ghost,
.order-actions .primary {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.customer-orders-view {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}

.customer-orders-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  background: #f8f9fc;
}

.customer-orders-stat {
  border: 1px solid #dde2ee;
  border-radius: 0.55rem;
  background: #fff;
  text-align: left;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.customer-orders-stat:hover {
  transform: translateY(-1px);
  border-color: #cfd7eb;
}

.customer-orders-stat--active {
  border-color: #7f56d9;
  box-shadow: 0 0 0 1px #7f56d9 inset;
}

.customer-orders-stat__label {
  display: block;
  font-size: 0.7rem;
  color: #5c6070;
}

.customer-orders-stat__value {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.92rem;
  color: #111827;
}

.customer-orders-toolbar {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.customer-orders-toolbar__main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.customer-orders-toolbar__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

.customer-orders-month-field {
  margin: 0;
}

.customer-orders-month-select {
  margin: 0;
  padding: 0.38rem 0.55rem;
  font-size: 0.82rem;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  background: #fff;
  color: #131823;
  min-width: 11rem;
}

.customer-orders-month-total {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #4b5563;
  white-space: nowrap;
}

.customer-orders-month-total__label::after {
  content: ':';
}

.customer-orders-month-total__value {
  font-size: 0.92rem;
  color: #111827;
}

.customer-orders-commission-btn {
  font-size: 0.8rem;
  padding: 0.38rem 0.7rem;
  white-space: nowrap;
}

.commission-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.commission-summary__card {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  background: #fafbfd;
}

.commission-summary__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.commission-summary__value {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.commission-rate-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.65rem;
}

.commission-rate-field label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #4b5563;
  margin: 0;
}

.commission-rate-input {
  width: 9rem;
  margin: 0;
  padding: 0.38rem 0.55rem;
  font-size: 0.84rem;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.commission-rate-note {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.8rem;
  color: #4b5563;
  align-self: center;
}

.commission-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.commission-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.commission-table th,
.commission-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #eceef3;
  text-align: left;
  vertical-align: middle;
}

.commission-table th:not(:first-child),
.commission-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.commission-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #666d80;
  background: #fafbfd;
}

.commission-table tfoot td {
  font-weight: 700;
  border-top: 2px solid #d8dce6;
  border-bottom: none;
}

.commission-table tbody tr:last-child td {
  border-bottom: 1px solid #d8dce6;
}

.customer-orders-search {
  width: min(420px, 100%);
  flex: 1 1 200px;
  background: #fff;
}

.customer-orders-table-wrap {
  overflow-x: auto;
}

.customer-orders-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.customer-orders-table thead th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #666d80;
  background: #fafbfd;
}

.customer-orders-table tbody td {
  padding: 0.52rem 0.65rem;
  border-bottom: 1px solid #eceef3;
  vertical-align: middle;
}

.customer-orders-table th:nth-child(1),
.customer-orders-table td:nth-child(1) {
  width: 104px;
  padding-right: 0.35rem;
}

.customer-orders-table th:nth-child(2),
.customer-orders-table td:nth-child(2) {
  width: 114px;
  padding-left: 0.35rem;
  padding-right: 0.4rem;
}

.customer-orders-created,
.customer-orders-dates {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
}

.customer-orders-dates {
  display: flex;
  flex-direction: column;
  gap: 5px;
  white-space: nowrap;
}

.customer-orders-dates__line {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.customer-orders-dates__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  flex-shrink: 0;
  font-size: 0.7rem;
  opacity: 0.75;
}

.customer-orders-order-cell {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  min-width: 0;
}

.customer-orders-order-number,
.customer-orders-primary {
  margin: 0;
  font-weight: 600;
  color: #131823;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-orders-order-meta,
.customer-orders-secondary {
  margin: 0.08rem 0 0;
  color: #6b7280;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-orders-customer-cell {
  position: relative;
}

.customer-orders-address-hover {
  position: absolute;
  left: 0.8rem;
  top: calc(100% - 0.2rem);
  min-width: 260px;
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 4;
}

.customer-orders-customer-hover__block + .customer-orders-customer-hover__block {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.customer-orders-hover-label {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.1rem;
}

.customer-orders-customer-cell:hover .customer-orders-address-hover {
  opacity: 1;
  transform: translateY(0);
}

.customer-orders-value-cell {
  position: relative;
}

.customer-orders-value-hover {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% - 0.2rem);
  min-width: 280px;
  max-width: min(420px, 85vw);
  background: #111827;
  color: #fff;
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.customer-orders-value-cell:hover .customer-orders-value-hover {
  opacity: 1;
  transform: translateY(0);
}

.customer-orders-value-hover__line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.22rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.customer-orders-value-hover__line:last-child {
  border-bottom: none;
}

.customer-orders-value-hover__line--shipping {
  opacity: 0.92;
  font-style: italic;
}

.customer-orders-value-hover__name {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  white-space: normal;
}

.customer-orders-value-hover__meta {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
}

.customer-orders-empty {
  padding: 1.2rem 0.8rem !important;
  text-align: center;
  color: var(--muted);
}

.customer-orders-actions {
  display: inline-flex;
  gap: 0.3rem;
}

.customer-orders-actions .icon-only {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0.2rem;
  border-radius: 0.55rem;
  line-height: 1;
}

.customer-order-print-btn--pending {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.customer-order-print-btn--pending:hover {
  background: #e9ebef;
}

.customer-order-print-btn--done {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.3);
}

.customer-order-print-btn--done:hover {
  background: #d1fae5;
}

.payment-pill--toggle {
  border: 1px solid transparent;
  cursor: pointer;
}

.payment-pill--toggle:hover {
  filter: brightness(0.98);
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.payment-pill--pending {
  background: #ffe7ea;
  color: #b42335;
  border: 1px solid #f2b3bc;
}

.payment-pill--paid {
  background: #fff4dd;
  color: #9a6700;
  border: 1px solid #f3d39a;
}

.payment-pill--sent {
  background: #e5f6e9;
  color: #17692c;
  border: 1px solid #b8e3c4;
}

.invoice-pill {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.25rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.invoice-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding-right: 0.25rem;
}

.invoice-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.invoice-stack--primary {
  gap: 0.28rem;
}

.invoice-stack-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.invoice-more-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

.customer-orders-invoice-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.customer-orders-invoices-hover {
  position: absolute;
  left: 0;
  top: calc(100% - 0.15rem);
  min-width: 220px;
  max-width: min(380px, 92vw);
  background: #111827;
  color: #fff;
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.customer-orders-invoices-hover .invoice-pill--ready {
  background: rgba(255, 255, 255, 0.12);
  color: #e8fff0;
  border-color: rgba(255, 255, 255, 0.22);
}

.customer-orders-invoices-hover .invoice-pill--delete {
  color: #fca5a5;
}

.customer-orders-invoice-wrap:hover .customer-orders-invoices-hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.invoice-pill--create {
  background: #e7f0ff;
  color: #1e5bb8;
  border-color: #b7cdf3;
}

.invoice-pill--ready {
  background: #e6f6ea;
  color: #1a7f37;
  border-color: #b8e3c4;
}

.invoice-pill--delete {
  background: transparent;
  color: #b42335;
  border-color: transparent;
  padding: 0 0.2rem;
  min-width: 16px;
  line-height: 1;
  font-size: 0.95rem;
}

.customer-orders-invoices-download-btn {
  font-size: 0.8rem;
  padding: 0.38rem 0.7rem;
  white-space: nowrap;
}

.customer-orders-table th:nth-child(4),
.customer-orders-table td:nth-child(4) {
  width: 52px;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.customer-orders-ksef-cell {
  text-align: center;
}

.ksef-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.ksef-indicator--success {
  color: #137a3a;
  background: #e8f7ee;
}

.ksef-indicator--pending {
  color: #9a6700;
  background: #fff7df;
}

.ksef-indicator--error {
  color: #b42335;
  background: #fdecef;
}

.ksef-indicator--empty {
  color: #9ca3af;
  background: #f3f4f6;
}

.ksef-indicator--missing {
  color: #6b7280;
  background: #eef0f4;
  font-size: 0.95rem;
}

.invoice-ksef-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.invoice-ksef-body p {
  margin: 0;
  line-height: 1.45;
}

.invoice-ksef-countdown {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.customer-orders-table th:nth-child(5),
.customer-orders-table td:nth-child(5) {
  width: 110px;
}

.invoice-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.invoice-icon-btn {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 30px;
  padding: 0.2rem;
  border-radius: 0.55rem;
  line-height: 1;
  border: 1px solid transparent;
}

.invoice-icon-btn__pf {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.invoice-icon-btn--empty {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}

.invoice-icon-btn--empty:hover {
  background: #e9ebef;
}

.invoice-icon-btn--done {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.3);
  color: #047857;
}

.invoice-icon-btn--done:hover {
  background: #d1fae5;
}

.invoice-icon-btn--partial {
  background: #fff4dd;
  border-color: #f3d39a;
  color: #9a6700;
}

.invoice-icon-btn--partial:hover {
  background: #fdeac0;
}

.invoice-count-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-sizing: content-box;
  pointer-events: none;
}

.invoice-list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff;
}

.invoice-list-row + .invoice-list-row {
  margin-top: 0.45rem;
}

.invoice-list-row__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.invoice-list-row__info strong {
  font-size: 0.92rem;
  color: #111827;
  word-break: break-all;
}

.invoice-list-row__info span {
  font-size: 0.78rem;
  color: #6b7280;
}

.invoice-list-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  justify-content: flex-end;
}

.invoice-pdf-langs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.invoice-pdf-lang-btn {
  padding: 0.28rem 0.5rem;
  font-size: 0.78rem;
}

.etsy-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.etsy-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: #4b5563;
  font-size: 0.86rem;
  line-height: 1.45;
}

.etsy-keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.etsy-bounce-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.etsy-import-row {
  display: flex;
  gap: 0.7rem;
  align-items: end;
}

.etsy-nginx-snippet {
  margin: 0;
  padding: 0.7rem 0.8rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre;
}

.etsy-import-row label {
  max-width: 12rem;
}

.customer-orders-source-badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: #f3e8ff;
  color: #6b21a8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

@media (max-width: 720px) {
  .etsy-keys-grid {
    grid-template-columns: 1fr;
  }
}

.invoice-list-ksef-ok {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2b8a3e;
  padding: 0.25rem 0.4rem;
}

.customer-order-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.customer-order-form__crm {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.84rem;
}

.customer-search {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.customer-search__results {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.customer-search__item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 0.45rem;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  color: inherit;
  font: inherit;
}

.customer-search__item:hover,
.customer-search__item:focus {
  background: #f3f4f6;
  outline: none;
}

.customer-search__name {
  font-size: 0.86rem;
  font-weight: 600;
}

.customer-search__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.customer-search__empty {
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.customer-order-form__client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fafafa;
}

.customer-order-form__col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.customer-order-form__col-title {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.customer-order-form__row-pair {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0.45rem;
}

.customer-order-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  min-width: 0;
}

.customer-order-form input,
.customer-order-form select {
  padding: 0.4rem 0.5rem;
  font-size: 0.86rem;
}

.customer-order-form__items {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.customer-order-form__items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.customer-order-form__items-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

.customer-order-form__add-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #c8d6ea;
  background: #eef4ff;
  color: #1e5bb8;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.customer-order-form__add-btn:hover {
  background: #dce9ff;
}

.customer-order-form__add-btn[aria-expanded='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.customer-order-picker {
  margin-bottom: 0.55rem;
  padding: 0.55rem;
  border: 1px dashed #c8d6ea;
  border-radius: 0.65rem;
  background: #f7fbff;
}

.co-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.co-picker-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.co-picker-card:hover {
  border-color: #8eb5e8;
  box-shadow: 0 2px 8px rgba(30, 91, 184, 0.12);
}

.co-picker-card--custom {
  border-style: dashed;
  background: #fffdf8;
}

.co-picker-card__img {
  aspect-ratio: 1;
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.co-picker-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.co-picker-card__placeholder {
  font-size: 1.1rem;
  color: var(--muted);
}

.co-picker-card__name {
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customer-order-items-empty {
  margin: 0.35rem 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.customer-order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.customer-order-items-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.customer-order-items-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.customer-order-items-table th:nth-child(2),
.customer-order-items-table td:nth-child(2) {
  width: 72px;
}

.customer-order-items-table th:nth-child(3),
.customer-order-items-table td:nth-child(3) {
  width: 96px;
}

.customer-order-items-table th:nth-child(4),
.customer-order-items-table td:nth-child(4) {
  width: 72px;
}

.customer-order-items-table th:nth-child(5),
.customer-order-items-table td:nth-child(5) {
  width: 88px;
  text-align: right;
}

.customer-order-items-table th:last-child,
.customer-order-items-table td:last-child {
  width: 36px;
  text-align: center;
}

.co-items-product {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.co-items-thumb {
  width: 36px;
  height: 36px;
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--surface-alt);
  flex-shrink: 0;
}

.co-items-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.co-items-name {
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  word-break: break-word;
}

.co-items-input {
  width: 100%;
  padding: 0.32rem 0.4rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.co-items-input--qty,
.co-items-input--price {
  text-align: right;
}

.co-items-remove {
  border: none;
  background: transparent;
  color: #b42335;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem;
}

.co-items-line-gross {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.customer-order-form__footer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.customer-order-form__totals {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
}

.customer-order-form__summary {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.customer-order-form__shipping {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.customer-order-form__shipping label {
  min-width: 110px;
}

.customer-order-form__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.customer-order-form__meta label {
  min-width: 160px;
}

.customer-order-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 900px) {
  .customer-order-form__client-grid {
    grid-template-columns: 1fr;
  }
}
.blueprint-card__head {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.blueprint-thumb {
  width: 64px;
  height: 64px;
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--surface-alt);
  flex: 0 0 auto;
}

.blueprint-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blueprint-image-preview {
  margin-top: 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 0.9rem;
  padding: 0.5rem;
  display: none;
}

.blueprint-image-preview.active {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blueprint-image-preview img {
  width: 72px;
  height: 72px;
  border-radius: 0.75rem;
  object-fit: cover;
}

.blueprint-image-preview span {
  font-size: 0.85rem;
  color: var(--muted);
}

.primary.success {
  background: #1f8a3a;
}

.primary.success:hover {
  background: #17692c;
}

.order-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.order-item-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.order-item-builder select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.order-item-builder button {
  align-self: center;
}

.order-items-draft ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.order-draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface-alt);
}

.order-draft-item button {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.picker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.picker-card {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.75rem;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.picker-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 0.7rem;
  background: #e1e5f5;
}

.picker-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.picker-quantity {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.picker-quantity button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.selection-summary {
  margin-top: 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.9rem;
  padding: 1rem;
  background: var(--surface-alt);
}

#selection-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selection-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.selection-item button {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.blueprint-component-options,
#blueprint-component-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
}

.blueprint-component-option,
.blueprint-component-selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

#blueprint-component-search {
  width: 100%;
  margin-top: 0.75rem;
}

.image-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 20px 45px rgb(0 0 0 / 0.25);
  padding: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-9999px, -9999px);
  transition: opacity 0.15s ease;
  z-index: 200;
}

.image-preview.visible {
  opacity: 1;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0.8rem;
}

@media (max-width: 1100px) {
  .material-row {
    flex-wrap: wrap;
  }

  .material-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 960px) {
  .customer-orders-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-orders-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .picker-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 720px) {
  .panel-header {
    flex-direction: column;
  }

  .warehouse-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .label-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .label-toolbar__cta {
    justify-content: space-between;
  }

  .material-row {
    flex-direction: column;
  }

  .material-cell {
    width: 100%;
    min-width: 0;
  }

  .material-actions {
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column;
  }

  .stock-backup-item {
    flex-direction: column;
  }

  .stock-backup-item__actions {
    justify-content: flex-start;
  }

  .order-card__header {
    grid-template-columns: 1fr;
  }

  .order-card__meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Listy godzinowe ——— */
.panel-wide--timesheets {
  max-width: var(--content-max);
}

.timesheet-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.timesheet-aside-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.timesheet-employee-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timesheet-employee-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.timesheet-employee-item:hover {
  border-color: var(--accent);
}

.timesheet-employee-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timesheet-employee-item .name {
  font-weight: 600;
}

.timesheet-employee-item .rate {
  font-size: 0.8rem;
  color: var(--muted);
}

.timesheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  width: 100%;
}

.timesheet-month-label {
  margin: 0;
  min-width: 10rem;
  text-align: center;
  font-size: 1.15rem;
}

.timesheet-empty {
  color: var(--muted);
  margin: 1.5rem 0;
}

.timesheet-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.timesheet-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.timesheet-day {
  min-height: 5.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.timesheet-day:hover:not(:disabled):not(.timesheet-day--weekend):not(.timesheet-day--vacation) {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgb(255 122 24 / 0.15);
}

.timesheet-day--empty {
  visibility: hidden;
  pointer-events: none;
  border: none;
  background: transparent;
}

.timesheet-day--weekend {
  background: #ececec;
  color: #9a9a9a;
  cursor: not-allowed;
}

.timesheet-day--vacation {
  background: #e7f5ff;
  border-color: #74c0fc;
  color: #1864ab;
  cursor: not-allowed;
}

.timesheet-day--vacation:not(:disabled) {
  cursor: pointer;
}

.timesheet-day--confirmed {
  border-color: #2f9e44;
  background: #ebfbee;
}

.timesheet-day--today {
  box-shadow: 0 0 0 2px var(--accent);
  border-color: var(--accent);
}

.timesheet-day__edited {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #d9480f;
  background: #fff4e6;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
}

.timesheet-day__num {
  font-weight: 700;
  font-size: 0.9rem;
}

.timesheet-day__hours {
  font-size: 0.85rem;
  font-weight: 600;
}

.timesheet-day__range {
  font-size: 0.72rem;
  color: var(--muted);
}

.timesheet-day__badge {
  margin-top: auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2f9e44;
}

.timesheet-entry-day-history {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 0.85rem;
  max-height: 160px;
  overflow: auto;
}

.timesheet-entry-day-history ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.timesheet-entry-day-history .when {
  color: var(--muted);
  font-size: 0.78rem;
}

.timesheet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.timesheet-summary__box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
}

.timesheet-summary__label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.timesheet-entry-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.timesheet-entry-hours {
  margin: 0.75rem 0;
  font-size: 1.05rem;
}

.timesheet-entry-locked-note {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff9db;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #7c5e00;
}

.timesheet-entry-vacation-note {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #e7f5ff;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1864ab;
}

.timesheet-entry-actions {
  flex-wrap: wrap;
}

.timesheet-confirm-summary {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.timesheet-history-list {
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timesheet-history-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: var(--surface-alt);
  font-size: 0.9rem;
}

.timesheet-history-item .when {
  font-size: 0.78rem;
  color: var(--muted);
}

.timesheet-print-preview {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: var(--surface-alt);
  border-radius: 8px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

@media (max-width: 800px) {
  .timesheet-layout {
    grid-template-columns: 1fr;
  }

  .timesheet-day {
    min-height: 4.2rem;
    padding: 0.35rem;
  }

  .timesheet-day__range {
    display: none;
  }
}

/* ========== Księgowość ========== */

.panel-wide--accounting {
  max-width: 1400px;
}

.accounting-month-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.accounting-month-label {
  margin: 0;
  min-width: 10rem;
  text-align: center;
  text-transform: capitalize;
  font-size: 1.15rem;
}

.accounting-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.accounting-summary-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
}

.accounting-summary-card--revenue {
  border-color: #2f9e44;
  background: linear-gradient(180deg, #ebfbee 0%, #fff 72%);
}

.accounting-summary-card--revenue strong {
  color: #2b8a3e;
}

.accounting-summary-card--cost {
  border-color: #e03131;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 72%);
}

.accounting-summary-card--cost strong {
  color: #c92a2a;
}

.accounting-summary-card--accent {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff7f0 0%, #fff 70%);
}

.accounting-summary-card--profit {
  border-color: #1971c2;
  background: linear-gradient(180deg, #e7f5ff 0%, #fff 72%);
}

.accounting-summary-card--profit strong.is-negative {
  color: #c92a2a;
}

.accounting-summary-card--profit strong.is-positive {
  color: #2b8a3e;
}

.accounting-summary-card__icon {
  width: 1.55rem;
  height: 1.55rem;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.accounting-summary-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.accounting-summary-card__label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.accounting-summary-card strong {
  font-size: 1.2rem;
}

.accounting-summary-card__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.accounting-cost-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.accounting-cost-chip {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.accounting-cost-chip span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.accounting-cost-chip strong {
  font-size: 0.95rem;
}

.accounting-cost-chip--muted {
  background: var(--surface-alt, #f7f7f8);
}

.accounting-layout--main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: start;
}

.accounting-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accounting-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface, #fff);
}

.accounting-section-head {
  margin-bottom: 0.85rem;
}

.accounting-section-head h3,
.accounting-section-head h4 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.accounting-section-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.accounting-section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.accounting-section-head--row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.accounting-stat-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.accounting-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--surface-alt, #f7f7f8);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.accounting-stat__label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accounting-stat__value {
  font-size: 1rem;
}

.accounting-rate-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.accounting-rate-field input {
  font: inherit;
  font-weight: 600;
  color: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.accounting-link-btn {
  margin-top: 0.85rem;
  width: 100%;
}

.accounting-settle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7f0 0%, #fff 75%);
}

.accounting-settle-bar__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.accounting-checklist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.85rem 0 0.4rem;
}

.accounting-checklist-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

.accounting-checklist-progress {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.accounting-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.accounting-checklist__item {
  display: grid;
  grid-template-columns: 1.05rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
  font-size: 0.86rem;
}

.accounting-checklist__item:last-child {
  border-bottom: none;
}

.accounting-checklist__item.is-done {
  background: #f4fbf6;
}

.accounting-checklist__item.is-done .accounting-checklist__label {
  color: #2b8a3e;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.accounting-checklist__box {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: #2f9e44;
  cursor: pointer;
}

.accounting-checklist__label {
  line-height: 1.25;
  min-width: 0;
}

.accounting-checklist__action {
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.2rem;
  cursor: pointer;
  white-space: nowrap;
}

.accounting-checklist__action:hover {
  text-decoration: underline;
}

.accounting-checklist__action-spacer {
  width: 2.5rem;
}

.accounting-pill {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.accounting-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.accounting-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.accounting-day {
  min-height: 5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.accounting-day:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgb(255 122 24 / 0.15);
}

.accounting-day--empty {
  visibility: hidden;
  pointer-events: none;
  border: none;
  background: transparent;
}

.accounting-day--today {
  box-shadow: 0 0 0 2px var(--accent);
  border-color: var(--accent);
}

.accounting-day--pending {
  border-color: #e67700;
  background: #fff9db;
}

.accounting-day--paid {
  border-color: #2f9e44;
  background: #ebfbee;
}

.accounting-day__num {
  font-weight: 700;
  font-size: 0.9rem;
}

.accounting-day__title {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.accounting-day__amount,
.accounting-day__status {
  margin-top: auto;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.accounting-day--paid .accounting-day__status {
  color: #2b8a3e;
}

.accounting-day--pending .accounting-day__status {
  color: #e03131;
}

.accounting-table-wrap {
  overflow-x: auto;
}

.accounting-table-wrap--scroll {
  max-height: min(60vh, 520px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.accounting-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.accounting-table th,
.accounting-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.45rem;
  text-align: left;
  vertical-align: top;
}

.accounting-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.accounting-cost-row {
  position: relative;
}

.accounting-cost-row:hover {
  background: #fff7f0;
}

.accounting-cost-hover {
  position: absolute;
  right: 0.5rem;
  top: calc(100% - 0.15rem);
  z-index: 5;
  width: min(320px, 70vw);
  pointer-events: auto;
}

.accounting-cost-tip {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.12);
  padding: 0.75rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.accounting-cost-tip__items {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.accounting-cost-tip__note {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.accounting-cost-tip__pdf {
  margin-top: 0.25rem;
  font-weight: 700;
  color: var(--accent);
}

.accounting-table__actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}

.accounting-empty,
.accounting-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.accounting-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.accounting-day-event {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt, #f7f7f8);
}

.accounting-day-event.is-paid {
  border-color: #2f9e44;
  background: #ebfbee;
}

.accounting-day-event__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.accounting-amount-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.accounting-settlement-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.accounting-settlement-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--surface-alt, #f7f7f8);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.accounting-settlement-stat strong {
  color: inherit;
  font-size: 0.98rem;
}

.muted {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1100px) {
  .accounting-summary-row {
    grid-template-columns: 1fr;
  }

  .accounting-cost-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .accounting-layout--main,
  .accounting-settlement-stats {
    grid-template-columns: 1fr;
  }

  .accounting-settle-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .accounting-day {
    min-height: 4rem;
    padding: 0.35rem;
  }

  .accounting-cost-breakdown,
  .accounting-amount-row,
  .accounting-stat-stack {
    grid-template-columns: 1fr;
  }
}

/* —— Serwis —— */
.panel-wide--serwis .panel-header h2 {
  letter-spacing: -0.02em;
}

.serwis-controls {
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.serwis-view-toggles {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.2rem;
  background: var(--surface-alt);
  border-radius: 999px;
}

.serwis-view-toggles .pill {
  border: none;
  background: transparent;
  box-shadow: none;
}

.serwis-view-toggles .pill[aria-pressed='true'] {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.serwis-ico {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.85;
}

.serwis-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.serwis-tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
  margin-top: 0.85rem;
}

.serwis-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
}

.serwis-empty__icon {
  width: 2rem;
  height: 2rem;
  opacity: 0.45;
}

.serwis-empty__icon svg {
  width: 100%;
  height: 100%;
}

.serwis-empty p {
  margin: 0;
  font-size: 0.95rem;
}

.serwis-ticket-card {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  border-left: 4px solid #c4c4c4;
  outline: none;
}

.serwis-ticket-card:hover,
.serwis-ticket-card:focus-visible {
  border-color: #cfcfcf;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.serwis-ticket-card--new,
.serwis-ticket-card--to_reply {
  border-left-color: #e0922d;
  background: linear-gradient(180deg, #fffaf3 0%, #ffffff 42%);
}

.serwis-ticket-card--in_progress,
.serwis-ticket-card--replied {
  border-left-color: #3b78e7;
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 42%);
}

.serwis-ticket-card--waiting {
  border-left-color: #7c3aed;
  background: linear-gradient(180deg, #f7f2ff 0%, #ffffff 42%);
}

.serwis-ticket-card--done,
.serwis-ticket-card--resolved {
  border-left-color: #2f8f4e;
  background: #f7f7f7;
  opacity: 0.95;
}

.serwis-ticket-card--aging .serwis-ticket-card__age {
  color: #9a5b00;
  background: #fff1d6;
}

.serwis-ticket-card--old .serwis-ticket-card__age {
  color: #b42318;
  background: #fde8e6;
}

.serwis-ticket-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.serwis-ticket-card__id {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.serwis-ticket-card__code {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.serwis-ticket-card__client {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  min-width: 0;
}

.serwis-ticket-card__client > span:last-child,
.serwis-ticket-card__client {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serwis-ticket-card__age {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.5rem;
  border-radius: 0.55rem;
  background: var(--surface-alt);
  color: #444;
  line-height: 1;
  flex-shrink: 0;
}

.serwis-ticket-card__age strong {
  font-size: 1.05rem;
}

.serwis-ticket-card__age span:last-child {
  font-size: 0.72rem;
  text-transform: lowercase;
  opacity: 0.8;
}

.serwis-ticket-card__product {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  background: var(--surface-alt);
  font-size: 0.8rem;
  color: #333;
  line-height: 1.3;
}

.serwis-ticket-card__thumb {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: cover;
  border-radius: 0.4rem;
  background: #111;
  flex: 0 0 auto;
}

.serwis-ticket-card__order {
  font-size: 0.78rem;
  color: var(--muted);
}

.serwis-product-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.serwis-product-row__img {
  width: 3.4rem;
  height: 3.4rem;
  object-fit: cover;
  border-radius: 0.55rem;
  background: #111;
  flex: 0 0 auto;
}

.serwis-ticket-card__product > span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.serwis-ticket-card__issue {
  margin: 0;
  font-size: 0.9rem;
  color: #222;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}

.serwis-ticket-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.serwis-ticket-card__badges {
  display: inline-flex;
  gap: 0.4rem;
}

.serwis-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.serwis-badge--source {
  background: #eef6ff;
  color: #1f4f8a;
}

.serwis-client-mode {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem 0.85rem;
  margin: 0;
  background: var(--surface-alt);
}

.serwis-client-mode legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.serwis-client-mode__toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}

.serwis-radio {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  color: #222;
  cursor: pointer;
}

.serwis-radio input {
  width: auto;
  margin: 0;
}

.serwis-form-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.serwis-form-section[hidden] {
  display: none !important;
}

.serwis-form-section > .full-width,
.serwis-form-section > .serwis-order-preview {
  grid-column: 1 / -1;
}

.serwis-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.serwis-attach-form {
  display: none;
}

.serwis-attachments-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.55rem;
}

.serwis-attachments-head h4 {
  margin: 0;
  flex: 1 1 auto;
}

.serwis-attach-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-alt);
  color: #333;
  cursor: pointer;
  flex: 0 0 auto;
}

.serwis-attach-icon-btn:hover {
  background: #fff;
  border-color: #cfcfcf;
}

.serwis-attach-icon-btn .serwis-ico {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 1;
}

.serwis-attach-icon-btn input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.serwis-attach-status-inline:empty {
  display: none;
}

.serwis-attachments-head h4 em {
  font-style: normal;
  margin-left: 0.35rem;
  background: var(--surface-alt);
  color: #444;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
}

.serwis-comment-form {
  border-top: none;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.serwis-status-pill {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  max-width: 100%;
}

.serwis-status-pill--new,
.serwis-status-pill--to_reply {
  background: #fff3e0;
  color: #8a4b00;
  border-color: #f0d2a0;
}

.serwis-status-pill--in_progress,
.serwis-status-pill--replied {
  background: #e8f0fe;
  color: #1a4fb8;
  border-color: #b7c9f5;
}

.serwis-status-pill--waiting {
  background: #f3e8ff;
  color: #6d28d9;
  border-color: #d8b4fe;
}

.serwis-status-pill--done,
.serwis-status-pill--resolved {
  background: #e6f6ea;
  color: #1f6b3a;
  border-color: #b7dfc2;
}

.serwis-order-preview {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-alt);
}

.serwis-order-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
}

.serwis-info-chip {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.serwis-info-chip__icon {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent-strong);
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.serwis-info-chip__icon svg {
  width: 100%;
  height: 100%;
}

.serwis-info-chip__label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.serwis-info-chip strong {
  display: block;
  font-size: 0.86rem;
  color: #222;
  font-weight: 600;
  word-break: break-word;
  line-height: 1.3;
}

.serwis-detail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.serwis-detail__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-alt);
}

.serwis-detail__status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.serwis-detail__status-label {
  font-size: 0.86rem;
  font-weight: 650;
  color: #333;
  white-space: nowrap;
}

.serwis-detail__status {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.serwis-detail__chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.serwis-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: #333;
}

.serwis-chip--age {
  background: #fff6ea;
  border-color: #f0d2a0;
  color: #8a4b00;
  font-weight: 650;
}

.serwis-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.serwis-panel-box {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
}

.serwis-panel-box--wide {
  grid-column: 1 / -1;
}

.serwis-panel-box h4 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.serwis-panel-box h4 em {
  font-style: normal;
  margin-left: auto;
  background: var(--surface-alt);
  color: #444;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
}

.serwis-panel-box__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: #1a1a1a;
  line-height: 1.35;
  word-break: break-word;
}

.serwis-panel-box__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.serwis-contact-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: #444;
  word-break: break-word;
}

.serwis-panel-box__empty {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.serwis-detail__issue {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  color: #222;
  font-size: 0.95rem;
}

.serwis-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.serwis-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.82rem;
  background: var(--surface-alt);
  max-width: 100%;
}

.serwis-attachment--image {
  flex-direction: column;
  align-items: stretch;
  width: 132px;
  padding: 0.35rem;
  background: var(--surface);
}

.serwis-attachment--image img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 0.35rem;
  background: #eee;
}

.serwis-attachment--image span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.serwis-comments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.serwis-comments li {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface-alt);
}

.serwis-comments time {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.serwis-comments p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .serwis-tickets-grid {
    grid-template-columns: 1fr;
  }

  .serwis-detail__grid {
    grid-template-columns: 1fr;
  }
}
