:root {
  --bg: #f4f6f8;
  --bg-muted: #eef2f6;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --panel-strong: #f1f5f9;
  --border: #d8e0e8;
  --border-strong: #c4d0dc;
  --text: #1f2937;
  --muted: #5f6b7a;
  --heading: #0f172a;
  --accent: #0f4c81;
  --accent-strong: #0b3a63;
  --accent-soft: #dceafe;
  --ok: #0f766e;
  --ok-soft: #d7f4ef;
  --warn: #b45309;
  --warn-soft: #fef0c7;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 286px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 76, 129, 0.03), transparent 18%),
    var(--bg);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.app-layout > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #16212d;
  color: #c6d0da;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f4c81, #0a7abf);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy h1,
.brand-copy h2 {
  margin: 0;
  font-size: 0.98rem;
  color: #f8fafc;
}

.brand-copy p {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: #94a3b8;
}

.nav-group {
  margin-top: 18px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f8ea2;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  margin-bottom: 4px;
  color: #d7dee7;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  background: rgba(15, 118, 110, 0.14);
  color: #f8fafc;
  border: 1px solid rgba(103, 232, 249, 0.12);
}

.nav-link small {
  color: #7f8ea2;
}

.sidebar-card {
  margin-top: 22px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-card strong {
  display: block;
  color: #f8fafc;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: #9eb0c1;
  line-height: 1.55;
  font-size: 0.88rem;
}

.main-content {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-intro h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.9rem;
  line-height: 1.1;
}

.page-intro p {
  margin: 6px 0 0;
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.55;
}

.topbar-actions,
.toolbar,
.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-footer-actions {
  justify-content: flex-end;
}

.top-search,
.user-chip,
.pill-action,
.btn,
.field input,
.field select,
.field textarea {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
}

.top-search {
  width: 280px;
  padding: 11px 13px;
}

.user-chip {
  padding: 10px 14px;
  font-weight: 600;
  color: var(--heading);
  background: var(--panel-muted);
}

.pill-action,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.pill-action.primary,
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pill-action.secondary,
.btn-secondary {
  background: var(--panel-strong);
  color: var(--heading);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid > *,
.quote-layout > *,
.section-card,
.card,
.table-wrap {
  min-width: 0;
}

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

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

.grid.dashboard {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
}

.grid.inventory {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.card,
.section-card,
.table-wrap,
.summary-box,
.quick-action,
.concept-card,
.stack-item,
.alert-item,
.list-row {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card,
.section-card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

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

.card-title {
  margin: 0;
  font-size: 1rem;
  color: var(--heading);
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.kpi-card {
  padding: 18px;
}

.kpi-value {
  margin: 14px 0 6px;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--heading);
}

.kpi-trend {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.summary-metric {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.summary-metric span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.summary-metric strong {
  display: block;
  margin-top: 10px;
  color: var(--heading);
  font-size: 1.7rem;
}

.summary-metric p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-muted);
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-inline strong {
  color: var(--heading);
}

.cms-toolbar {
  margin-top: 6px;
}

.cms-main-search {
  width: 420px;
}

.cms-filter-select,
.cms-filter-date {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  width: 100%;
}

.cms-list-card {
  padding: 0;
  overflow: hidden;
}

.cms-list-header {
  padding: 20px 22px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.cms-list {
  display: grid;
}

.cms-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) 160px 160px 250px;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

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

.cms-row.active {
  background: #f8fbff;
}

.cms-row-main {
  min-width: 0;
}

.cms-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cms-row-main strong {
  color: var(--heading);
  font-size: 1rem;
}

.cms-row-main p {
  margin: 8px 0 4px;
  color: var(--text);
  font-weight: 600;
}

.cms-row-main small {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cms-row-meta span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.cms-row-meta strong {
  color: var(--heading);
  font-size: 0.95rem;
  display: block;
}

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

.cms-row-actions .pill-action {
  min-width: 112px;
}

.cms-list-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border);
  background: var(--panel-muted);
}

.cms-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cms-pagination .active-page {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 40;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  padding: 22px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.12);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-header,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-body {
  display: grid;
  gap: 14px;
  align-content: start;
  overflow: auto;
}

.drawer-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--heading);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
}

.list-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.list-row.metrics-4 {
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.55fr) minmax(120px, 0.55fr) auto;
}

.list-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
}

.list-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.progress-line {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  overflow: hidden;
}

.progress-line > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4ed8, #0f766e);
}

.alert-list,
.quick-actions,
.concept-list,
.stack-list {
  display: grid;
  gap: 12px;
}

.alert-item,
.quick-action,
.concept-card,
.stack-item {
  padding: 16px;
  border-radius: 14px;
}

.alert-item strong,
.quick-action strong {
  display: block;
  color: var(--heading);
}

.alert-item p,
.quick-action p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

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

.table-wrap {
  border-radius: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #e7edf3;
  vertical-align: top;
}

th {
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #66768a;
  background: var(--panel-muted);
}

td {
  color: var(--text);
  font-size: 0.94rem;
}

tbody tr:hover {
  background: rgba(15, 76, 129, 0.025);
}

td input,
td select,
td textarea {
  min-width: 96px;
}

.table-input {
  width: 100%;
  min-width: 84px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.table-action {
  min-width: 92px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.top-search:focus {
  border-color: rgba(15, 76, 129, 0.5);
  box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.08);
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }

.concept-meta,
.stack-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.concept-meta h4,
.stack-item-header h4 {
  margin: 0;
  color: var(--heading);
  font-size: 1rem;
}

.concept-meta p,
.stack-item-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.concept-block {
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-muted);
  border: 1px solid var(--border);
}

.concept-block.wide {
  grid-column: 1 / -1;
}

.concept-block h5 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.summary-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
}

.summary-box.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary-row strong {
  color: var(--heading);
}

.summary-row.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.04rem;
}

.summary-row.full-width {
  grid-column: 1 / -1;
}

.summary-panel {
  display: grid;
  gap: 14px;
}

.summary-group {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-muted);
}

.summary-group .summary-row.total {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.total-block {
  background: #f8fbff;
  border-color: #cfe0f3;
}

.quote-layout {
  display: grid;
  gap: 18px;
}

.quote-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.summary-input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: right;
  background: #fff;
}

.sticky-column {
  position: static;
  align-self: start;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.showcase-content {
  max-width: 620px;
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-icon {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-weight: 800;
}

.hero-step strong {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
}

.hero-step p {
  margin: 0;
  color: rgba(248, 250, 252, 0.74);
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  padding: 24px;
}

.login-showcase,
.login-card {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.login-page.simple-login {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
  align-content: center;
  padding: 24px;
}

.simple-login-card {
  min-height: auto;
}

.login-showcase {
  padding: 40px;
  background: linear-gradient(135deg, #10253c, #0f4c81);
  color: #f8fafc;
}

.showcase-title {
  margin: 18px 0 14px;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.showcase-copy {
  margin: 0;
  max-width: 52ch;
  color: rgba(248, 250, 252, 0.82);
  line-height: 1.7;
}

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

.benefit {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.benefit strong {
  display: block;
  margin-bottom: 6px;
}

.benefit p {
  margin: 0;
  color: rgba(248, 250, 252, 0.74);
  font-size: 0.92rem;
  line-height: 1.6;
}

.login-card {
  padding: 34px;
  display: grid;
  align-items: center;
}

.login-panel {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.login-panel h1 {
  margin: 18px 0 10px;
  font-size: 2rem;
  color: var(--heading);
}

.login-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.checkbox-row,
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-row label,
.form-footer a {
  font-size: 0.92rem;
  color: var(--muted);
}

.checkbox-row input {
  width: auto;
  margin-right: 8px;
}

.btn-full {
  width: 100%;
}

.mini-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-muted);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-item span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 6px;
}

.detail-item strong {
  display: block;
  color: var(--heading);
}

.detail-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cut-sheet {
  position: relative;
  min-height: 360px;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 76, 129, 0.04), rgba(15, 76, 129, 0.01)),
    #f8fbff;
  border: 1px solid #cfe0f3;
  overflow: hidden;
}

.cut-sheet::before {
  content: "Tabla base 2.44 x 1.22 m";
  position: absolute;
  top: 14px;
  left: 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #516274;
}

.cut-piece {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(15, 76, 129, 0.16);
  background: rgba(15, 76, 129, 0.12);
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.piece-a {
  top: 52px;
  left: 18px;
  width: 160px;
  height: 130px;
}

.piece-b {
  top: 52px;
  left: 190px;
  width: 160px;
  height: 130px;
}

.piece-c {
  top: 52px;
  right: 18px;
  width: 170px;
  height: 144px;
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.16);
}

.piece-d {
  bottom: 94px;
  left: 18px;
  width: 160px;
  height: 122px;
}

.piece-e {
  bottom: 94px;
  left: 190px;
  width: 160px;
  height: 122px;
  background: rgba(180, 83, 9, 0.12);
  border-color: rgba(180, 83, 9, 0.16);
}

.piece-f {
  right: 18px;
  bottom: 22px;
  width: 170px;
  height: 130px;
  background: rgba(15, 118, 110, 0.18);
  border: 2px dashed rgba(15, 118, 110, 0.34);
  color: var(--ok);
}

.cut-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.cut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-chip {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: inline-block;
}

.legend-primary {
  background: rgba(15, 76, 129, 0.18);
  border: 1px solid rgba(15, 76, 129, 0.2);
}

.legend-secondary {
  background: rgba(180, 83, 9, 0.16);
  border: 1px solid rgba(180, 83, 9, 0.18);
}

.legend-reusable {
  background: rgba(15, 118, 110, 0.18);
  border: 2px dashed rgba(15, 118, 110, 0.34);
}

@media (max-width: 1220px) {
  .grid.kpis,
  .grid.dashboard,
  .grid.inventory,
  .workspace-grid,
  .admin-split,
  .quote-workspace,
  .quote-layout,
  .login-page,
  .sticky-column {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 860px) {
  .page-shell {
    width: 100%;
  }

  .sidebar,
  .main-content,
  .login-page {
    padding: 18px;
  }

  .topbar,
  .toolbar,
  .checkbox-row,
  .form-footer,
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-search {
    width: 100%;
  }

  .summary-strip,
  .quick-actions,
  .benefits-grid,
  .concept-blocks,
  .summary-box.two-columns,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .cms-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cms-row-actions {
    justify-content: flex-start;
  }

  .cms-list-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .cms-main-search,
  .cms-filter-select,
  .cms-filter-date {
    width: 100%;
  }

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

  .cut-sheet {
    min-height: 420px;
  }

  .piece-a,
  .piece-b,
  .piece-c,
  .piece-d,
  .piece-e,
  .piece-f {
    position: static;
    width: auto;
    height: 82px;
    margin-top: 12px;
  }

  .span-2,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-9,
  .span-12 {
    grid-column: span 12;
  }
}
