:root {
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar-a: #111827;
  --sidebar-b: #0f172a;
  --text: #172033;
  --text-soft: #667085;
  --text-faint: #98a2b3;
  --border: #e6eaf0;
  --primary: #2563eb;
  --primary-soft: #eaf1ff;
  --success: #16a34a;
  --success-soft: #e9f8ef;
  --warning: #f59e0b;
  --warning-soft: #fff6df;
  --danger: #dc2626;
  --danger-soft: #feeeee;
  --violet: #7c3aed;
  --violet-soft: #f1ebff;
  --status-blue-text: #1d4ed8;
  --status-blue-bg: #eaf1ff;
  --status-violet-text: #6d28d9;
  --status-violet-bg: #f1ebff;
  --status-green-text: #15803d;
  --status-green-bg: #e9f8ef;
  --status-orange-text: #b45309;
  --status-orange-bg: #fff6df;
  --status-red-text: #b91c1c;
  --status-red-bg: #feeeee;
  --status-gray-text: #475467;
  --status-gray-bg: #eef1f5;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.06);
  --shadow-soft: 0 3px 14px rgba(16, 24, 40, 0.035);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: var(--primary);
}

.app-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.app-shell::before {
  content: "";
  display: none;
}

.mobile-menu-toggle,
.mobile-sidebar-close {
  display: none;
}

.mobile-nav-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px 16px 18px;
  color: #dbe4f0;
  background: linear-gradient(180deg, var(--sidebar-a), var(--sidebar-b));
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 22px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 12px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 18px;
  line-height: 1.15;
}

.sidebar-brand small {
  margin-top: 3px;
  color: #8290a6;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.sidebar-user-copy,
.topbar-user > span:last-child {
  min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy small,
.topbar-user strong,
.topbar-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  color: #f8fafc;
  font-size: 13px;
}

.sidebar-user-copy small {
  margin-top: 2px;
  color: #8491a5;
  font-size: 11px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section {
  padding: 13px 12px 6px;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar .nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #aab6c8;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar .nav-item i {
  width: 18px;
  font-size: 17px;
  text-align: center;
}

.sidebar .nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-item.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.94);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.theme-switch,
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  color: #9eabbf;
  background: transparent;
  font-size: 13px;
}

.theme-switch > span:first-child,
.sidebar-logout {
  gap: 10px;
}

.theme-switch input {
  display: none;
}

.switch-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 20px;
  background: #334155;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
}

.sidebar-logout {
  justify-content: flex-start;
  cursor: pointer;
}

.sidebar-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.app-main {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.mobile-menu-toggle {
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #475467;
  background: #fff;
  text-decoration: none;
}

.mobile-menu-toggle:hover {
  color: var(--primary);
  border-color: #bfd0f7;
  background: var(--primary-soft);
}

.mobile-menu-toggle i {
  display: none;
}

.mobile-menu-toggle::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.topbar-search {
  position: relative;
  width: min(430px, 40vw);
}

.topbar-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-faint);
  transform: translateY(-50%);
}

.topbar-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
}

.topbar-search input:focus {
  border-color: #93b4fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.topbar-actions,
.topbar-user {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 9px;
}

.topbar-icon {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #475467;
  background: #fff;
  text-decoration: none;
}

.topbar-icon:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.notification-count {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 0 0 3px #fff;
}

.topbar-user {
  max-width: 200px;
  gap: 9px;
  padding: 0 8px;
}

.small-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 12px;
}

.topbar-user strong {
  font-size: 12px;
}

.topbar-user small {
  color: var(--text-soft);
  font-size: 10px;
}

.topbar-create {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 15px;
  border-radius: 10px;
  font-weight: 600;
}

.content {
  min-height: calc(100vh - 72px);
  padding: 26px 30px 40px;
}

.auth-content {
  min-height: 100vh;
  padding: 24px;
}

.page-width {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.page-width.narrow {
  max-width: 980px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h1,
.form-page-heading h1,
.record-header h1 {
  margin: 3px 0 5px;
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
}

.section-heading p,
.form-page-heading p {
  margin: 0;
  color: var(--text-soft);
}

.section-heading > .btn,
.section-actions .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.section-actions,
.record-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-card {
  margin-bottom: 16px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.filter-card .form-label {
  margin-bottom: 5px;
}

.filter-card .btn {
  min-height: 40px;
}

.sticky-workbar {
  position: sticky;
  top: 72px;
  z-index: 900;
  margin: -2px 0 18px;
  padding: 2px 0 12px;
  background:
    linear-gradient(180deg, rgba(245, 247, 251, 0.98) 0%, rgba(245, 247, 251, 0.98) 84%, rgba(245, 247, 251, 0));
  backdrop-filter: blur(10px);
}

.sticky-workbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 222, 234, 0.9), transparent);
}

.sticky-workbar .section-heading {
  margin-bottom: 12px;
}

.sticky-workbar .filter-card {
  margin-bottom: 0;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.055);
}

.sticky-workbar .toolbar-actions,
.sticky-workbar .section-heading > .d-flex {
  align-items: center;
  justify-content: flex-end;
}

.list-card .data-card-header {
  min-height: 64px;
}

.header-symbol {
  color: #b4bdcb;
  font-size: 21px;
}

.table-primary-text {
  color: var(--text);
}

.table-action-cell {
  min-width: 118px;
}

.btn-transfer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bcd0fb;
  color: #1d4ed8;
  background: var(--primary-soft);
  white-space: nowrap;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

.btn-transfer:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.action-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.purchase-status-select {
  min-width: 148px;
  min-height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 11px;
}

.urgency-badge,
.warehouse-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.urgency-normal { color: #475467; background: #eef1f5; }
.urgency-urgent { color: #b45309; background: var(--warning-soft); }
.urgency-critical { color: #b91c1c; background: var(--danger-soft); }

.warehouse-badge {
  color: #1d4ed8;
  background: var(--primary-soft);
}

.stock-quantity {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.icon-action {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #667085;
  background: #fff;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.icon-action:hover {
  color: var(--primary);
  border-color: #bfd0f7;
  background: var(--primary-soft);
}

.icon-action.large {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.form-page-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  padding: 4px 0;
}

.form-page-heading > a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  margin-top: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #667085;
  background: #fff;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.form-page-heading > a:hover {
  color: var(--primary);
  border-color: #bfd0f7;
  background: var(--primary-soft);
  transform: translateX(-1px);
}

.form-page-heading > a i {
  display: none;
}

.form-page-heading > a::before {
  content: "\2190";
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.form-page-heading > div {
  min-width: 0;
}

.form-page-heading .page-eyebrow {
  margin-bottom: 2px;
}

.form-card {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.form-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #60a5fa 52%, rgba(37, 99, 235, 0));
}

.form-card > .row {
  padding: 24px 26px 6px;
}

.form-card .row.g-3 {
  --bs-gutter-x: 18px;
  --bs-gutter-y: 16px;
}

.form-card .form-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
  margin-bottom: 6px;
}

.form-card .form-label:has(+ .form-control[required])::after,
.form-card .form-label:has(+ .form-select[required])::after,
.form-card .form-label:has(+ textarea[required])::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.form-card .form-control,
.form-card .form-select {
  min-height: 42px;
  background-color: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-card .form-control:hover,
.form-card .form-select:hover,
.filter-card .form-control:hover,
.filter-card .form-select:hover {
  border-color: #c8d4e5;
}

.form-card .form-control[readonly],
.form-card .form-control:disabled,
.form-card .form-select:disabled {
  color: #667085;
  background: #f8fafc;
  border-style: dashed;
}

.form-card textarea.form-control {
  min-height: 104px;
  resize: vertical;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 18px 0 0;
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(10px);
}

.form-actions .btn {
  min-width: 112px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.record-header {
  min-height: 92px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,255,255,.9)),
    radial-gradient(circle at 4% 0%, rgba(37,99,235,.10), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(22,163,74,.08), transparent 28%);
  box-shadow: var(--shadow);
}

.record-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #60a5fa);
}

.record-title-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-title-block > div {
  min-width: 0;
}

.record-header h1 {
  max-width: 780px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 21px;
  letter-spacing: 0;
}

.record-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.record-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  border-radius: 15px;
  font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

.record-actions .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.record-actions form {
  display: inline-flex;
  margin: 0;
}

.record-header .text-muted {
  color: var(--text-soft) !important;
  font-size: 12px;
}

.content-panel {
  overflow: hidden;
}

.content-panel:hover {
  border-color: #dce4ef;
}

.content-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px !important;
  color: var(--text);
  font-size: 14px !important;
  font-weight: 700;
}

.content-panel h2::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 4px;
  background: var(--primary);
}

.content-panel dl dt,
.content-panel dl dd {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f6;
}

.content-panel dl dt {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.content-panel dl dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.content-panel dl dd a {
  text-decoration: none;
}

.route-table-wrap {
  margin: 0 -22px -22px;
}

.route-table-wrap .table thead th:first-child,
.route-table-wrap .table tbody td:first-child {
  padding-left: 22px;
}

.route-table-wrap .table thead th:last-child,
.route-table-wrap .table tbody td:last-child {
  padding-right: 22px;
}

.route-active-row {
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.workshop-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 170px;
}

.workshop-actions form {
  display: inline-flex;
}

.comment-cell {
  min-width: 180px;
}

.workshop-comment-form .form-control {
  min-width: 160px;
}

.route-timeline {
  display: grid;
  gap: 12px;
}

.route-timeline-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  position: relative;
}

.route-timeline-item::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 42px;
  bottom: -12px;
  width: 2px;
  background: #d9e1ec;
}

.route-timeline-item:last-child::before {
  display: none;
}

.route-timeline-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #64748b;
  background: #eef2f7;
  font-weight: 800;
  z-index: 1;
}

.route-timeline-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 24, 40, 0.035);
}

.route-timeline-item.active .route-timeline-card {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}

.route-timeline-item.active .route-timeline-marker,
.status-line-ready .route-timeline-marker {
  color: var(--status-blue-text);
  background: var(--status-blue-bg);
}

.status-line-in_progress .route-timeline-marker {
  color: var(--status-violet-text);
  background: var(--status-violet-bg);
}

.status-line-problem .route-timeline-marker {
  color: var(--status-red-text);
  background: var(--status-red-bg);
}

.status-line-done .route-timeline-marker {
  color: var(--status-green-text);
  background: var(--status-green-bg);
}

.status-line-paused .route-timeline-marker,
.status-line-waiting .route-timeline-marker,
.status-line-waiting_previous .route-timeline-marker {
  color: var(--status-orange-text);
  background: var(--status-orange-bg);
}

.route-timeline-top,
.route-timeline-meta,
.route-timeline-dates {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.route-timeline-top {
  justify-content: space-between;
  margin-bottom: 8px;
}

.route-timeline-meta,
.route-timeline-dates,
.route-timeline-card p {
  color: var(--text-soft);
  font-size: 12px;
}

.route-timeline-card p {
  margin: 8px 0 0;
}

.production-events {
  display: grid;
  gap: 0;
}

.production-event-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f6;
}

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

.production-event-item strong {
  display: block;
  font-size: 12px;
}

.production-event-item small {
  color: var(--text-soft);
  font-size: 11px;
}

.event-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.workshop-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.workshop-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workshop-kpi small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.workshop-kpi strong {
  font-size: 24px;
}

.workshop-kpi.danger strong {
  color: var(--danger);
}

.workshop-kpi.warning strong {
  color: #d97706;
}

.plan-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.plan-mode-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.plan-mode-switch a {
  text-decoration: none;
}

.plan-mode-switch span {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.plan-kpi {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 12px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.plan-kpi:hover,
.plan-kpi.active {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.plan-kpi span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}

.plan-kpi small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-kpi strong {
  font-size: 25px;
  line-height: 1;
}

.plan-kpi.danger span {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
}

.plan-kpi.warning span {
  color: #d97706;
  background: rgba(245, 158, 11, 0.14);
}

.plan-workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.plan-workshop-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
}

.plan-workshop-tile:hover {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.35);
  background: #f8fbff;
}

.plan-workshop-tile strong,
.plan-workshop-tile small {
  display: block;
}

.plan-workshop-tile small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 11px;
}

.plan-workshop-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

#workshop-steps-board {
  padding: 18px;
  overflow: hidden;
}

.workshop-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 16px;
  align-items: start;
}

.workshop-step-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid #cbd5e1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .06);
}

.workshop-step-card.status-line-ready {
  border-left-color: var(--status-blue-text);
}

.workshop-step-card.status-line-in_progress {
  border-left-color: var(--status-violet-text);
}

.workshop-step-card.status-line-problem {
  border-left-color: var(--status-red-text);
}

.workshop-step-card.status-line-paused {
  border-left-color: var(--status-orange-text);
}

.workshop-step-card.status-line-done {
  border-left-color: var(--status-green-text);
}

.workshop-step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.workshop-step-head > div {
  min-width: 0;
}

.workshop-step-head h3 {
  margin: 4px 0;
  font-size: 18px;
  line-height: 1.2;
}

.workshop-step-head p,
.workshop-step-meta,
.workshop-step-comment .form-label {
  color: var(--text-soft);
  font-size: 12px;
}

.workshop-order-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

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

.workshop-step-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.workshop-step-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.workshop-step-dates div {
  padding: 10px;
  border-radius: 12px;
  background: #f7f9fc;
}

.workshop-step-dates small {
  display: block;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.workshop-step-dates strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.workshop-step-issue {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 14px;
  background: rgba(254, 242, 242, 0.72);
}

.workshop-step-issue strong {
  font-size: 13px;
}

.workshop-step-issue p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.workshop-quantity-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
}

.quantity-head,
.quantity-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quantity-head span,
.quantity-grid small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quantity-grid > div {
  min-width: 0;
}

.quantity-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.workshop-quantity-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
}

.workshop-quantity-form .btn {
  width: 100%;
}

.quantity-mini {
  display: grid;
  gap: 4px;
  min-width: 90px;
}

.quantity-mini span {
  font-weight: 800;
  white-space: nowrap;
}

.quantity-mini small {
  font-size: 11px;
}

.material-inline-form {
  display: inline-grid;
  grid-template-columns: 86px auto;
  gap: 6px;
  align-items: center;
}

.receive-inline-form {
  display: inline-grid;
  grid-template-columns: minmax(120px, 150px) auto;
  gap: 6px;
  align-items: center;
}

.material-readiness-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 14px;
  color: #92400e;
  background: #fff7ed;
  font-weight: 700;
}

.material-readiness-alert i {
  color: #f59e0b;
}

.content-panel .table-responsive {
  margin-right: -22px;
  margin-left: -22px;
}

.content-panel .table-responsive .table thead th:first-child,
.content-panel .table-responsive .table tbody td:first-child {
  padding-left: 22px;
}

.content-panel .table-responsive .table thead th:last-child,
.content-panel .table-responsive .table tbody td:last-child {
  padding-right: 22px;
}

.content-panel .input-group-sm .form-control,
.content-panel .form-control-sm,
.content-panel .form-select-sm {
  min-height: 34px;
  font-size: 12px;
}

.quality-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 14px;
  background: #f8fbff;
}

.quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quality-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quality-head strong,
.quality-panel p {
  margin: 0;
  font-size: 12px;
}

.quality-panel p {
  color: var(--text-muted);
}

.quality-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  min-width: 0;
}

.quality-form select[name="decision"],
.quality-form select[name="rework_step_id"],
.quality-form input[name="comment"] {
  grid-column: span 2;
}

.quality-form .form-control,
.quality-form .form-select,
.workshop-quantity-form .form-control {
  min-width: 0;
}

.quality-form .btn {
  width: 100%;
}

.workshop-step-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.workshop-step-actions form {
  display: inline-flex;
}

.workshop-step-actions .issue-action-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) auto;
  gap: 6px;
  width: 100%;
}

.workshop-step-actions .btn {
  min-height: 38px;
  font-weight: 700;
}

.workshop-empty {
  grid-column: 1 / -1;
  min-height: 180px;
}

.nav-subitem {
  padding-left: 42px;
  font-size: 12px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-cell strong {
  color: var(--text);
}

.role-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #475467;
  background: #eef1f5;
  font-size: 10px;
  font-weight: 700;
}

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

.report-sections {
  display: grid;
  gap: 16px;
}

.report-section-card .table-responsive {
  max-height: 420px;
}

.report-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.report-card-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.report-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}

.report-list {
  padding: 6px 16px 10px;
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 35px;
  border-bottom: 1px solid #eff2f5;
  color: var(--text-soft);
  font-size: 11px;
}

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

.report-count {
  min-width: 28px;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-soft);
  text-align: center;
}

.notification-card {
  padding: 8px 20px;
}

.notification-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.notification-list {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.notification-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.notification-item.unread {
  border-color: rgba(37, 99, 235, .28);
  background: #f8fbff;
}

.notification-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
}

.notification-copy strong {
  display: block;
  font-size: 13px;
}

.notification-copy p {
  margin: 3px 0;
  color: var(--text-soft);
  font-size: 12px;
}

.notification-copy small {
  color: var(--text-soft);
  font-size: 11px;
}

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

.catalog-summary {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.catalog-summary > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
}

.qr-panel {
  position: sticky;
  top: 92px;
  text-align: center;
}

.qr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.equipment-qr {
  width: 190px;
  height: 190px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 6px #f8fafc;
  image-rendering: pixelated;
}

.qr-copy {
  display: grid;
  gap: 4px;
  margin: 10px 0 14px;
}

.qr-copy small {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 10px;
}

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

.equipment-summary-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.equipment-summary-grid small,
.equipment-summary-grid strong {
  display: block;
}

.equipment-summary-grid small {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}

.equipment-summary-grid strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-body {
  min-height: 100vh;
  padding: 28px;
  background: #eef2f7;
}

.equipment-label,
.checklist-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #111827;
}

.equipment-label {
  max-width: 520px;
}

.equipment-label-head,
.equipment-label-main,
.checklist-header,
.checklist-meta,
.checklist-sign {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.equipment-label-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #dbe3ef;
}

.equipment-label-main {
  align-items: flex-start;
  padding: 18px 0;
}

.equipment-label-main img,
.checklist-header img {
  width: 150px;
  height: 150px;
  image-rendering: pixelated;
}

.equipment-label h1,
.checklist-header h1 {
  margin: 0 0 12px;
  font-size: 22px;
}

.equipment-label dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  margin: 0;
}

.equipment-label dt,
.checklist-header span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.equipment-label dd {
  margin: 0;
}

.print-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.checklist-header {
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #dbe3ef;
}

.checklist-header p {
  margin: 0;
  color: #475569;
}

.checklist-meta,
.checklist-sign {
  margin: 18px 0;
  color: #334155;
  font-size: 13px;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.checklist-table th,
.checklist-table td {
  height: 42px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  vertical-align: top;
}

.checklist-table th {
  background: #f1f5f9;
}

.checklist-table th:nth-child(2),
.checklist-table th:nth-child(3),
.checklist-table td:nth-child(2),
.checklist-table td:nth-child(3) {
  width: 70px;
}

.catalog-summary strong,
.catalog-summary small {
  display: block;
}

.catalog-summary strong { font-size: 18px; line-height: 1; }
.catalog-summary small { margin-top: 3px; color: var(--text-soft); font-size: 10px; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.catalog-card {
  min-width: 0;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.catalog-card:hover {
  color: var(--text);
  border-color: #bfd0f7;
  transform: translateY(-2px);
}

.catalog-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 18px;
}

.catalog-icon.ppr {
  color: #15803d;
  background: var(--success-soft);
}

.catalog-copy {
  min-width: 0;
  flex: 1;
}

.catalog-copy strong,
.catalog-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-copy strong { font-size: 13px; }
.catalog-copy small { margin-top: 4px; color: var(--text-soft); font-size: 10px; }

.catalog-count {
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 9px;
  color: #475467;
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.catalog-card > .bi-arrow-right { color: var(--text-faint); }

.ppr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.ppr-toolbar form,
.ppr-legend {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ppr-toolbar form label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}

.ppr-toolbar form .form-control { width: 92px; }
.ppr-legend { color: var(--text-soft); font-size: 10px; }
.ppr-legend b { color: var(--primary); }

.ppr-panel { overflow: hidden; }

.ppr-table {
  min-width: 1320px;
  table-layout: fixed;
  font-size: 11px;
}

.ppr-table > :not(caption) > * > * {
  padding: 7px 5px;
  vertical-align: middle;
}

.ppr-name-col { width: 205px; }
.ppr-inventory-col { width: 86px; }
.ppr-small-col { width: 78px; text-align: center; }
.ppr-cycle-col { width: 160px; }
.ppr-month-col { width: 61px; text-align: center; }
.ppr-cell-form { margin: 0; }

.ppr-select {
  min-width: 50px;
  min-height: 30px;
  padding: 3px 19px 3px 5px;
  border-radius: 7px;
  font-size: 10px;
  background-position: right 4px center;
}

.ppr-print-value,
.print-title { display: none; }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 2px 0 5px;
  font-size: 25px;
  font-weight: 750;
}

.page-heading p {
  margin: 0;
  color: var(--text-soft);
}

.page-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  background: #fff;
  white-space: nowrap;
}

.director-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(0, 2fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.82)),
    radial-gradient(circle at 6% 0%, rgba(37,99,235,.13), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(16,185,129,.12), transparent 30%);
  box-shadow: var(--shadow);
}

.director-hero.danger {
  border-color: rgba(220, 38, 38, .22);
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.84)),
    radial-gradient(circle at 6% 0%, rgba(220,38,38,.13), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(245,158,11,.14), transparent 30%);
}

.director-hero.warning {
  border-color: rgba(245, 158, 11, .28);
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.84)),
    radial-gradient(circle at 6% 0%, rgba(245,158,11,.16), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(37,99,235,.10), transparent 30%);
}

.director-risk {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.director-risk-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.director-hero.danger .director-risk-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.director-hero.warning .director-risk-icon {
  color: #d97706;
  background: var(--warning-soft);
}

.director-risk small,
.director-focus-tile span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.director-risk strong {
  display: block;
  margin: 3px 0;
  font-size: 26px;
  line-height: 1.05;
}

.director-risk p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

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

.director-focus-tile {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.76);
  text-decoration: none;
}

.director-focus-tile:hover {
  color: var(--text);
  background: #fff;
}

.director-focus-tile strong {
  font-size: 24px;
  line-height: 1;
}

.director-focus-tile small {
  color: var(--text-soft);
  font-size: 11px;
}

.director-focus-tile.danger {
  border-color: rgba(220, 38, 38, .20);
  background: rgba(254, 242, 242, .78);
}

.director-focus-tile.warning {
  border-color: rgba(245, 158, 11, .24);
  background: rgba(255, 251, 235, .82);
}

.director-focus-tile.green {
  border-color: rgba(22, 163, 74, .18);
  background: rgba(240, 253, 244, .72);
}

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

.metric-card {
  min-width: 0;
  min-height: 132px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.metric-card::before {
  content: "";
  width: 4px;
  align-self: stretch;
  margin: -4px 0 -4px -4px;
  border-radius: 999px;
  background: transparent;
}

.metric-card-risk {
  border-color: rgba(220, 38, 38, .18);
  background: linear-gradient(180deg, #fff, #fff8f8);
}

.metric-card-risk::before {
  background: var(--danger);
}

.metric-card-ok {
  border-color: rgba(22, 163, 74, .16);
}

.metric-card-ok::before {
  background: var(--success);
}

.metric-card:hover {
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.09);
}

.metric-card-static:hover {
  transform: none;
}

.metric-copy small,
.metric-copy strong,
.metric-copy em {
  display: block;
}

.metric-copy small {
  color: var(--text-soft);
  font-weight: 600;
}

.metric-copy strong {
  margin: 8px 0 9px;
  font-size: 30px;
  line-height: 1;
}

.metric-copy em {
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.trend.positive { color: var(--success); }
.trend.negative { color: var(--danger); }
.trend.neutral { color: var(--text-faint); }

.metric-icon,
.header-icon,
.entity-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
}

.metric-icon {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.blue { color: var(--primary); background: var(--primary-soft); }
.green { color: var(--success); background: var(--success-soft); }
.orange, .warning { color: #d97706; background: var(--warning-soft); }
.violet { color: var(--violet); background: var(--violet-soft); }
.danger { color: var(--danger); background: var(--danger-soft); }

.director-hero.danger,
.director-hero.warning,
.director-hero.green {
  color: var(--text);
}

.director-hero.danger {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.84)),
    radial-gradient(circle at 6% 0%, rgba(220,38,38,.13), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(245,158,11,.14), transparent 30%);
}

.director-hero.warning {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.84)),
    radial-gradient(circle at 6% 0%, rgba(245,158,11,.16), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(37,99,235,.10), transparent 30%);
}

.director-focus-tile.danger,
.director-focus-tile.warning,
.director-focus-tile.green {
  color: var(--text);
}

.data-card,
.content-panel,
.login-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-card {
  min-width: 0;
  overflow: hidden;
}

.content-panel,
.login-panel {
  padding: 22px;
}

.settings-form {
  padding: 0 20px 20px;
}

.subtle-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

button.icon-action {
  border: 0;
}

button.icon-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

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

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

.role-matrix {
  display: grid;
}

.role-matrix-row {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) 1.5fr minmax(170px, .8fr);
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.role-matrix-row.head {
  color: var(--text-soft);
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-matrix-row strong,
.role-matrix-row small {
  display: block;
}

.role-matrix-row small {
  color: var(--text-soft);
  margin-top: 3px;
}

.inline-actions form {
  margin: 0;
}

.table-filter-row th {
  background: #fbfcfe;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.import-example {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text-soft);
  font-size: 12px;
}

.import-example code {
  color: var(--text);
  white-space: normal;
}

.long-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.test-question {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.test-question:first-child {
  padding-top: 0;
}

.test-question h2 {
  margin: 0 0 12px;
  font-size: 14px;
}

.test-answer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  color: var(--text);
  font-size: 13px;
}

.production-card {
  margin-bottom: 18px;
}

.pipeline-card {
  overflow: hidden;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pipeline-stage {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 16px 14px;
  border-right: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: #fff;
}

.pipeline-stage:last-child {
  border-right: 0;
}

.pipeline-stage:hover,
.pipeline-stage.active {
  color: var(--text);
  background: #f8faff;
}

.pipeline-stage span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pipeline-stage strong {
  font-size: 28px;
  line-height: 1;
}

.pipeline-stage small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.executive-brief {
  margin-bottom: 18px;
}

.executive-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.executive-tile {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: #fff;
}

.executive-tile:last-child {
  border-right: 0;
}

.executive-tile:hover {
  color: var(--text);
  background: #f8faff;
}

.executive-tile span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.executive-tile strong {
  font-size: 30px;
  line-height: 1;
}

.executive-tile small {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.executive-tile.danger strong {
  color: var(--danger);
}

.executive-tile.warning strong {
  color: #d97706;
}

.compact-table th,
.compact-table td {
  padding-inline: 12px;
}

.data-card-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.data-card-header.compact {
  min-height: 76px;
}

.data-card-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.data-card-header p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 11px;
}

.data-card-header > a {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-icon {
  width: 36px;
  height: 36px;
}

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

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

.table-modern th {
  padding: 10px 16px;
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table-modern td {
  padding: 13px 16px;
  border-top: 1px solid #edf0f4;
  color: #475467;
  vertical-align: middle;
}

.table-modern tbody tr:hover {
  background: #f8faff;
}

.table-modern td strong,
.table-modern td small {
  display: block;
}

.table-modern td strong {
  color: var(--text);
  font-size: 12px;
}

.table-modern td small {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 10px;
}

.table-link {
  font-weight: 700;
  text-decoration: none;
}

.table-compact {
  table-layout: auto;
  font-size: 12px;
}

.table-compact > :not(caption) > * > * {
  padding: 9px 12px;
}

.table-compact thead th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.table-compact tbody tr {
  height: 48px;
}

.table-compact td {
  color: #475467;
  vertical-align: middle;
}

.table-compact td small,
.table-compact .d-block.text-muted {
  margin-top: 3px;
  color: var(--text-faint) !important;
  font-size: 10px;
  line-height: 1.25;
}

.table-row-title {
  display: block;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
}

.table-row-title:hover,
.table-link:hover {
  color: var(--primary);
}

.cell-main {
  min-width: 190px;
  max-width: 340px;
  white-space: normal;
}

.cell-main-sm {
  min-width: 150px;
  max-width: 220px;
}

.cell-code,
.cell-date,
.cell-money,
.cell-number,
.cell-phone,
.cell-status,
.cell-actions,
.cell-workshop,
.cell-person,
.cell-email {
  white-space: nowrap;
}

.cell-code {
  width: 1%;
  color: #344054;
  font-variant-numeric: tabular-nums;
}

.cell-client,
.cell-person,
.cell-email,
.cell-workshop {
  max-width: 175px;
}

.cell-date {
  width: 1%;
  text-align: right;
  color: #667085;
  font-variant-numeric: tabular-nums;
}

.cell-money,
.cell-number {
  width: 1%;
  text-align: right;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cell-status {
  width: 1%;
}

.cell-actions {
  width: 1%;
  text-align: right;
}

.cell-progress {
  min-width: 128px;
  white-space: nowrap;
}

.text-clip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-orders .cell-main {
  min-width: 0;
  max-width: none;
}

.table-orders .cell-client {
  max-width: 170px;
}

.table-production .cell-main {
  min-width: 0;
  max-width: none;
}

.table-production .cell-main-sm {
  min-width: 0;
  max-width: none;
}

.table-clients .cell-main {
  min-width: 240px;
}

.table-orders,
.table-production {
  table-layout: fixed;
  width: 100%;
}

.table-orders .status-badge,
.table-production .status-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-orders th:nth-child(1),
.table-orders td:nth-child(1) { width: 9%; }
.table-orders th:nth-child(2),
.table-orders td:nth-child(2) { width: 12%; }
.table-orders th:nth-child(3),
.table-orders td:nth-child(3) { width: 19%; }
.table-orders th:nth-child(4),
.table-orders td:nth-child(4) { width: 11%; }
.table-orders th:nth-child(5),
.table-orders td:nth-child(5),
.table-orders th:nth-child(6),
.table-orders td:nth-child(6) { width: 8%; }
.table-orders th:nth-child(7),
.table-orders td:nth-child(7) { width: 13%; }
.table-orders th:nth-child(8),
.table-orders td:nth-child(8) { width: 12%; }
.table-orders th:nth-child(9),
.table-orders td:nth-child(9) { width: 9%; }
.table-orders th:nth-child(10),
.table-orders td:nth-child(10) { width: 8%; }
.table-orders th:nth-child(11),
.table-orders td:nth-child(11) { width: 11%; }

.table-production th:nth-child(1),
.table-production td:nth-child(1) { width: 8%; }
.table-production th:nth-child(2),
.table-production td:nth-child(2) { width: 9%; }
.table-production th:nth-child(3),
.table-production td:nth-child(3) { width: 18%; }
.table-production th:nth-child(4),
.table-production td:nth-child(4) { width: 13%; }
.table-production th:nth-child(5),
.table-production td:nth-child(5) { width: 10%; }
.table-production th:nth-child(6),
.table-production td:nth-child(6) { width: 9%; }
.table-production th:nth-child(7),
.table-production td:nth-child(7),
.table-production th:nth-child(8),
.table-production td:nth-child(8) { width: 13%; }
.table-production th:nth-child(9),
.table-production td:nth-child(9) { width: 11%; }
.table-production th:nth-child(10),
.table-production td:nth-child(10) { width: 7%; }
.table-production th:nth-child(11),
.table-production td:nth-child(11) { width: 4%; }

.table-production {
  table-layout: auto;
  min-width: 1180px;
}

.table-production th,
.table-production td {
  width: auto;
}

.table-production .cell-main {
  min-width: 190px;
  max-width: 250px;
}

.table-production .cell-main-sm {
  min-width: 150px;
  max-width: 210px;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.stage-badge {
  border: 1px solid transparent;
}

/* Unified status color map:
   blue = new/ready, violet = in work, green = done,
   orange = waiting/pause, red = problem/overdue, gray = closed/cancelled. */
.status-new,
.status-ready,
.status-request,
.status-offer,
.status-can_produce,
.status-available,
.status-reserved,
.status-released {
  color: var(--status-blue-text);
  background: var(--status-blue-bg);
}

.status-in_progress,
.status-in_production,
.status-working,
.status-repair,
.status-tech_review,
.status-to_production,
.status-invoice_received,
.status-rework,
.status-launched {
  color: var(--status-violet-text);
  background: var(--status-violet-bg);
}

.status-done,
.status-shipped,
.status-accepted,
.status-won,
.status-paid,
.status-approved,
.status-issued,
.status-posted,
.status-success,
.status-completed {
  color: var(--status-green-text);
  background: var(--status-green-bg);
}

.status-waiting,
.status-waiting_parts,
.status-waiting_previous,
.status-paused,
.status-due,
.status-review,
.status-ordered,
.status-warning,
.status-negotiation,
.status-planned,
.status-draft,
.status-route_ready,
.status-needs_clarification,
.status-client_approval,
.status-sent,
.status-partial,
.status-open,
.status-limited,
.status-maintenance,
.status-accepted_deviation {
  color: var(--status-orange-text);
  background: var(--status-orange-bg);
}

.status-problem,
.status-down,
.status-overdue,
.status-rejected,
.status-shortage,
.status-lost,
.status-cannot_produce,
.status-blocked,
.status-failed,
.status-scrap {
  color: var(--status-red-text);
  background: var(--status-red-bg);
}

.status-closed,
.status-cancelled,
.status-reserve,
.status-lead,
.status-decommissioned {
  color: var(--status-gray-text);
  background: var(--status-gray-bg);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-mini {
  width: 90px;
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #e9edf3;
}

.progress-mini span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.entity-list {
  padding: 4px 18px 8px;
}

.entity-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid #edf0f4;
  color: var(--text);
  text-decoration: none;
}

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

.entity-row:hover {
  color: var(--text);
  background: #fafbfe;
}

.entity-row > .bi-chevron-right {
  margin-left: auto;
  color: var(--text-faint);
}

.entity-icon {
  width: 34px;
  height: 34px;
}

.entity-copy {
  min-width: 0;
  flex: 1;
}

.entity-copy strong,
.entity-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-copy strong {
  font-size: 12px;
}

.entity-copy small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 10px;
}

.date-box {
  width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 5px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  text-align: center;
}

.date-box strong,
.date-box small {
  display: block;
  line-height: 1;
}

.date-box small {
  font-size: 8px;
}

.priority-marker {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.priority-low { background: #94a3b8; }
.priority-medium { background: var(--primary); }
.priority-high { background: var(--warning); }
.priority-urgent { background: var(--danger); }

.empty-state {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 12px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 12px 0 12px 24px;
  border-top: 0;
  color: var(--text);
  font-size: 13px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 31px;
  bottom: -8px;
  width: 1px;
  background: #e3e8f0;
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item .small,
.comment-item .small {
  color: var(--text-soft) !important;
  font-size: 11px;
  font-weight: 700;
}

.comment-item {
  padding: 12px 0;
  border-top: 1px solid #eef2f6;
}

.comment-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.list-group-flush .list-group-item {
  border-color: #eef2f6;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.list-group-flush .list-group-item:hover {
  color: var(--primary);
  background: #f8fbff;
}

.content-panel a.d-block.small,
.data-card a.d-block.small {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

/* Existing pages inherit the new visual language without changing behavior. */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f8faff;
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 11px 12px;
  border-bottom-color: #edf0f4;
}

.table thead th {
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.table a {
  font-weight: 600;
  text-decoration: none;
}

.table.table-compact {
  font-size: 12px;
}

.table.table-compact > :not(caption) > * > * {
  padding: 9px 12px;
}

.table.table-compact thead th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.table.table-compact tbody tr {
  height: 48px;
}

.form-control,
.form-select {
  min-height: 40px;
  border-color: var(--border);
  border-radius: 10px;
  font-size: 13px;
}

.form-control:focus,
.form-select:focus {
  border-color: #93b4fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.btn {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #1d4ed8;
  background: #1d4ed8;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.btn-outline-primary {
  border-color: #bcd0fb;
  color: #1d4ed8;
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.15);
}

.btn-outline-secondary,
.btn-light {
  border-color: #d8dee8;
  color: #475467;
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-light:hover,
.btn-outline-secondary:focus,
.btn-light:focus {
  border-color: #b8c3d4;
  color: var(--text);
  background: #f8fafc;
}

.btn:active {
  transform: translateY(1px);
}

.login-wrap {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.route-status-select {
  min-width: 150px;
}

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

  .director-hero {
    grid-template-columns: 1fr;
  }

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

  .topbar-user {
    display: none;
  }

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

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

@media (max-width: 991.98px) {
  :root { --sidebar-width: 78px; }

  .sidebar {
    padding-inline: 12px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0;
  }

  .sidebar-brand > span:last-child,
  .sidebar-user-card,
  .nav-section,
  .sidebar .nav-item span,
  .theme-switch,
  .sidebar-logout span {
    display: none;
  }

  .sidebar .nav-item,
  .sidebar-logout {
    justify-content: center;
  }

  .topbar {
    padding-inline: 18px;
  }

  .sticky-workbar {
    top: 72px;
    padding-bottom: 10px;
  }

  .content {
    padding-inline: 18px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .executive-tile {
    border-bottom: 1px solid var(--border);
  }

  .section-heading,
  .record-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-actions {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  :root { --sidebar-width: 0px; }

  .app-shell:has(.mobile-nav-toggle:checked)::before {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: block;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
  }

  .sidebar {
    z-index: 1050;
    width: min(88vw, 340px);
    padding: 18px 16px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.26);
  }

  .mobile-nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-close {
    position: absolute;
    top: 18px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: #dbe4f0;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
  }

  .mobile-sidebar-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-sidebar-close i {
    display: none;
  }

  .mobile-sidebar-close::before,
  .mobile-sidebar-close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .mobile-sidebar-close::before {
    transform: rotate(45deg);
  }

  .mobile-sidebar-close::after {
    transform: rotate(-45deg);
  }

  .sidebar-brand {
    justify-content: flex-start;
    padding-right: 46px;
  }

  .sidebar-brand > span:last-child,
  .sidebar-user-card,
  .nav-section,
  .sidebar .nav-item span,
  .theme-switch,
  .sidebar-logout span {
    display: flex;
  }

  .sidebar-brand > span:last-child {
    display: block;
  }

  .nav-section {
    display: block;
  }

  .sidebar-user-card {
    display: flex;
  }

  .sidebar .nav-item,
  .sidebar-logout {
    justify-content: flex-start;
  }

  .sidebar .nav-item span {
    display: inline;
  }

  .theme-switch {
    display: flex;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .mobile-menu-toggle {
    display: grid;
  }

  .topbar-search {
    width: 100%;
    flex: 1 0 100%;
    order: 2;
  }

  .topbar-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .topbar-icon {
    width: 36px;
    height: 36px;
  }

  .topbar-create {
    position: relative;
    min-width: 40px;
    width: 40px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .topbar-create i {
    display: none;
    color: #fff;
    margin-right: -7px;
  }

  .topbar-create::before {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
  }

  .content {
    padding: 18px 12px 30px;
  }

  .sticky-workbar {
    position: static;
    margin-bottom: 16px;
    padding-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .sticky-workbar::after {
    display: none;
  }

  .sticky-workbar .section-heading {
    margin-bottom: 14px;
  }

  .page-heading {
    display: block;
  }

  .dashboard-date {
    margin-top: 12px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .director-risk {
    align-items: flex-start;
  }

  .director-focus-grid {
    grid-template-columns: 1fr;
  }

  .executive-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .plan-kpi-grid {
    grid-template-columns: 1fr;
  }

  .executive-tile {
    border-right: 0;
  }

  .pipeline-stage {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .section-heading h1,
  .form-page-heading h1 {
    font-size: 21px;
  }

  .section-actions,
  .record-actions {
    width: 100%;
  }

  .section-actions .btn,
  .record-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .record-header h1 {
    white-space: normal;
  }

  .record-icon {
    display: none;
  }

  .qr-panel {
    position: static;
  }

  .form-card {
    padding: 0;
  }

  .form-card > .row {
    padding: 20px 18px 4px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
    margin: 16px 0 0;
    padding: 14px 18px;
  }

  .form-actions .btn {
    width: 100%;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .ppr-toolbar,
  .ppr-legend {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-card {
    min-height: 116px;
  }

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

  .workshop-step-grid {
    grid-template-columns: 1fr;
  }

  .workshop-step-head,
  .route-timeline-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .workshop-step-meta,
  .workshop-step-dates {
    grid-template-columns: 1fr;
  }

  .workshop-step-actions .btn,
  .workshop-step-actions form {
    width: 100%;
  }

  .workshop-step-actions .issue-action-form {
    grid-template-columns: 1fr;
  }

  .workshop-quantity-form {
    grid-template-columns: 1fr 1fr;
  }

  .quality-form {
    grid-template-columns: 1fr;
  }

  .quality-form select[name="decision"],
  .quality-form select[name="rework_step_id"],
  .quality-form input[name="comment"] {
    grid-column: auto;
  }

  .route-timeline-item {
    grid-template-columns: 34px 1fr;
  }

  .route-timeline-marker {
    width: 34px;
    height: 34px;
  }

  .route-timeline-item::before {
    left: 16px;
  }
}

@media print {
  @page { size: landscape; margin: 8mm; }

  .sidebar,
  .topbar,
  .no-print,
  .alert { display: none !important; }

  .app-main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .page-width { max-width: none !important; }
  .print-title { display: block; margin-bottom: 8px; }
  .print-title h1 { margin: 0; font-size: 14px; }
  .ppr-panel { border: 0; box-shadow: none; overflow: visible; }
  .ppr-table { width: 100%; min-width: 0; font-size: 7px; }
  .ppr-table > :not(caption) > * > * { padding: 2px; border-color: #777; }
  .ppr-name-col { width: 24mm; }
  .ppr-inventory-col { width: 12mm; }
  .ppr-small-col { width: 12mm; }
  .ppr-cycle-col { width: 22mm; }
  .ppr-month-col { width: 8mm; }
  .ppr-print-value { display: inline; }

  .print-body {
    padding: 0 !important;
    background: #fff !important;
  }

  .equipment-label,
  .checklist-page {
    max-width: none;
    border: 0;
    box-shadow: none;
  }

  .equipment-label {
    max-width: 110mm;
    border: 1px solid #777;
  }
}
