:root {
  --ink: #18221f;
  --muted: #68736f;
  --line: #dde4df;
  --paper: #f4f6f2;
  --white: #fff;
  --forest: #173f37;
  --forest-2: #245b4f;
  --lime: #c9e66b;
  --sand: #eee9dd;
  --amber: #edae49;
  --red: #d9655b;
  --blue: #6d93b8;
  --shadow: 0 12px 32px rgba(32, 52, 44, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px;
  color: #edf5f0; background: var(--forest); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 38px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  color: var(--forest); background: var(--lime); font: 800 20px Georgia, serif;
}
.brand-mark-image {
  padding: 5px;
  background: #f8faf4;
  box-shadow: inset 0 0 0 1px rgba(23,63,55,.08);
}
.brand-mark-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: .08em; }
.brand span { margin-top: 2px; color: #9eb8b0; font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%; padding: 11px 13px; border: 0; border-radius: 9px; text-align: left;
  color: #bed0ca; background: transparent; transition: .2s;
}
.nav-item span { display: inline-block; width: 27px; font-size: 17px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.1); }
.nav-item.active::after { content: ""; float: right; width: 5px; height: 5px; margin-top: 8px; border-radius: 50%; background: var(--lime); }
.sidebar-foot { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 10px; align-items: center; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { color: #91aaa2; font-size: 9px; margin-top: 2px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(201,230,107,.12); }

main { min-width: 0; }
.topbar {
  min-height: 112px; padding: 25px 38px 22px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; background: rgba(244,246,242,.92);
}
.eyebrow { margin: 0 0 4px; color: var(--forest-2); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 3vw, 34px); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.session-user { display: grid; gap: 2px; min-width: 145px; text-align: right; }
.session-user span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.session-user strong { font-size: 11px; }
.primary, .secondary, .ghost, .danger {
  border: 0; border-radius: 8px; padding: 10px 15px; font-weight: 750; font-size: 12px;
}
.primary { color: white; background: var(--forest); box-shadow: 0 5px 14px rgba(23,63,55,.17); }
.primary:hover { background: var(--forest-2); }
.secondary { color: var(--forest); background: var(--lime); }
.ghost { color: var(--forest); background: #edf0ec; }
.danger { color: #8e2e28; background: #f8dedb; }
.primary:disabled, .secondary:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; }
.mobile-menu { display: none; }
.content { padding: 0 38px 50px; }

.tablet-production-mode .app-shell { display: block; min-height: 100vh; }
.tablet-production-mode .sidebar { display: none; }
.tablet-production-mode .mobile-menu { display: none !important; }
.tablet-production-mode .topbar {
  min-height: 86px;
  padding: 18px 30px;
  border-bottom: 1px solid var(--line);
  background: #f7faf4;
}
.tablet-production-mode .top-actions { display: none; }
.tablet-production-mode .content { padding: 22px 30px 42px; }
.tablet-production-mode h1 { font-size: clamp(30px, 4vw, 48px); }
.tablet-lock-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 12px;
  color: #edf5f0;
  background: var(--forest);
}
.tablet-lock-banner strong { font-size: 14px; }
.tablet-lock-banner span { color: #c4d5cf; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
.metric-card, .panel, .work-card, .person-card, .document-card {
  background: var(--white); border: 1px solid rgba(35,63,53,.08); border-radius: 13px; box-shadow: var(--shadow);
}
.metric-card { padding: 19px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -15px; bottom: -28px; width: 75px; height: 75px; border-radius: 50%; background: var(--accent, #edf1ea); opacity: .28; }
.portal-metric {
  width: 100%;
  border: 1px solid rgba(35,63,53,.08);
  text-align: left;
  color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.portal-metric:hover {
  transform: translateY(-2px);
  border-color: rgba(36,91,79,.24);
  box-shadow: 0 16px 38px rgba(32, 52, 44, 0.12);
}
.portal-metric:focus-visible {
  outline: 3px solid rgba(201,230,107,.8);
  outline-offset: 2px;
}
.metric-label { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { display: block; margin: 10px 0 4px; font: 500 29px Georgia, serif; }
.metric-note { color: var(--muted); font-size: 10px; }
.metric-card.alert .metric-value { color: #a5443c; }
.anchor-section { scroll-margin-top: 24px; }
.dashboard-grid { margin-top: 17px; display: grid; grid-template-columns: 1.35fr .85fr; gap: 17px; }
.panel { padding: 20px; }
.panel-head, .section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel h2, .section-head h2 { margin: 0; font: 500 19px Georgia, serif; }
.panel-head p, .section-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.text-button { padding: 0; border: 0; color: var(--forest-2); background: none; font-size: 11px; font-weight: 800; }
.danger-text { color: #9a342d; }
.admin-actions, .document-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-actions button, .document-actions button { padding: 7px 9px; font-size: 9px; }
.admin-document-actions { margin-top: 12px; justify-content: stretch; }
.admin-document-actions button { flex: 1; }
.state-admin-select {
  width: 100%;
  min-width: 145px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 9px;
  font-weight: 750;
}

.pipeline { display: grid; gap: 12px; }
.pipeline-row { display: grid; grid-template-columns: 112px 1fr 32px; gap: 12px; align-items: center; font-size: 11px; }
.pipeline-track { height: 7px; border-radius: 8px; background: #edf0ec; overflow: hidden; }
.pipeline-fill { height: 100%; min-width: 5px; border-radius: inherit; background: var(--color); }
.pipeline-count { text-align: right; font-weight: 800; }

.priority-list { display: grid; gap: 8px; }
.priority-item { padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.priority-item strong { display: block; font-size: 11px; }
.priority-item small { color: var(--muted); font-size: 9px; }
.priority-badge { align-self: center; padding: 4px 7px; border-radius: 12px; font-size: 8px; font-weight: 800; color: #8c3c35; background: #f9e2df; }

.toolbar { margin-bottom: 16px; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { min-height: 37px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.toolbar input { min-width: 240px; }
.work-list { display: grid; gap: 12px; }
.work-card { padding: 18px; }
.work-card-head { display: grid; grid-template-columns: 1.2fr .9fr 1fr auto; gap: 15px; align-items: center; }
.work-detail { overflow-x: auto; }
.work-code { font-size: 10px; color: var(--forest-2); font-weight: 850; letter-spacing: .07em; }
.work-card h3 { margin: 4px 0 0; font-size: 14px; }
.client-work-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  min-width: 210px;
}
.client-work-actions button,
.client-work-actions a {
  width: 100%;
  min-height: 38px;
  text-decoration: none;
  text-align: center;
}
.client-work-actions button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.client-work-detail {
  margin-top: 12px;
}
.meta-label { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.meta-value { font-size: 11px; font-weight: 700; }
.progress-wrap { min-width: 140px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 9px; color: var(--muted); }
.progress { height: 6px; background: #e8ede8; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--forest-2); border-radius: inherit; }
.order-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 10px; }
.order-table th { padding: 8px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 8px; text-transform: uppercase; }
.order-table td { padding: 10px 8px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
.order-table tr:last-child td { border-bottom: 0; }
.work-order-table { min-width: 1040px; }
.work-order-table th:nth-child(1) { width: 92px; }
.work-order-table th:nth-child(2) { width: 54px; }
.work-order-table th:nth-child(5) { width: 74px; }
.work-order-table th:nth-child(6) { width: 138px; }
.work-order-table th:nth-child(8) { width: 150px; }
.work-order-table th:nth-child(9) { width: 210px; }
.receipt-checks { display: grid; gap: 6px; min-width: 126px; }
.receipt-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.receipt-checks input { width: 14px; height: 14px; margin: 0; accent-color: var(--forest-2); }
.receipt-checks input:checked + span { color: var(--forest); }
.mini-status { display: inline-flex; padding: 5px 7px; border-radius: 8px; background: #f2f3f0; color: var(--muted); font-size: 9px; font-weight: 800; }
.mini-status.ok { background: var(--lime); color: var(--forest); }
.client-status-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}
.mini-doc-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--forest);
  background: #edf0ec;
  font-size: 8px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.mini-doc-link:hover { background: var(--lime); }
.row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 6px;
  min-width: 190px;
}
.row-button { width: 100%; padding: 7px 8px !important; font-size: 9px !important; text-align: center; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 14px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-awaiting_materials { color: #8a6330; background: #f8ecd8; }
.status-preparation { color: #446f94; background: #e3edf6; }
.status-upholstery { color: #765494; background: #eee5f6; }
.status-assembly { color: #347064; background: #dff0eb; }
.status-pending_delivery { color: #9b5b25; background: #fae7d5; }
.status-completed { color: #466d3d; background: #e2f0dc; }
.status-pending_invoice { color: #315e76; background: #deedf4; }
.status-invoiced { color: #59625f; background: #e9eceb; }

.board-tabs { display: flex; gap: 6px; margin-bottom: 15px; overflow-x: auto; }
.board-tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 10px; font-weight: 800; white-space: nowrap; }
.board-tab.active { color: white; border-color: var(--forest); background: var(--forest); }
.production-section-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}
.section-pill {
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--forest);
  background: white;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}
.section-pill.active {
  color: white;
  border-color: var(--forest);
  background: var(--forest);
  box-shadow: 0 8px 18px rgba(23,63,55,.16);
}
.production-toolbar { margin-bottom: 14px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 13px; align-items: start; }
.section-kiosk-kanban { grid-template-columns: minmax(320px, 1fr); }
.kanban-column { padding: 12px; border-radius: 12px; background: #e9ede8; min-height: 370px; }
.section-kiosk-kanban .kanban-column { padding: 18px; min-height: 560px; }
.tablet-production-mode .section-kiosk-kanban .kanban-column { min-height: calc(100vh - 235px); }
.column-head { display: flex; justify-content: space-between; padding: 4px 4px 12px; }
.column-head strong { font-size: 11px; }
.column-head span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: white; font-size: 9px; font-weight: 800; }
.kanban-card { margin-bottom: 9px; padding: 13px; border-radius: 9px; background: white; border-left: 3px solid var(--priority-color, var(--blue)); box-shadow: 0 4px 12px rgba(33,48,43,.06); }
.section-kiosk-kanban .kanban-card {
  display: grid;
  gap: 8px;
  padding: 19px;
  border-left-width: 6px;
  border-radius: 13px;
}
.kanban-card .code { color: var(--muted); font-size: 8px; font-weight: 800; }
.kanban-card h3 { margin: 5px 0 3px; font-size: 12px; }
.kanban-card p { min-height: 23px; margin: 0 0 10px; color: var(--muted); font-size: 9px; }
.section-kiosk-kanban .kanban-card .code { font-size: 11px; }
.section-kiosk-kanban .kanban-card h3 { font-size: 20px; }
.section-kiosk-kanban .kanban-card p { min-height: auto; font-size: 13px; line-height: 1.45; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid #edf0ed; font-size: 8px; color: var(--muted); }
.card-actions { display: flex; gap: 6px; margin-top: 10px; }
.card-actions button { flex: 1; padding: 7px; border: 0; border-radius: 6px; font-size: 8px; font-weight: 800; }
.section-kiosk-kanban .card-meta { font-size: 11px; }
.section-kiosk-kanban .card-actions { gap: 10px; }
.section-kiosk-kanban .card-actions button { min-height: 46px; padding: 11px 12px; border-radius: 10px; font-size: 12px; }
.tablet-production-mode .section-kiosk-kanban .kanban-card { padding: 22px; }
.tablet-production-mode .section-kiosk-kanban .card-actions button { min-height: 56px; font-size: 14px; }

.selection-layout { display: grid; grid-template-columns: 1fr 310px; gap: 16px; }
.selection-list { display: grid; gap: 8px; }
.select-row { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: white; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.select-row input { accent-color: var(--forest); }
.select-row strong, .select-row small { display: block; }
.select-row strong { font-size: 11px; }
.select-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.summary-box { position: sticky; top: 16px; padding: 18px; border-radius: 12px; color: white; background: var(--forest); }
.summary-box h3 { margin: 0 0 14px; font: 500 18px Georgia, serif; }
.summary-line { display: flex; justify-content: space-between; margin: 9px 0; font-size: 10px; color: #c3d4ce; }
.summary-total { padding-top: 13px; border-top: 1px solid rgba(255,255,255,.2); color: white; font-size: 13px; }
.summary-box button { width: 100%; margin-top: 14px; }
.settings-grid { align-items: start; margin-top: 0; }
.backup-panel { position: sticky; top: 18px; }
.backup-download { text-decoration: none; }
.storage-panel { margin-top: 16px; }
.mini-list { display: grid; gap: 10px; }
.mini-list div { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #f9faf8; }
.mini-list span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.mini-list strong { display: block; color: var(--ink); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.soft-separator { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.form-hint { margin: -4px 0 0; color: var(--muted); font-size: 10px; }

.people-grid, .documents-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 13px; }
.person-card, .document-card { padding: 17px; }
.user-admin-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.user-admin-actions .full-span { grid-column: 1 / -1; }
.qr-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbf7;
}
.qr-card img {
  width: min(320px, 100%);
  height: auto;
  border: 10px solid white;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(32, 52, 44, .08);
}
.qr-card p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.qr-download { text-decoration: none; }
.qr-scan-box {
  padding: 18px;
  border: 1px dashed var(--forest-2);
  border-radius: 14px;
  background: #f7faf4;
}
.qr-scan-box input {
  min-height: 58px;
  font-size: 18px;
  text-align: center;
  letter-spacing: .04em;
}
.qr-scan-box small {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--forest); background: var(--lime); font-weight: 900; }
.person-head { display: flex; gap: 11px; align-items: center; }
.person-card h3 { margin: 0 0 3px; font-size: 13px; }
.person-card p { margin: 0; color: var(--muted); font-size: 9px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.tag { padding: 5px 7px; border-radius: 6px; color: var(--forest-2); background: #e7efeb; font-size: 8px; font-weight: 750; }
.material-tags { margin: 8px 0 0; }
.tag.ok { color: var(--forest); background: var(--lime); }
.task-list { display: grid; gap: 6px; margin: 9px 0; }
.production-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}
.production-task strong { display: block; font-size: 9px; }
.production-task small { color: var(--muted); font-size: 8px; }
.production-task-done { background: #f1f7dc; border-color: #dcebad; }
.task-actions { display: flex; align-items: center; gap: 5px; }
.task-actions button { padding: 5px 7px; border-radius: 6px; font-size: 8px; }
.task-done { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--forest); background: var(--lime); font-weight: 900; }
.document-card .doc-code { color: var(--forest-2); font-size: 9px; font-weight: 900; }
.document-card h3 { margin: 7px 0 12px; font-size: 14px; }
.document-note { min-height: 30px; margin: 8px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.signed-status { color: var(--forest); }
.pending-signature { color: #9b5b25; }
.doc-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }

.customer-grid, .product-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 14px; }
.customer-card, .product-card { padding: 18px; background: white; border: 1px solid rgba(35,63,53,.08); border-radius: 13px; box-shadow: var(--shadow); }
.customer-card-head { display: flex; gap: 12px; align-items: center; }
.customer-card h3, .product-card h3 { margin: 4px 0 2px; font-size: 14px; }
.customer-card p, .product-card p { margin: 0; color: var(--muted); font-size: 9px; }
.contact-lines { display: grid; gap: 5px; margin: 16px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.customer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 13px 0; }
.customer-stats div { padding: 9px 6px; border-radius: 8px; text-align: center; background: #f2f5f1; }
.customer-stats strong, .customer-stats span { display: block; }
.customer-stats strong { font-size: 11px; }
.customer-stats span { margin-top: 3px; color: var(--muted); font-size: 7px; text-transform: uppercase; }
.full-button { width: 100%; margin-top: 5px; }
.product-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sale-price { color: var(--forest); font: 500 19px Georgia, serif; white-space: nowrap; }
.product-description { min-height: 32px; margin: 13px 0 !important; line-height: 1.5; }
.time-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 13px 0; }
.time-strip span { padding: 8px 5px; text-align: center; border-radius: 7px; color: var(--muted); background: #f0f3ef; font-size: 7px; }
.time-strip b { display: block; color: var(--ink); font-size: 11px; }
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cost-grid div { padding: 9px; border-radius: 8px; border: 1px solid var(--line); }
.cost-grid span, .cost-grid strong { display: block; }
.cost-grid span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.cost-grid strong { margin-top: 4px; font-size: 11px; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.detail-block { padding: 11px; border-radius: 8px; background: #f3f5f2; }
.detail-block.full { grid-column: 1 / -1; }
.detail-block span, .detail-block strong { display: block; }
.detail-block span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-block strong { margin-top: 4px; font-size: 10px; white-space: pre-line; }
.modal-stats { margin: 18px 0; }
.modal-costs { margin: 18px 0; }
.product-summary { margin-top: 18px; }
.inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px; border-radius: 9px; background: #f0f4f0; }
.inline-grid input { padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.quick-create { align-content: end; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-grid label { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f7f9f6; font-size: 9px; text-transform: none; letter-spacing: 0; }
.checkbox-grid input { width: auto; margin-right: 5px; accent-color: var(--forest); }
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.process-toggle { padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f6; color: var(--ink); font-size: 10px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.process-toggle input { width: auto; margin-right: 6px; accent-color: var(--forest); }
.signature-canvas {
  width: 100%;
  height: 190px;
  border: 1px dashed var(--forest-2);
  border-radius: 12px;
  background: #fff;
  touch-action: none;
}

.empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed #cbd4ce; border-radius: 12px; background: rgba(255,255,255,.55); }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: Georgia, serif; font-size: 18px; }
.loading { padding: 80px; text-align: center; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; padding: 20px; display: grid; place-items: center; background: rgba(12,28,23,.58); backdrop-filter: blur(3px); }
.modal-backdrop.hidden { display: none; }
.modal { width: min(820px, 100%); max-height: calc(100vh - 40px); overflow: auto; position: relative; padding: 26px; border-radius: 15px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.modal-close { position: absolute; top: 13px; right: 15px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f2ef; font-size: 20px; }
.modal h2 { margin: 0 0 5px; font: 500 24px Georgia, serif; }
.modal-subtitle { margin: 0 0 21px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select, .field textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; }
.field textarea { min-height: 72px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.item-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.item-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.item-editor-head h3 { margin: 0; font-size: 12px; }
.order-form-row { display: grid; grid-template-columns: 1.7fr .45fr .6fr .9fr .75fr auto; gap: 7px; margin-bottom: 7px; align-items: start; }
.order-form-row input, .order-form-row select { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.product-search-field { min-width: 0; }
.product-search-field input { width: 100%; }
.product-search-field small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.component-form-row { display: grid; grid-template-columns: 1fr 1.35fr .55fr .55fr .7fr auto; gap: 6px; margin-bottom: 7px; }
.component-form-row input, .component-form-row select { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; }
.remove-row { border: 0; border-radius: 7px; color: #a1433a; background: #f8e2df; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 18px 24px; border-left: 1px solid var(--line); }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--forest-2); }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item small { color: var(--muted); font-size: 8px; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; gap: 8px; }
.toast { min-width: 260px; padding: 12px 15px; border-radius: 9px; color: white; background: var(--forest); box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 10px; animation: toast-in .2s ease; }
.toast.error { background: #973e37; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.login-screen, .setup-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 20%, #315e52, #173f37 50%, #0f2d27); }
.setup-screen { z-index: 110; overflow: auto; align-items: start; }
.login-card, .setup-card { width: min(390px, 100%); padding: 34px; border-radius: 18px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.setup-card { width: min(860px, 100%); margin: 24px 0; }
.login-card .brand-mark { margin-bottom: 22px; }
.setup-card .brand-mark { margin-bottom: 22px; }
.login-card .login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}
.setup-card .login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}
.login-card h1 { margin-bottom: 8px; }
.setup-card h1 { margin-bottom: 8px; }
.login-card > p:not(.eyebrow), .setup-card > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.login-card form { display: grid; gap: 13px; }
.login-card .primary { width: 100%; margin-top: 5px; padding: 12px; }
.setup-card .primary { width: 100%; margin-top: 5px; padding: 12px; }
.login-error { margin: 0 !important; padding: 9px; border-radius: 7px; color: #8f352e !important; background: #f8dfdc; }
.pdf-link { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; border-radius: 6px; color: var(--forest); background: var(--lime); font-size: 8px; font-weight: 850; text-decoration: none; }
.document-download { display: inline-flex; margin-top: 10px; text-decoration: none; }
.pdf-document-link { color: inherit; text-decoration: none; }
.operator-queue { grid-template-columns: repeat(2, minmax(260px, 1fr)); }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(3, 290px); overflow-x: auto; padding-bottom: 8px; }
  .section-kiosk-kanban { grid-template-columns: minmax(320px, 1fr); overflow-x: visible; }
  .production-section-tabs { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .people-grid, .documents-grid { grid-template-columns: repeat(2, 1fr); }
  .customer-grid, .product-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; width: 238px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-block; margin-right: 8px; border: 0; background: transparent; font-size: 21px; }
  .topbar { min-height: 92px; padding: 18px; align-items: flex-start; }
  .topbar > div:first-child { display: flex; align-items: center; flex-wrap: wrap; }
  .eyebrow { width: calc(100% - 40px); }
  .top-actions { align-items: flex-end; }
  .session-user { min-width: 90px; }
  .session-user span { display: none; }
  .session-user strong { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #logout-button { display: none; }
  #new-work-order { font-size: 0; padding: 10px 12px; }
  #new-work-order::first-letter { font-size: 15px; }
  .content { padding: 0 18px 35px; }
  .metric-grid, .people-grid, .documents-grid { grid-template-columns: 1fr 1fr; }
  .work-card-head { grid-template-columns: 1fr 1fr; }
  .order-table { display: block; overflow-x: auto; }
  .selection-layout { grid-template-columns: 1fr; }
  .summary-box { position: static; }
}
@media (max-width: 470px) {
  .metric-grid, .people-grid, .documents-grid, .customer-grid, .product-grid, .form-grid { grid-template-columns: 1fr; }
  .production-section-tabs { grid-template-columns: 1fr; }
  .metric-card { padding: 15px; }
  .topbar h1 { font-size: 24px; }
  .work-card-head { grid-template-columns: 1fr; }
  .toolbar input { min-width: 100%; }
  .order-form-row { grid-template-columns: 1fr 1fr; }
  .component-form-row { grid-template-columns: 1fr 1fr; }
  .inline-grid, .detail-columns { grid-template-columns: 1fr; }
  .operator-queue { grid-template-columns: 280px 280px; overflow-x: auto; }
}

@media (max-width: 900px) {
  .tablet-production-mode .topbar { padding: 14px 18px; }
  .tablet-production-mode .content { padding: 16px 16px 32px; }
  .tablet-lock-banner { align-items: flex-start; flex-direction: column; }
  .section-kiosk-kanban .kanban-card h3 { font-size: 18px; }
}

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { background: #f6f8f3; }
  button, .primary, .secondary, .ghost, .danger, .pdf-link, .mini-doc-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    width: min(88vw, 330px);
    padding: 22px 18px;
    box-shadow: 18px 0 55px rgba(10, 30, 24, .24);
  }
  .brand { margin-bottom: 24px; }
  .nav-item {
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 14px;
  }
  .nav-item span { width: 34px; font-size: 20px; }
  .sidebar-foot { padding-top: 18px; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 78px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(35,63,53,.08);
    box-shadow: 0 8px 22px rgba(32,52,44,.05);
  }
  .topbar > div:first-child { min-width: 0; flex: 1; }
  .mobile-menu {
    width: 42px;
    height: 42px;
    margin-right: 9px;
    border-radius: 11px;
    color: var(--forest);
    background: white;
    box-shadow: 0 3px 10px rgba(32,52,44,.08);
  }
  .eyebrow {
    width: 100%;
    margin-top: 3px;
    font-size: 8px;
    letter-spacing: .12em;
  }
  .topbar h1 {
    width: calc(100vw - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 23px;
  }
  .top-actions {
    gap: 7px;
    align-self: center;
  }
  .session-user {
    display: none;
  }
  #logout-button {
    display: inline-flex;
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 0;
  }
  #logout-button::before {
    content: "↩";
    font-size: 18px;
  }
  #new-work-order {
    display: inline-flex;
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 0;
  }
  #new-work-order::before {
    content: "+";
    font-size: 22px;
    line-height: 1;
  }

  .content { padding: 14px 14px 32px; }
  .section-head, .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .panel h2, .section-head h2 { font-size: 21px; }
  .panel-head p, .section-head p { font-size: 12px; line-height: 1.35; }
  .text-button { min-height: 36px; font-size: 12px; }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric-card { padding: 15px; border-radius: 15px; }
  .metric-label { font-size: 8px; }
  .metric-value { margin: 8px 0 3px; font-size: 27px; }
  .metric-note { font-size: 9px; line-height: 1.25; }

  .dashboard-grid { gap: 12px; margin-top: 12px; }
  .panel, .work-card, .customer-card, .product-card, .person-card, .document-card {
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(32,52,44,.07);
  }
  .panel { padding: 16px; }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .toolbar input, .toolbar select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 15px;
    border-radius: 12px;
  }
  .meta-value { font-size: 12px; }

  .work-list { gap: 14px; }
  .work-card { padding: 15px; }
  .work-card-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .work-card h3 { font-size: 18px; }
  .client-work-actions {
    grid-template-columns: 1fr;
    min-width: 0;
    width: 100%;
  }
  .client-work-actions button,
  .client-work-actions a {
    min-height: 44px;
    border-radius: 12px;
    font-size: 12px;
  }
  .work-code { font-size: 11px; }
  .meta-label { font-size: 9px; }
  .progress-wrap { min-width: 0; width: 100%; }
  .progress { height: 9px; }
  .admin-actions, .document-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .admin-actions button, .document-actions button {
    min-height: 42px;
    font-size: 11px;
  }

  .order-table {
    display: table;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    overflow: visible;
  }
  .order-table thead { display: none; }
  .order-table tbody, .order-table tr, .order-table td {
    display: block;
    width: 100%;
  }
  .order-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
  }
  .order-table td {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #edf0ed;
    font-size: 12px;
  }
  .order-table td:last-child { border-bottom: 0; }
  .order-table td::before {
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(1)::before { content: "Pedido"; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(2)::before { content: "Cant."; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(3)::before { content: "Producto"; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(4)::before { content: "Tela"; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(5)::before { content: "Entrega"; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(6)::before { content: "Materiales"; }
  .order-table:not(.work-order-table):not(.component-table) td:nth-child(7)::before { content: "Estado"; }

  .work-order-table td:nth-child(1)::before { content: "Pedido"; }
  .work-order-table td:nth-child(2)::before { content: "Cant."; }
  .work-order-table td:nth-child(3)::before { content: "Producto"; }
  .work-order-table td:nth-child(4)::before { content: "Tela"; }
  .work-order-table td:nth-child(5)::before { content: "Entrega"; }
  .work-order-table td:nth-child(6)::before { content: "Recepción"; }
  .work-order-table td:nth-child(7)::before { content: "Responsable"; }
  .work-order-table td:nth-child(8)::before { content: "Estado"; }
  .work-order-table td:nth-child(9)::before { content: "Acciones"; }

  .component-table td:nth-child(1)::before { content: "Componente"; }
  .component-table td:nth-child(2)::before { content: "Tipo"; }
  .component-table td:nth-child(3)::before { content: "Cantidad"; }
  .component-table td:nth-child(4)::before { content: "Coste unit."; }
  .component-table td:nth-child(5)::before { content: "Total"; }

  .receipt-checks { min-width: 0; grid-template-columns: 1fr; }
  .receipt-checks label, .mini-status {
    min-height: 36px;
    justify-content: center;
    font-size: 10px;
  }
  .row-actions {
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .row-button { min-height: 40px; font-size: 11px !important; }
  .status { min-height: 30px; font-size: 9px; justify-content: center; }
  .client-status-cell { min-width: 0; align-items: stretch; }
  .client-status-cell .status, .client-status-cell .mini-doc-link { width: 100%; }

  .production-section-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .section-pill { min-height: 50px; font-size: 13px; }
  .kanban, .operator-queue {
    grid-template-columns: 1fr;
    overflow-x: visible;
    gap: 12px;
  }
  .kanban-column { min-height: auto; padding: 12px; }
  .column-head strong { font-size: 13px; }
  .column-head span { width: 27px; height: 27px; font-size: 11px; }
  .kanban-card { padding: 15px; border-radius: 13px; border-left-width: 5px; }
  .kanban-card .code { font-size: 10px; }
  .kanban-card h3 { font-size: 17px; }
  .kanban-card p { min-height: auto; font-size: 12px; line-height: 1.4; }
  .card-meta {
    align-items: flex-start;
    flex-direction: column;
    font-size: 11px;
  }
  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .card-actions button {
    min-height: 46px;
    font-size: 12px;
  }
  .production-task {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
  .production-task strong { font-size: 12px; }
  .production-task small { font-size: 10px; }
  .task-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .task-actions button { min-height: 42px; font-size: 11px; }

  .selection-layout { grid-template-columns: 1fr; gap: 12px; }
  .select-row {
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 14px;
    border-radius: 13px;
  }
  .select-row > strong,
  .select-row > .status {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .select-row strong { font-size: 13px; }
  .select-row small { font-size: 11px; line-height: 1.35; }
  .summary-box {
    position: static;
    border-radius: 16px;
  }
  .summary-line { font-size: 12px; }
  .summary-total { font-size: 15px; }

  .people-grid, .documents-grid, .customer-grid, .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .customer-card h3, .product-card h3, .document-card h3 { font-size: 17px; }
  .person-card h3 { font-size: 16px; }
  .contact-lines, .document-note { font-size: 11px; }
  .customer-stats strong { font-size: 14px; }
  .product-top {
    align-items: stretch;
    flex-direction: column;
  }
  .sale-price { font-size: 24px; }
  .time-strip { grid-template-columns: 1fr; }
  .time-strip span { font-size: 10px; }
  .time-strip b { font-size: 16px; }
  .cost-grid { grid-template-columns: 1fr 1fr; }
  .user-admin-actions { grid-template-columns: 1fr; }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }
  .modal {
    width: 100%;
    max-height: 94vh;
    padding: 22px 16px 18px;
    border-radius: 18px 18px 0 0;
  }
  .modal-close {
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  .modal h2 { padding-right: 44px; font-size: 25px; }
  .modal-subtitle { font-size: 12px; line-height: 1.35; }
  .form-grid, .inline-grid, .detail-columns {
    grid-template-columns: 1fr;
  }
  .field input, .field select, .field textarea {
    min-height: 46px;
    font-size: 15px;
    border-radius: 12px;
  }
  .field label { font-size: 10px; }
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .form-actions button, .form-actions a {
    width: 100%;
    min-height: 46px;
  }
  .order-form-row,
  .component-form-row {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfcfa;
  }
  .order-form-row input, .order-form-row select,
  .component-form-row input, .component-form-row select {
    min-height: 43px;
    font-size: 14px;
  }
  .process-grid { grid-template-columns: 1fr; }
  .checkbox-grid { display: grid; grid-template-columns: 1fr; }
  .checkbox-grid label, .process-toggle { min-height: 44px; font-size: 12px; }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast { min-width: 0; width: 100%; font-size: 12px; }

  .login-screen, .setup-screen { padding: 14px; }
  .login-card, .setup-card {
    padding: 26px 20px;
    border-radius: 20px;
  }
  .login-card h1, .setup-card h1 { font-size: 28px; }
}

@media (max-width: 470px) {
  .content { padding: 12px 10px 28px; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 10px; }
  .topbar h1 { width: calc(100vw - 132px); font-size: 21px; }
  .mobile-menu, #logout-button, #new-work-order {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }
  .order-table td {
    grid-template-columns: 92px 1fr;
    font-size: 11px;
  }
  .cost-grid, .customer-stats { grid-template-columns: 1fr; }
  .tablet-production-mode .content { padding: 12px 10px 24px; }
  .tablet-production-mode h1 { font-size: 24px; }
  .tablet-lock-banner { padding: 12px; }
}

/* Mobile header/menu: sober, aligned and closer to desktop */
@media (max-width: 760px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 12px 14px;
  }
  .topbar > div:first-child {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "menu eyebrow"
      "menu title";
    column-gap: 11px;
    align-items: center;
    min-width: 0;
  }
  .mobile-menu {
    grid-area: menu;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    border: 1px solid rgba(23,63,55,.12);
    border-radius: 12px;
    color: transparent;
    font-size: 0;
    background: #fff;
    box-shadow: 0 8px 20px rgba(32,52,44,.08);
  }
  .mobile-menu::before {
    content: "";
    display: block;
    width: 19px;
    height: 14px;
    border-radius: 999px;
    background:
      linear-gradient(var(--forest), var(--forest)) 0 0 / 19px 2px no-repeat,
      linear-gradient(var(--forest), var(--forest)) 0 6px / 19px 2px no-repeat,
      linear-gradient(var(--forest), var(--forest)) 0 12px / 19px 2px no-repeat;
    box-shadow: none;
  }
  .eyebrow {
    grid-area: eyebrow;
    width: auto;
    margin: 0;
    font-size: 8px;
    line-height: 1;
  }
  .topbar h1 {
    grid-area: title;
    width: auto;
    min-width: 0;
    margin-top: 3px;
    font-size: 22px;
    line-height: 1.05;
  }
  .top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
  }
  #logout-button {
    display: inline-flex;
    width: auto;
    min-width: 54px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(23,63,55,.10);
    border-radius: 12px;
    color: var(--forest);
    background: rgba(255,255,255,.88);
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 6px 16px rgba(32,52,44,.06);
  }
  #logout-button::before { content: none; }
  #new-work-order {
    display: inline-flex;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(23,63,55,.12);
    border-radius: 12px;
    color: white;
    background: var(--forest);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(23,63,55,.18);
  }
  #new-work-order::before,
  #new-work-order::first-letter {
    content: none;
    font-size: inherit;
  }

  .sidebar {
    width: min(86vw, 320px);
    padding: 28px 20px 22px;
    background: var(--forest);
  }
  .sidebar .brand { margin: 0 8px 34px; }
  .sidebar .brand strong { font-size: 17px; }
  .sidebar .brand span { font-size: 11px; }
  .nav-item {
    min-height: 44px;
    padding: 11px 13px;
    border: 0;
    border-radius: 9px;
    color: #bed0ca;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
  }
  .nav-item span { display: none; }
  .nav-item:hover,
  .nav-item.active {
    color: white;
    background: rgba(255,255,255,.10);
    box-shadow: none;
  }
  .nav-item.active::after {
    display: none;
    content: none;
  }
}

@media (max-width: 470px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px 10px;
    gap: 8px;
  }
  .topbar > div:first-child {
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 9px;
  }
  .mobile-menu {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .topbar h1 {
    width: auto;
    font-size: 20px;
  }
  #logout-button { display: none; }
  #new-work-order {
    min-height: 38px;
    padding: 0 11px;
    font-size: 10px;
  }
}
