@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/open-sans.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/open-sans-italic.ttf") format("truetype");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #eef3f5;
  --panel: #ffffff;
  --panel-soft: #f7fafb;
  --ink: #132633;
  --muted: #6d7c86;
  --line: #dfe8ed;
  --brand: #0f3d5e;
  --brand-2: #18648f;
  --gold: #f4c64d;
  --ok: #22885a;
  --warn: #b7791f;
  --danger: #c2413d;
  --shadow: 0 20px 60px rgba(21, 47, 64, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(140deg, #f5f8fa 0%, #e5eef2 46%, #d9e7ec 100%);
}

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

button {
  cursor: pointer;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 28px;
  place-items: center;
  padding: 32px 16px;
  font-family: "Open Sans", sans-serif;
}

.auth-card {
  --float-distance: -6px;
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 64px -18px rgba(21, 47, 64, 0.3), 0 8px 20px -10px rgba(21, 47, 64, 0.16);
  animation: auth-float 7s ease-in-out infinite;
}

@keyframes auth-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(var(--float-distance)); }
}

.auth-card:hover,
.auth-card:focus-within {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card {
    animation: none;
    transform: none;
  }
}

.brand-panel {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  min-height: 540px;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: white;
  text-align: center;
  background: #007bff;
}

.brand-identity {
  grid-row: 2;
  min-width: 0;
}

.brand-mark {
  width: 220px;
  max-width: 100%;
  height: auto;
  margin-bottom: 34px;
}

.brand-title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  line-height: 1.1;
}

.brand-support {
  grid-row: 3;
  align-self: end;
  justify-self: center;
  display: grid;
  gap: 8px;
  max-width: 100%;
  margin-top: 28px;
  font-size: 0.875rem;
}

.brand-support a {
  color: white;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  padding: 18px 0 0;
  color: #53636d;
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}

.site-footer small {
  font-size: inherit;
}

.site-footer a {
  color: #0f3d5e;
  text-underline-offset: 3px;
}

.content > .site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.brand-support a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.brand-copy {
  max-width: 30rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.auth-form {
  padding: 42px;
}

.eyebrow {
  color: var(--brand-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.auth-form h1 {
  margin-top: 8px;
  font-size: 2rem;
}

.hint {
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.field label,
.checkline {
  color: #334a59;
  font-size: 0.92rem;
  font-weight: 700;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(24, 100, 143, 0.16);
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 18px;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--brand);
}

.primary:hover {
  background: #0a304b;
}

.secondary {
  color: var(--brand);
  background: #e6f0f5;
}

.ghost {
  color: var(--brand);
  background: transparent;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.full {
  width: 100%;
}

.account-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.account-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  background: var(--panel-soft);
}

.account-button strong {
  color: var(--ink);
}

.account-button span {
  color: var(--muted);
  font-size: 0.9rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 18px;
  background: #0f3d5e;
  color: white;
}

.sidebar .brand-mark {
  width: 132px;
  margin: 0 0 22px;
}

.side-label {
  margin: 12px 10px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.badge {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #0f3d5e;
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.profile {
  margin-top: auto;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #0f3d5e;
  background: var(--gold);
  font-weight: 900;
}

.profile small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
}

.access-card {
  display: grid;
  gap: 4px;
  margin-top: auto;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.access-card span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

.content {
  min-width: 0;
  overflow-x: hidden;
  padding: 42px 50px;
}

.session-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.session-user {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d5e5ec;
  border-radius: var(--radius);
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.76);
}

.session-user strong {
  display: block;
  line-height: 1.1;
}

.session-user small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.mini-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #0f3d5e;
  background: var(--gold);
  font-weight: 900;
}

.logout-button {
  min-width: 92px;
  border: 1px solid #cfe1ea;
  background: #f5fafc;
}

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

.date {
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-title {
  margin-top: 4px;
  font-size: 2rem;
}

.page-copy {
  max-width: 58rem;
  color: var(--muted);
  line-height: 1.55;
}

.history-search-button {
  border: 1px solid #97c5dc;
  box-shadow: 0 8px 22px rgba(15, 61, 94, 0.1);
}

.history-search-button:hover {
  border-color: var(--brand-2);
  background: #dcecf3;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat,
.panel,
.order-card,
.user-card,
.approval-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 26px rgba(21, 47, 64, 0.07);
}

.stat {
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.big-action {
  position: relative;
  min-width: 180px;
  min-height: 58px;
  border-radius: 12px;
  font-size: 1.05rem;
}

.approval-action {
  border: 1px solid #efb5b2;
  color: #8f211e;
  background: #fff2f1;
}

.approval-action:hover {
  background: #ffe4e2;
}

.blocked-action {
  color: #9f2d28;
  background: #fff0f0;
  border: 1px solid #ffd1d1;
}

.alert-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 2px 6px;
  color: #fff;
  background: var(--danger);
  font-size: 0.78rem;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(194, 65, 61, 0.28);
}

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

.production-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.icon-stat {
  min-height: 138px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 30px;
  border-bottom: 1px solid var(--line);
}

.list-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}

.list-row strong,
.list-row span {
  display: block;
}

.list-row span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.row-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #146ad5;
  background: #eaf3ff;
  font-weight: 900;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.column {
  min-width: 0;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.column-head {
  display: flex;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.order-card {
  margin: 10px;
  padding: 13px;
}

.order-card .primary,
.order-card .secondary {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
  line-height: 1.15;
}

.order-card .primary {
  box-shadow: 0 6px 14px rgba(11, 63, 94, 0.12);
}

.order-card .secondary {
  font-size: 0.82rem;
  background: #edf5f8;
}

.order-card strong {
  display: block;
  color: var(--brand);
}

.order-meta {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.production-parts {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.mini-action {
  min-height: 34px;
  border: 1px solid #cddde7;
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--brand);
  background: #eef5f8;
  font-weight: 900;
  cursor: pointer;
}

.mini-action.done {
  color: #116044;
  border-color: #bfe6d7;
  background: #e8f8f1;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 12px;
  margin: 18px 0;
}

.toolbar.two {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.invoice-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.invoice-form > .field { min-width: 0; margin: 0; }
.invoice-form > .field > label:first-child { min-height: 22px; display: block; }
.invoice-form > .actions { grid-column: 1 / -1; margin: 0; }

.invoice-upload-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.invoice-upload-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.invoice-upload-control span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.invoice-upload-control small {
  overflow: hidden;
  color: var(--muted);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-status-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-status-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafb;
  color: #334a59;
  font-size: 0.88rem;
  font-weight: 800;
}

.invoice-section-head {
  padding: 18px 18px 0;
}

.invoice-missing-row {
  background: #fff7e8;
  box-shadow: inset 4px 0 0 #e2a033;
}

.invoice-missing-row td {
  border-bottom-color: #efd3a5;
}

.danger-pill {
  margin-top: 6px;
  color: #8f2522;
  background: #f7d7d6;
}

.approval-order-list {
  display: grid;
  gap: 16px;
}

.approval-order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 26px rgba(21, 47, 64, 0.07);
}

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

.approval-order-head h2 {
  margin: 4px 0 6px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.approval-summary-grid,
.approval-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.approval-summary-grid {
  margin-bottom: 14px;
}

.approval-fields-grid {
  align-items: end;
}

.approval-fields-grid .wide-field {
  grid-column: span 2;
}

.approval-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.empty-approval {
  padding: 24px;
}

.inline-select {
  width: min(100%, 280px);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.inline-select.stacked,
.inline-input {
  display: block;
  width: min(100%, 280px);
  margin-top: 8px;
}

.inline-input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.panel {
  overflow: hidden;
}

.table-wrap {
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.orders-table {
  min-width: 1040px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #496171;
  background: #f5f8fa;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #19563f;
  background: #e7f5ee;
  font-size: 0.8rem;
  font-weight: 900;
}

.pill.warn {
  color: #7a4b09;
  background: #fff2d4;
}

.pill.blue {
  color: #135178;
  background: #e4f2f8;
}

.invoice-download-link {
  color: #063e63;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.invoice-download-link:hover {
  color: #0072bc;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 32px;
  border: 1px solid #b9dceb;
  border-radius: 8px;
  padding: 6px 10px;
  color: #0f4f78;
  background: linear-gradient(180deg, #f2fbff 0%, #e5f4fa 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

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

.user-card {
  padding: 18px;
}

.user-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.user-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 0;
}

.user-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-card dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) minmax(150px, 0.7fr) minmax(180px, 0.8fr) minmax(260px, 1.2fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px;
}

.user-form .field {
  margin: 0;
}

.user-form-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.user-unit-field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.registry-tabs {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.registry-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 20px;
}

.registry-totals > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.registry-totals strong { font-size: 1.3rem; }
.registry-totals button { min-height: 34px; padding: 6px 10px; font-size: 0.85rem; }

.registry-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  color: #426171;
  background: transparent;
}

.registry-tabs button.active {
  color: #fff;
  background: var(--brand);
}

.company-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
}

.company-form .field {
  margin: 0;
}

.company-form .actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.users-table {
  min-width: 0;
  table-layout: auto;
  font-size: 0.88rem;
}

.users-table th,
.users-table td {
  vertical-align: middle;
  overflow-wrap: normal;
  padding: 14px 12px;
}

.users-table th:last-child,
.users-table td:last-child {
  width: 260px;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 170px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 130px;
  white-space: nowrap;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 130px;
  overflow-wrap: normal;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 85px;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 190px;
}

.users-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.users-table .hint {
  font-size: 0.8rem;
  line-height: 1.4;
}

.users-table .profile-pill {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: #e4f2f8;
  box-shadow: none;
  padding: 5px 8px;
  font-weight: 700;
}

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

.users-table .table-actions button {
  min-height: 32px;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.muted-row {
  opacity: 0.56;
}

.table-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.compact-actions {
  grid-template-columns: repeat(2, minmax(86px, 1fr));
}

.table-actions .primary,
.table-actions .secondary,
.table-actions .danger {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.86rem;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.product-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1200px;
}

.product-choice {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(21, 47, 64, 0.08);
}

.product-choice > div {
  padding: 42px 32px 34px;
}

.product-choice h2 {
  margin-top: 16px;
  font-size: 1.65rem;
  font-weight: 500;
}

.product-visual {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 220px;
  border: 0;
  border-radius: 0;
  font-size: 4rem;
  color: #176fd5;
  background: #dcedff;
}

.product-visual.purple {
  color: #7250d4;
  background: #e9e1ff;
}

.help-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1200px;
  margin-top: 26px;
  border: 1px solid #cfe4fb;
  border-radius: 14px;
  padding: 18px 22px;
  background: #edf7ff;
}

.help-strip span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.stepper {
  display: grid;
  grid-template-columns: auto auto 75px auto auto;
  gap: 10px;
  align-items: center;
  margin: 26px 0 30px;
  color: #21384a;
}

.step {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #dce7ef;
  color: #6f8292;
  font-weight: 900;
}

.step.active {
  color: #fff;
  background: #1d70d6;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 24px;
  align-items: start;
  max-width: 1480px;
}

.order-form-stack {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.form-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(21, 47, 64, 0.05);
}

.muted-block {
  color: #7d92a4;
  background: rgba(255, 255, 255, 0.62);
}

.is-locked {
  opacity: 0.72;
}

.block-title {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.block-title > span {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #1d70d6;
  background: #eaf3ff;
  font-weight: 900;
}

.block-title h2 {
  font-size: 1.35rem;
  font-weight: 500;
}

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

.field.compact {
  margin: 0;
}

.wide-field {
  grid-column: 1 / -1;
}

.field textarea {
  min-height: 76px;
  line-height: 1.45;
  resize: vertical;
}

.art-choice-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #f8fbfd;
}

.art-choice-panel.disabled {
  opacity: 0.62;
}

.choice-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.choice-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.art-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 10px;
}

.art-choice {
  display: grid;
  grid-template-columns: 16px 44px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  border: 1px solid #d8e5ee;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
}

.art-choice.selected {
  border-color: #1d70d6;
  background: #eef6ff;
}

.art-choice img,
.art-choice-fallback {
  width: 44px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  background: #eef4f7;
}

.art-choice-fallback {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 900;
}

.art-choice span:last-child {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-weight: 800;
  font-size: 0.86rem;
}

.art-choice input[type="checkbox"] {
  width: 14px;
  min-width: 0;
  margin: 0;
}

.lanyard-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.lanyard-panel.selected {
  border-color: #1d70d6;
  background: #f7fbff;
}

.lanyard-panel.disabled {
  opacity: 0.62;
}

.lanyard-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: end;
}

.lanyard-control .checkline {
  align-items: center;
  min-height: 54px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.lanyard-control small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.lanyard-preview {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d7e7ef;
  border-radius: 14px;
  background: #f8fbfd;
}

.lanyard-art-preview {
  display: grid;
  gap: 22px;
  place-items: center;
  width: 64px;
  height: 210px;
  border-radius: 8px;
  color: #fff;
  background: #243341;
  overflow: hidden;
}

.lanyard-art-preview span {
  display: block;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 0.92;
  text-align: center;
  transform: rotate(-90deg);
}

.lanyard-preview strong,
.lanyard-preview span {
  display: block;
}

.lanyard-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.lanyard-preview .lanyard-art-preview span {
  margin-top: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 0.92;
}

.lanyard-finish {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.notice {
  margin-top: 20px;
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
}

.notice.warn {
  color: #a56200;
  background: #fff0dc;
}

.notice.ok {
  color: #317e67;
  background: #e9f8f3;
}

.notice.danger {
  color: #9f2d28;
  background: #fff0f0;
  border: 1px solid #ffd1d1;
}

.client-invoice-alert {
  display: grid;
  gap: 6px;
  max-width: 980px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid rgba(183, 121, 31, 0.28);
  box-shadow: 0 14px 34px rgba(21, 47, 64, 0.08);
}

.client-invoice-alert.danger {
  border-color: rgba(194, 65, 61, 0.28);
}

.client-invoice-alert strong {
  font-size: 1rem;
}

.invoice-alert-table {
  margin-top: 8px;
  overflow-x: auto;
}

.invoice-alert-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(183, 121, 31, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
}

.invoice-alert-table th,
.invoice-alert-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(183, 121, 31, 0.16);
  color: inherit;
  font-size: 0.88rem;
  text-align: left;
}

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

.invoice-alert-table th {
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.file-drop,
.empty-drop {
  display: grid;
  place-items: center;
  min-height: 134px;
  border: 2px dashed #b8d2e3;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  background: #f8fbfd;
}

.file-drop {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
  border-color: var(--brand-2);
  background: #eef7fb;
  box-shadow: 0 0 0 3px rgba(24, 100, 143, 0.12);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop span,
.empty-drop span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.file-drop span strong {
  display: block;
  color: var(--brand);
  font-size: 1rem;
}

.file-drop span small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.file-drop em {
  display: block;
  margin-top: 8px;
  color: var(--ok);
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.file-drop.small {
  min-height: 112px;
}

.file-drop.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f2f6f8;
}

.empty-drop.ready {
  border-color: #8fd8bb;
  background: #f1fbf7;
}

.sheet-preview {
  min-width: 0;
  max-height: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.preview-head strong,
.preview-head span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-head span {
  color: var(--ok);
  font-weight: 800;
}

.table-wrap.mini table {
  min-width: 640px;
  table-layout: fixed;
}

.table-wrap.mini th,
.table-wrap.mini td {
  max-width: 180px;
  padding: 8px 10px;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-preview {
  max-height: 160px;
  overflow: auto;
}

.preview-limit-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.image-preview-block {
  margin-top: 18px;
}

.image-preview-block > strong {
  display: block;
  margin-bottom: 10px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.image-preview-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.image-preview-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf3f7;
}

.image-preview-grid figcaption {
  padding: 8px 9px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.catalog-preview {
  margin-top: 18px;
  border: 1px solid #d8e5ee;
  border-radius: 16px;
  padding: 16px;
  background: #f8fbfd;
}

.catalog-preview > strong {
  display: block;
  margin-bottom: 10px;
}

.catalog-preview.empty span {
  display: block;
  color: var(--muted);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mini-art-grid {
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.catalog-art {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.catalog-art-face {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  color: var(--art-accent);
  background: linear-gradient(135deg, var(--art-bg), #fff);
}

.catalog-art-face span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.catalog-art-face b {
  font-size: 1.3rem;
}

.catalog-art-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.58 / 1;
  object-fit: contain;
  padding: 8px;
  background: #eef4f7;
}

.catalog-art h3 {
  padding: 10px 12px 2px;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.mini-art-grid .catalog-art h3 {
  padding: 7px 8px 2px;
  font-size: 0.74rem;
}

.mini-art-grid .catalog-art small {
  padding: 0 8px 8px;
  font-size: 0.68rem;
}

.catalog-art small {
  display: block;
  padding: 0 12px 12px;
  color: var(--muted);
}

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

.model-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.model-file-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.model-file-block.provisional-block {
  border-color: #bfe6d7;
  background: #f1fbf7;
}

.model-file-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.model-file-head span {
  color: var(--muted);
  font-weight: 800;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-bottom: 20px;
}

.primary:disabled,
.secondary:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  text-decoration: none;
}

.compact-link {
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.86rem;
}

.locked-field label::after {
  content: " bloqueado";
  margin-left: 6px;
  color: #9aaab6;
  font-size: 0.75rem;
  font-weight: 700;
}

.summary-card {
  position: sticky;
  top: 16px;
  align-self: start;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(21, 47, 64, 0.06);
}

.summary-card h2 {
  margin-bottom: 20px;
  font-size: 1.25rem;
  font-weight: 500;
}

.summary-item {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.summary-item span {
  display: block;
  color: #8898a6;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

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

.approval-card {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  overflow: hidden;
}

.preview-art {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  background: repeating-linear-gradient(135deg, #eef4f7, #eef4f7 12px, #f8fbfc 12px, #f8fbfc 24px);
}

.lanyard {
  width: min(390px, 100%);
  border: 1px solid #b8c8d0;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lanyard-strip {
  padding: 18px;
  color: white;
  background: var(--brand);
  font-weight: 900;
  text-align: center;
}

.lanyard-body {
  display: grid;
  gap: 10px;
  padding: 26px;
  text-align: center;
}

.approval-body {
  padding: 24px;
}

.approval-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.approval-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--panel-soft);
  font-weight: 700;
}

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

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

.modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-backdrop {
  z-index: 35;
}

.confirm-modal {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-modal h2 {
  margin: 6px 0 10px;
  font-size: 1.45rem;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.modal main {
  padding: 22px;
}

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

.detail-grid .summary-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.client-detail-grid .summary-item:last-child {
  grid-column: 1 / -1;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  border-radius: var(--radius);
  padding: 13px 14px;
  color: #fff;
  background: var(--brand);
  box-shadow: var(--shadow);
  z-index: 30;
}

.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .brand-panel {
    min-height: 280px;
  }

  .auth-card,
  .app-shell,
  .approval-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .profile {
    margin-top: 18px;
  }

  .stats,
  .users-grid,
  .product-choice-grid,
  .user-form,
  .invoice-form,
  .approval-summary-grid,
  .approval-fields-grid {
    grid-template-columns: 1fr;
  }

  .approval-fields-grid .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .auth-card {
    --float-distance: -3px;
  }

  .auth-form,
  .brand-panel,
  .content {
    padding: 22px;
  }

  .order-layout {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
    max-height: none;
  }

  .toolbar,
  .detail-grid,
  .user-card dl,
  .form-grid,
  .dual-drop,
  .lanyard-control {
    grid-template-columns: 1fr;
  }

  .list-row {
    grid-template-columns: 44px 1fr;
  }

  .list-row .pill,
  .list-row .ghost {
    justify-self: start;
    grid-column: 2;
  }

  .topline {
    display: grid;
  }

  .top-actions {
    justify-content: stretch;
  }

  .approval-order-head,
  .approval-card-actions {
    display: grid;
    justify-content: stretch;
  }

  .top-actions .big-action {
    flex: 1 1 180px;
  }

  .page-title {
    font-size: 1.55rem;
  }

  .brand-title,
  .auth-form h1 {
    font-size: 1.65rem;
  }
}
