@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@500;600;700;800&display=swap");

:root {
  --bg-1: #f3f5f8;
  --bg-2: #fafbfc;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --text: #1a1a1a;
  --muted: #5f6c7c;
  --sidebar: #111827;
  --accent: #f27a1a;
  --green: #11a34d;
  --green-soft: #dff7ea;
  --warn: #f2b302;
  --warn-soft: #fff4d7;
  --danger: #e33b45;
  --danger-soft: #ffe6e8;
  --radius: 18px;
  --blur: none;
  --shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  --mobile-tabbar-h: 74px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img,
svg,
canvas,
video,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

textarea {
  resize: vertical;
}

.main > *,
.content > *,
.card > *,
.topbar > *,
.head > *,
.planning-layout > *,
.report-main-grid > * {
  min-width: 0;
}

.report-shell {
  display: grid;
  gap: 18px;
}

.report-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 16px;
  align-items: center;
}

.report-hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.report-hero-logo {
  width: 210px;
  max-width: 32vw;
  object-fit: contain;
}

.report-hero-brand h3 {
  margin: 0 0 6px;
  font-size: 28px;
}

.report-hero-brand p {
  margin: 0;
  color: #64748b;
}

.report-date-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.report-date-switch strong {
  font-size: 16px;
}

.report-action-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-secondary-btn {
  border-color: #dbe2ee;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

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

.report-kpi-card .sub {
  margin-top: 10px;
}

.report-green-bar {
  margin-top: 12px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.report-green-bar.large {
  height: 18px;
}

.report-green-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 48%, #84cc16 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.report-main-grid {
  align-items: start;
}

.report-flow-summary {
  margin-bottom: 14px;
}

.report-day-summary {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fbfefc 0%, #f3fbf5 100%);
}

.report-day-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-day-summary-head strong {
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-project-row {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.report-quick-list {
  gap: 10px;
}

.report-project-quick-row {
  padding: 14px 16px;
}

.report-project-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.report-project-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  color: #475569;
  font-size: 13px;
}

.report-project-mini-stats strong {
  color: #0f172a;
}

.report-plan-group {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.report-plan-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.report-plan-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-plan-item {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dbe2ee;
  background: #f8fafc;
}

.report-plan-item strong {
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-plan-item span {
  color: #475569;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-project-card {
  overflow: hidden;
}

.report-project-inline-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.report-project-inline-stats > div {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 10px;
  min-width: 0;
}

.report-project-inline-stats span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 700;
}

.report-project-inline-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-group-grid {
  margin-top: 4px;
}

.report-group-tile {
  min-height: 180px;
}

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

.report-preview-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.report-preview-panel-head h3 {
  margin: 0 0 4px;
}

.report-preview-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-preview-panel-note {
  margin-top: -2px;
}

.report-preview-canvas {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid #e2e8f0;
  overflow: auto;
}

.report-preview-sheet {
  width: min(794px, 100%);
  min-height: 1123px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.report-preview-sheet[data-mode="endday"] {
  width: min(1123px, 100%);
  min-height: 794px;
  padding: 24px 26px;
  border-radius: 24px;
}

.report-preview-sheet[data-mode="endday"] .report-preview-head {
  padding: 10px 14px;
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 54%, #ef4444 100%);
  border: 1px solid #7f1d1d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.report-preview-sheet[data-mode="endday"] .report-preview-logo {
  width: 128px;
  max-width: 20vw;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  padding: 6px 8px;
}

.report-preview-sheet[data-mode="endday"] .report-preview-title-block h2 {
  font-size: 17px;
  color: #fff7f7;
}

.report-preview-sheet[data-mode="endday"] .report-preview-meta {
  min-width: 190px;
}

.report-preview-sheet[data-mode="endday"] .report-preview-meta strong {
  font-size: 15px;
  color: #fff3bf;
}

.report-preview-sheet[data-mode="endday"] .report-preview-meta span {
  font-size: 10px;
  color: rgba(255, 247, 247, 0.92);
}

.report-preview-sheet[data-mode="endday"] .report-preview-meta-user {
  color: #ffffff;
}

.report-preview-sheet[data-mode="endday"] .report-preview-section {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.report-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8ef 0%, #f8fbf5 100%);
  border: 1px solid #e8edf4;
}

.report-preview-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.report-preview-logo {
  width: 138px;
  max-width: 28vw;
  object-fit: contain;
  flex: 0 0 auto;
}

.report-preview-title-block {
  text-align: center;
  width: 100%;
}

.report-preview-title-block h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.report-preview-title-block p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.report-preview-title-block p,
.report-preview-meta span,
.report-preview-section-head p,
.report-preview-job-line span,
.report-preview-mold-head span,
.report-preview-project-head span,
.report-preview-event-row span,
.report-preview-stat-card span,
.report-preview-stat-card small,
.report-preview-empty,
.report-preview-footnote {
  color: #5b6b81;
}

.report-preview-meta {
  text-align: right;
  min-width: 170px;
}

.report-preview-meta strong {
  display: block;
  font-size: 16px;
  color: #f59e0b;
  margin-bottom: 4px;
}

.report-preview-meta span {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}

.report-preview-meta-user {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.report-preview-summary-strip {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #dbe2ee;
  background: #fff;
}

.report-preview-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.report-preview-summary-strip > span {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.report-preview-stat-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 0;
}

.report-preview-stat-topline strong {
  margin: 0;
  font-size: 20px;
  color: #16a34a;
}

.report-preview-stat-topline small {
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

.report-green-bar.compact {
  margin-top: 1px;
  height: 5px;
}

.report-preview-stat-topline small {
  font-size: 12px;
  line-height: 1.25;
}

.report-preview-section {
  margin-top: 18px;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.report-preview-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.report-preview-section-head strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
  color: #0f172a;
}

.report-preview-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe2ee;
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.report-preview-mold-list,
.report-preview-project-list,
.report-preview-event-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.report-preview-daily-rows {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.report-preview-daily-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.report-preview-group-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dbe2ee;
  background: #f8fafc;
  height: 100%;
}

.report-preview-group-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.report-preview-group-card-head strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.report-preview-group-card-head span {
  color: #5b6b81;
  font-size: 12px;
}

.report-preview-mold-card,
.report-preview-project-card,
.report-preview-event-row {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dbe2ee;
  background: #f8fafc;
}

.report-preview-mold-head,
.report-preview-project-head,
.report-preview-event-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.report-preview-endday-project-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.report-preview-endday-project {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dbe2ee;
  background: #f8fafc;
}

.report-preview-endday-project-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.report-preview-endday-project-head strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.report-preview-endday-project-head span {
  color: #5b6b81;
  font-size: 12px;
}

.report-preview-endday-summary-wrap {
  margin-top: 10px;
  overflow: hidden;
  border: 1.8px solid #0f172a;
  border-radius: 16px;
  background: #ffffff;
}

.report-preview-endday-fit {
  margin-top: 0;
  height: var(--fit-height, auto);
  overflow: hidden;
}

.report-preview-endday-fit-inner {
  width: var(--fit-width, 100%);
  transform-origin: top left;
  transform: scale(var(--fit-scale, 1));
}

.report-preview-sheet[data-mode="endday"] .report-preview-endday-summary-wrap {
  margin-top: 0;
}

.report-preview-endday-summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
}

.report-preview-endday-summary-table th,
.report-preview-endday-summary-table td {
  padding: 1px 2px;
  border: 0;
  border-right: 0.15px solid rgba(15, 23, 42, 0.22);
  border-bottom: 0.15px solid rgba(15, 23, 42, 0.22);
  font-size: 5px;
  vertical-align: middle;
  color: #0f172a;
  text-align: center;
}

.report-preview-sheet[data-mode="endday"] .report-preview-endday-summary-table th,
.report-preview-sheet[data-mode="endday"] .report-preview-endday-summary-table td {
  padding: 2px 3px;
  font-size: 6px;
}

.report-preview-endday-summary-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.report-preview-endday-summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.report-preview-endday-summary-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

.report-preview-endday-summary-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.report-preview-endday-summary-table th:last-child,
.report-preview-endday-summary-table td:last-child {
  border-right: 0;
}

.report-preview-endday-matrix-table {
  table-layout: fixed;
}

.report-preview-endday-matrix-table td:nth-child(1),
.report-preview-endday-matrix-table th:nth-child(1) {
  text-align: center;
  width: 4%;
}

.report-preview-endday-matrix-table td:nth-child(2),
.report-preview-endday-matrix-table th:nth-child(2) {
  width: 16%;
}

.report-preview-endday-matrix-table td:nth-child(3),
.report-preview-endday-matrix-table th:nth-child(3) {
  width: 5.8%;
  padding-left: 1px;
  padding-right: 1px;
}

.report-preview-endday-matrix-table td:nth-last-child(1),
.report-preview-endday-matrix-table th:nth-last-child(1) {
  text-align: center;
  width: 5%;
}

.report-preview-endday-matrix-table th {
  font-size: 4px;
  line-height: 1;
  word-break: break-word;
}

.report-preview-sheet[data-mode="endday"] .report-preview-endday-matrix-table th {
  font-size: 5px;
}

.report-preview-endday-project-cell {
  text-align: left !important;
  vertical-align: top !important;
  background: #f8fafc !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.report-preview-endday-project-title-row {
  display: block;
  margin-bottom: 3px;
}

.report-preview-endday-project-title {
  font-weight: 700;
  font-size: 8.8px;
  line-height: 1.02;
  color: #0f172a;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-preview-endday-project-pct {
  display: block;
  color: #0f172a;
  font-size: 6.9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-align: right;
}

.report-preview-endday-project-meta {
  font-size: 8px;
  line-height: 1.1;
  color: #64748b;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-preview-endday-summary-bar {
  margin-top: 1px;
}

.report-preview-endday-row-label {
  text-align: left !important;
  font-weight: 700;
  color: #475569;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 4.8px;
  line-height: 1.02;
}

.report-preview-endday-matrix-cell {
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
  font-size: 5px;
  line-height: 1;
}

.report-preview-endday-matrix-cell.empty {
  color: #cbd5e1;
  font-weight: 400;
}

.report-preview-endday-matrix-cell.filled,
.report-preview-endday-row-total {
  color: #0f172a;
}

.report-preview-endday-matrix-cell.complete,
.report-preview-endday-row-total.complete {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.report-preview-endday-matrix-cell.tick,
.report-preview-endday-row-total.tick {
  font-size: 6px;
  letter-spacing: -0.02em;
}

.report-preview-endday-matrix-cell.status-red,
.report-preview-endday-row-total.status-red {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.report-preview-endday-matrix-cell.status-yellow,
.report-preview-endday-row-total.status-yellow {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
}

.report-preview-endday-row-total {
  background: #f8fafc;
}

.report-preview-endday-event-row td {
  background: #fffdf7;
}

.report-preview-endday-notes {
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fffbeb;
}

.report-preview-endday-notes strong {
  display: block;
  margin-bottom: 2px;
  font-size: 5px;
  color: #92400e;
}

.report-preview-endday-notes-list {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-preview-endday-note-item {
  display: grid;
  gap: 1px;
  padding: 3px 4px;
  border: 0.6px solid #f3e3b3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.report-preview-endday-note-item.note-warn {
  border-color: #f6d78f;
  background: #fff7dd;
}

.report-preview-endday-note-item.note-danger {
  border-color: #fecaca;
  background: #fff1f2;
}

.report-preview-endday-note-item.note-danger-soft {
  border-color: #fbcfe8;
  background: #fff1f2;
}

.report-preview-endday-note-item.note-slate {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.report-preview-endday-note-item strong {
  margin-bottom: 0;
  font-size: 4.8px;
  font-weight: 800;
  color: #92400e;
}

.report-preview-endday-note-meta {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  align-items: baseline;
}

.report-preview-endday-note-meta span {
  font-size: 4px;
  color: #8a6a2f;
}

.report-preview-endday-note-meta b {
  font-size: 4.2px;
  color: #5b4220;
  text-align: right;
}

.report-preview-endday-note-item p {
  margin: 0;
  font-size: 4.4px;
  line-height: 1.05;
  color: #5b6b81;
}

.report-preview-endday-table-wrap {
  margin-top: 10px;
}

.report-preview-endday-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}

.report-preview-endday-table th,
.report-preview-endday-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  text-align: left;
}

.report-preview-endday-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.report-preview-endday-table td {
  color: #0f172a;
}

.report-preview-endday-table tbody tr:last-child td {
  border-bottom: 0;
}

.report-preview-endday-table td:not(:first-child),
.report-preview-endday-table th:not(:first-child) {
  text-align: center;
  width: 14%;
}

.report-preview-endday-empty-cell,
.report-preview-endday-more-cell {
  color: #5b6b81;
  text-align: center !important;
}

.report-preview-job-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.report-preview-mold-compact-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.report-preview-mold-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
}

.report-preview-mold-line strong {
  color: #0f172a;
  white-space: nowrap;
}

.report-preview-mold-line span {
  color: #475569;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-preview-job-line {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.report-preview-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.report-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dbe2ee;
  background: #fff;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.report-preview-empty {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.report-preview-empty.compact {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12px;
}

.report-preview-footnote {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  text-align: right;
}

.report-preview-sheet[data-mode="endday"] {
  position: relative;
  overflow: hidden;
  padding-bottom: 58px;
}

.report-preview-sheet[data-mode="endday"] .report-preview-footnote {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 10px;
  margin-top: 0;
  padding-top: 4px;
  gap: 8px;
}

.report-preview-footnote-text {
  margin-left: auto;
  color: #5b6b81;
}

.report-preview-footer-qr {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.report-preview-footer-qr img {
  width: 56px;
  height: 56px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #dbe2ee;
  background: #fff;
  object-fit: cover;
}

.report-preview-sheet[data-mode="endday"] .report-preview-footer-qr img {
  width: 40px;
  height: 40px;
  padding: 2px;
}

.report-preview-footer-qr span {
  display: block;
  font-size: 10px;
  line-height: 1.25;
  color: #5b6b81;
  text-align: left;
}

.report-preview-sheet[data-mode="endday"] .report-preview-footer-qr span,
.report-preview-sheet[data-mode="endday"] .report-preview-footnote-text {
  font-size: 8px;
}

.report-preview-sheet.dense-compact {
  padding: 24px;
}

.report-preview-sheet.dense-compact .report-preview-head {
  padding: 10px 14px;
}

.report-preview-sheet.dense-compact .report-preview-logo {
  width: 126px;
}

.report-preview-sheet.dense-compact .report-preview-summary-strip {
  margin-top: 8px;
  padding: 8px 12px;
}

.report-preview-sheet.dense-compact .report-preview-section {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
}

.report-preview-sheet.dense-compact .report-preview-daily-rows {
  gap: 8px;
  margin-top: 10px;
}

.report-preview-sheet.dense-compact .report-preview-daily-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.report-preview-sheet.dense-compact .report-preview-group-card,
.report-preview-sheet.dense-compact .report-preview-project-card,
.report-preview-sheet.dense-compact .report-preview-event-row {
  padding: 10px 12px;
  border-radius: 14px;
}

.report-preview-sheet.dense-compact .report-preview-endday-project {
  padding: 10px 12px;
  border-radius: 14px;
}

.report-preview-sheet.dense-compact .report-preview-endday-summary-wrap {
  margin-top: 8px;
}

.report-preview-sheet.dense-compact .report-preview-endday-summary-table th,
.report-preview-sheet.dense-compact .report-preview-endday-summary-table td {
  padding: 1px 1px;
  font-size: 4.6px;
}

.report-preview-sheet.dense-compact .report-preview-endday-project-title {
  font-size: 7.4px;
}

.report-preview-sheet.dense-compact .report-preview-endday-project-pct {
  font-size: 5.8px;
}

.report-preview-sheet.dense-compact .report-preview-endday-project-meta {
  font-size: 7px;
}

.report-preview-sheet.dense-compact .report-preview-endday-row-label {
  font-size: 4.3px;
}

.report-preview-sheet.dense-compact .report-preview-endday-notes strong,
.report-preview-sheet.dense-compact .report-preview-endday-note-meta span,
.report-preview-sheet.dense-compact .report-preview-endday-note-meta b,
.report-preview-sheet.dense-compact .report-preview-endday-note-item p {
  font-size: 4.6px;
}

.report-preview-sheet.dense-compact .report-preview-endday-note-item {
  padding: 2px 3px;
}

.report-preview-sheet.dense-compact .report-preview-endday-notes-list {
  gap: 2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-preview-sheet.dense-compact .report-preview-endday-project-list {
  gap: 8px;
  margin-top: 10px;
}

.report-preview-sheet.dense-compact .report-preview-endday-table-wrap {
  margin-top: 8px;
}

.report-preview-sheet.dense-compact .report-preview-endday-table th,
.report-preview-sheet.dense-compact .report-preview-endday-table td {
  padding: 6px 8px;
  font-size: 10px;
}

.report-preview-sheet.dense-compact .report-preview-group-card-head strong,
.report-preview-sheet.dense-compact .report-preview-project-head strong {
  font-size: 13px;
}

.report-preview-sheet.dense-compact .report-preview-mold-compact-list {
  gap: 6px;
  margin-top: 8px;
}

.report-preview-sheet.dense-compact .report-preview-mold-line {
  padding: 6px 8px;
  gap: 6px;
  font-size: 11px;
}

.report-preview-sheet.dense-tight {
  padding: 18px;
}

.report-preview-sheet.dense-tight .report-preview-head {
  padding: 8px 12px;
  gap: 10px;
}

.report-preview-sheet.dense-tight .report-preview-logo {
  width: 116px;
}

.report-preview-sheet.dense-tight .report-preview-title-block h2 {
  font-size: 16px;
}

.report-preview-sheet.dense-tight .report-preview-meta strong {
  font-size: 14px;
}

.report-preview-sheet.dense-tight .report-preview-meta span,
.report-preview-sheet.dense-tight .report-preview-summary-strip > span,
.report-preview-sheet.dense-tight .report-preview-stat-topline small {
  font-size: 10px;
}

.report-preview-sheet.dense-tight .report-preview-summary-strip {
  margin-top: 6px;
  padding: 7px 10px;
  gap: 4px;
}

.report-preview-sheet.dense-tight .report-preview-stat-topline strong {
  font-size: 17px;
}

.report-preview-sheet.dense-tight .report-green-bar.compact {
  height: 4px;
}

.report-preview-sheet.dense-tight .report-preview-section {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
}

.report-preview-sheet.dense-tight .report-preview-daily-rows {
  gap: 6px;
  margin-top: 8px;
}

.report-preview-sheet.dense-tight .report-preview-daily-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.report-preview-sheet.dense-tight .report-preview-group-card,
.report-preview-sheet.dense-tight .report-preview-project-card,
.report-preview-sheet.dense-tight .report-preview-event-row {
  padding: 8px 10px;
  border-radius: 12px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project {
  padding: 8px 10px;
  border-radius: 12px;
}

.report-preview-sheet.dense-tight .report-preview-endday-summary-wrap {
  margin-top: 7px;
}

.report-preview-sheet.dense-tight .report-preview-endday-summary-table th,
.report-preview-sheet.dense-tight .report-preview-endday-summary-table td {
  padding: 0.5px 1px;
  font-size: 4px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project-title {
  font-size: 6.4px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project-pct {
  font-size: 4.8px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project-meta {
  font-size: 6.5px;
}

.report-preview-sheet.dense-tight .report-preview-endday-row-label {
  font-size: 3.8px;
  line-height: 1;
}

.report-preview-sheet.dense-tight .report-preview-endday-matrix-cell {
  font-size: 4px;
}

.report-preview-sheet.dense-tight .report-preview-endday-notes {
  margin-top: 6px;
  padding: 3px 4px;
}

.report-preview-sheet.dense-tight .report-preview-endday-notes strong,
.report-preview-sheet.dense-tight .report-preview-endday-note-meta span,
.report-preview-sheet.dense-tight .report-preview-endday-note-meta b,
.report-preview-sheet.dense-tight .report-preview-endday-note-item p {
  font-size: 4px;
}

.report-preview-sheet.dense-tight .report-preview-endday-notes-list {
  gap: 2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-preview-sheet.dense-tight .report-preview-endday-note-item {
  padding: 2px;
  border-radius: 5px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project-list {
  gap: 6px;
  margin-top: 8px;
}

.report-preview-sheet.dense-tight .report-preview-group-card-head {
  margin-bottom: 6px;
}

.report-preview-sheet.dense-tight .report-preview-group-card-head strong,
.report-preview-sheet.dense-tight .report-preview-project-head strong {
  font-size: 12px;
}

.report-preview-sheet.dense-tight .report-preview-endday-project-head span {
  font-size: 10px;
}

.report-preview-sheet.dense-tight .report-preview-group-card-head span,
.report-preview-sheet.dense-tight .report-preview-badge {
  font-size: 10px;
}

.report-preview-sheet.dense-tight .report-preview-badge {
  padding: 5px 8px;
}

.report-preview-sheet.dense-tight .report-preview-mold-compact-list {
  gap: 4px;
  margin-top: 6px;
}

.report-preview-sheet.dense-tight .report-preview-mold-line {
  padding: 5px 7px;
  gap: 5px;
  font-size: 10px;
  border-radius: 10px;
}

.report-preview-sheet.dense-tight .report-preview-chip-row {
  gap: 5px;
  margin-top: 8px;
}

.report-preview-sheet.dense-tight .report-preview-chip {
  padding: 5px 8px;
  font-size: 10px;
}

.report-preview-sheet.dense-tight .report-preview-endday-table-wrap {
  margin-top: 7px;
}

.report-preview-sheet.dense-tight .report-preview-endday-table th,
.report-preview-sheet.dense-tight .report-preview-endday-table td {
  padding: 5px 6px;
  font-size: 9px;
}

.report-preview-sheet.dense-tight .report-preview-footnote {
  padding-top: 10px;
}

.report-preview-sheet.dense-tight .report-preview-footer-qr img {
  width: 34px;
  height: 34px;
  padding: 2px;
}

.report-preview-sheet.dense-tight .report-preview-footer-qr span,
.report-preview-sheet.dense-tight .report-preview-footnote-text {
  font-size: 7px;
}

.report-preview-sheet.dense-tight .report-preview-event-list,
.report-preview-sheet.dense-tight .report-preview-project-list,
.report-preview-sheet.dense-tight .report-preview-mold-list {
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .report-hero-card {
    grid-template-columns: 1fr;
  }

  .report-date-switch,
  .report-action-grid {
    justify-self: stretch;
    justify-content: space-between;
  }

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

  .report-project-inline-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-preview-panel-head,
  .report-preview-head,
  .report-preview-section-head {
    flex-direction: column;
  }

  .report-preview-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-preview-toolbar {
    justify-content: flex-start;
  }

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

  .report-preview-daily-row,
  .report-preview-project-list.compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .report-hero-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-hero-logo {
    width: 180px;
    max-width: 60vw;
  }

  .report-action-grid,
  .report-date-switch,
  .report-day-summary-head,
  .report-plan-group-head,
  .report-project-row-head {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .report-preview-canvas {
    padding: 10px;
  }

  .report-preview-sheet {
    min-height: 0;
    padding: 18px 14px;
    border-radius: 20px;
  }

  .report-preview-logo {
    width: 126px;
    max-width: 56vw;
  }

  .report-preview-stat-topline {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .report-preview-badge,
  .report-preview-chip {
    white-space: normal;
  }

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

  .planning-project-compact-head {
    align-items: flex-start;
  }

  .planning-project-compact-summary-chip {
    align-items: flex-start;
  }
}

.qr-settings-grid {
  margin-bottom: 12px;
}

.qr-inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 600;
}

.qr-inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.qr-settings-role-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.qr-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 10px;
}

.qr-policy-card h4 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.qr-policy-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.update-email-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-remove-btn {
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.updates-shell {
  display: grid;
  gap: 12px;
}

.updates-hero-card {
  padding: 18px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(24, 169, 87, 0.11), transparent 70%),
    radial-gradient(420px 160px at 0% 0%, rgba(255, 127, 42, 0.12), transparent 70%),
    rgba(255, 255, 255, 0.82);
}

.updates-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.updates-overline {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #68748a;
}

.updates-hero-copy h3 {
  margin: 0;
  font-size: 1.35rem;
}

.updates-hero-copy .sub {
  max-width: 720px;
}

.updates-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.updates-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

.updates-pill-ok {
  background: rgba(24, 169, 87, 0.1);
  border-color: rgba(24, 169, 87, 0.18);
  color: #19824a;
}

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

.update-stat-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(255, 255, 255, 0.7);
}

.update-stat-icon,
.updates-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 127, 42, 0.14), rgba(24, 169, 87, 0.1));
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.update-stat-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.update-stat-value {
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 800;
  word-break: break-word;
}

.updates-main-grid,
.updates-detail-grid {
  display: grid;
  gap: 12px;
}

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

.updates-detail-grid {
  grid-template-columns: 1.2fr 0.9fr;
}

.updates-panel {
  padding: 16px;
}

.updates-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.updates-panel-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.updates-panel-head h4 {
  margin: 0;
  font-size: 1.02rem;
}

.updates-mini-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.updates-mini-chip.ready {
  background: rgba(24, 169, 87, 0.1);
  border-color: rgba(24, 169, 87, 0.18);
  color: #19824a;
}

.updates-meta-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.updates-meta-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.84);
  border: 1px solid rgba(203, 213, 225, 0.55);
}

.updates-meta-item span {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.updates-meta-item strong {
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.updates-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.updates-mini-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.84);
  border: 1px solid rgba(203, 213, 225, 0.55);
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
}

.online-audit-panel {
  margin-bottom: 12px;
  border-color: rgba(24, 169, 87, 0.22);
  background:
    radial-gradient(520px 180px at 100% 0%, rgba(24, 169, 87, 0.1), transparent 70%),
    rgba(255, 255, 255, 0.92);
}

.online-audit-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.online-audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.online-audit-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.online-audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.68);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.online-audit-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.online-audit-main strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.online-audit-main span,
.online-audit-main p {
  margin: 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.online-audit-main p {
  color: #64748b;
}

.online-audit-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.online-audit-side small {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

.tag-soft {
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
}

.updates-form-grid {
  gap: 10px;
}

.updates-form-span {
  grid-column: 1 / -1;
}

.updates-mail-list {
  margin-top: 12px;
  margin-bottom: 12px;
}

.updates-mail-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(24, 169, 87, 0.14);
  background: rgba(24, 169, 87, 0.08);
  color: #14683d;
}

.updates-mail-dot {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #18a957;
  flex: 0 0 auto;
}

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

.updates-preview-grid .item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.84);
  border: 1px solid rgba(203, 213, 225, 0.55);
}

.updates-preview-grid-compact {
  margin-top: 4px;
}

.update-note-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 127, 42, 0.07), rgba(24, 169, 87, 0.06));
  border: 1px solid rgba(255, 127, 42, 0.15);
  font-weight: 700;
  line-height: 1.55;
}

.update-notes-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.update-note-row {
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.55);
  color: #475569;
  font-weight: 700;
}

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

.update-history-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.55);
}

.updates-note-card .sub {
  max-width: 920px;
}

.qr-role-card h4 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.qr-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.qr-role-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.qr-role-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

@media (max-width: 980px) {
  .qr-settings-role-sections {
    grid-template-columns: 1fr;
  }

  .qr-role-grid {
    grid-template-columns: 1fr;
  }

  .qr-policy-grid {
    grid-template-columns: 1fr;
  }

  .updates-stats-grid,
  .online-audit-summary-grid,
  .updates-main-grid,
  .updates-detail-grid,
  .updates-history-grid,
  .updates-preview-grid {
    grid-template-columns: 1fr;
  }

  .updates-hero-top,
  .updates-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .updates-hero-badges {
    justify-content: flex-start;
  }

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

  .online-audit-side {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .updates-action-row {
    grid-template-columns: 1fr;
  }

  .update-stat-card {
    grid-template-columns: 1fr;
  }

  .online-audit-head-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .update-stat-icon {
    width: 46px;
    height: 46px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 0% -10%, rgba(255, 127, 42, 0.14), transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, rgba(24, 169, 87, 0.11), transparent 50%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.84));
  color: #fff;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand h1 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.1;
}

.brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.91rem;
}

.nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.16s ease, background 0.16s ease;
}

.nav-link:hover,
.nav-link.active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.nav-pill {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 127, 42, 0.26);
  color: #ffd9bc;
}

.nav-pill-danger {
  background: rgba(239, 68, 68, 0.28);
  color: #ffd5d8;
}

.sidebar-user {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.main {
  padding: 18px;
}

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

.topbar h2 {
  margin: 0;
  font-size: 1.65rem;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

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

.top-notification-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.top-notification-icon {
  font-size: 16px;
  line-height: 1;
}

.top-notification-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn {
  display: none;
  border: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #111827;
  color: #fff;
  flex-shrink: 0;
  padding: 0;
}

.menu-btn-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
}

.menu-btn-lines span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: #fff;
}

.topbar > .head {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  gap: 10px;
}

.topbar > .head .topbar-titles {
  min-width: 0;
  flex: 1;
}

.topbar > .head .topbar-titles h2 {
  margin: 0;
}

.top-user-desktop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-user-mobile {
  display: none;
}

.top-user-slot {
  position: relative;
  flex-shrink: 0;
}

.top-profile-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.top-profile-icon {
  display: block;
  color: #334155;
}

.top-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: min(260px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  padding: 12px 14px;
  z-index: 45;
  gap: 10px;
}

.top-user-slot.open .top-user-dropdown {
  display: grid;
}

.top-user-dropdown-email {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
  word-break: break-word;
  line-height: 1.35;
}

.top-user-dropdown-logout {
  width: 100%;
  justify-content: center;
}

.mobile-tabbar {
  display: none;
}

.content {
  display: grid;
  gap: 12px;
}

.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 10px;
}

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

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

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

/* Ana ekran: sol plan genis; sag proje kartlari okunakli min-max genislik */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, min(38vw, 28rem));
  column-gap: clamp(10px, 1.4vw, 16px);
  align-items: start;
}

.dashboard-main-grid > .card {
  min-width: 0;
}

.dashboard-main-grid > .card:last-child .stack {
  max-height: min(72vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* Proje sutunu: baslik satiri ve ilerleme etiketleri dar alanda kirpilmasin */
body[data-page="dashboard"] .dashboard-main-grid > .card:last-child .project-head {
  align-items: flex-start;
  gap: 8px 12px;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:last-child .project-head > div:first-child {
  min-width: 0;
  flex: 1;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:last-child .project-head strong {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:last-child .project-head .sub {
  white-space: normal;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:last-child .project-head .tag {
  flex-shrink: 0;
  align-self: flex-start;
}

body[data-page="dashboard"] .dashboard-main-grid .project-card .progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
}

body[data-page="dashboard"] .dashboard-main-grid .project-card .progress-row span:last-child {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Ana ekran: ust (selamlama + KPI) kompakt; kalip kutulari buyuk; atama metni kucuk */
body[data-page="dashboard"] .main {
  padding: 12px 16px 14px;
}

body[data-page="dashboard"] .content {
  gap: 8px;
}

body[data-page="dashboard"] .topbar {
  margin-bottom: 8px;
  gap: 8px;
}

body[data-page="dashboard"] .topbar h2 {
  font-size: 1.18rem;
  line-height: 1.2;
}

body[data-page="dashboard"] .topbar p {
  margin: 0;
  font-size: 0.82rem;
}

body[data-page="dashboard"] .top-actions .btn {
  padding: 7px 11px;
  font-size: 0.86rem;
}

body[data-page="dashboard"] .grid-4 {
  gap: 8px;
}

body[data-page="dashboard"] .grid-4 > .card {
  padding: 9px 11px;
}

body[data-page="dashboard"] .grid-4 .kpi-card {
  min-height: 0;
  padding: 8px 10px;
}

body[data-page="dashboard"] .grid-4 .kpi-label {
  font-size: 0.7rem;
  line-height: 1.15;
}

body[data-page="dashboard"] .grid-4 .kpi-value {
  margin-top: 3px;
  font-size: 1.38rem;
  line-height: 1.05;
}

body[data-page="dashboard"] .dashboard-welcome-card {
  gap: 2px;
}

body[data-page="dashboard"] .dashboard-date-only {
  font-size: 0.92rem;
  line-height: 1.2;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:first-child {
  padding: 11px 12px;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:first-child .head {
  margin-bottom: 6px;
}

body[data-page="dashboard"] .dashboard-main-grid > .card:first-child .head h3 {
  font-size: 0.95rem;
}

body[data-page="dashboard"] .dashboard-mold-group-stack {
  gap: 10px;
}

body[data-page="dashboard"] .dashboard-daily-tile-row .dashboard-plan-group-name {
  font-size: clamp(0.68rem, 1.6vw, 0.8rem);
}

body[data-page="dashboard"] .dashboard-plan-group-detail .dashboard-plan-grid.plan-grid {
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 9px;
}

body[data-page="dashboard"] .dashboard-plan-group-detail .plan-tile {
  padding: 9px;
}

body[data-page="dashboard"] .dashboard-plan-group-detail .plan-code {
  font-size: 0.78rem;
}

body[data-page="dashboard"] .dashboard-plan-assigned-list {
  gap: 6px;
  padding: 0 6px 6px;
}

body[data-page="dashboard"] .dashboard-plan-assigned-item {
  padding: 6px 7px;
  gap: 6px;
}

body[data-page="dashboard"] .dashboard-plan-assigned-main strong {
  font-size: 0.8rem;
  font-weight: 700;
}

body[data-page="dashboard"] .dashboard-plan-assigned-main .sub {
  font-size: 0.68rem;
  line-height: 1.25;
}

body[data-page="dashboard"] .dashboard-plan-assigned-item .btn-compact {
  font-size: 0.72rem;
  padding: 5px 9px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card.soft {
  background: var(--glass-strong);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.head h3,
.head h4 {
  margin: 0;
}

.sub {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kpi-label {
  color: var(--muted);
  font-weight: 600;
}

.kpi-card {
  min-height: 82px;
  overflow: hidden;
}

.kpi-value {
  margin-top: 8px;
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}

.kpi-card-compact .kpi-value {
  max-width: 100%;
  font-size: clamp(1.05rem, 1.35vw, 1.42rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-kpi-grid {
  gap: 8px;
}

.planning-kpi-grid .kpi-card {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
}

.planning-kpi-grid .kpi-label {
  font-size: 0.82rem;
  line-height: 1.1;
}

.planning-kpi-grid .kpi-value {
  margin-top: 5px;
  font-size: 1.42rem;
  line-height: 1;
}

.planning-kpi-grid .kpi-card-compact .kpi-value {
  font-size: clamp(0.92rem, 1.05vw, 1.12rem);
  letter-spacing: -0.02em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, #ff9d56, #ff7f2a);
  color: #fff;
  border-color: #ef7b28;
  box-shadow: 0 4px 14px rgba(242, 122, 26, 0.25);
}

.btn-light {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(180deg, #f05252, #dc2626);
}

.btn-qr {
  background: linear-gradient(180deg, #1cbc66, #18a957);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-compact {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.item-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tag {
  font-size: 0.78rem;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 700;
}

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

.tag-warn {
  background: var(--warn-soft);
  color: #9b6b10;
}

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

.progress {
  margin: 8px 0 6px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e9ee;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #12a150, #1ec36a);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 9px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.76);
  padding: 11px;
}

.mold-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 6px;
}

.mold-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #dce3ea;
  background: #f1f4f7;
  color: #7a8a9a;
}

.mold-icon.is-full {
  border-color: #7ad9a3;
  background: #dbf6e7;
  color: #117a3f;
}

.mold-icon.is-empty {
  opacity: 0.8;
}

.date-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.dashboard-plan-switch {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) 150px 44px;
  position: relative;
  align-items: center;
  column-gap: 8px;
  width: 460px;
  max-width: 100%;
  flex: 0 0 460px;
  margin-top: 0;
  min-width: 0;
  justify-content: end;
}

.dashboard-plan-switch .date-btn {
  width: 44px;
  height: 44px;
}

.dashboard-plan-switch strong,
.dashboard-plan-date-text {
  min-width: 0;
  text-align: center;
  font-size: 0.85rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-plan-date-text {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 4px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-plan-date-text:hover,
.dashboard-plan-date-text:focus-visible {
  color: var(--accent);
  outline: none;
}

.planning-date-picker-input {
  position: absolute;
  left: 52px;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dashboard-plan-fill {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-plan-empty-note {
  margin-bottom: 6px;
  font-weight: 600;
}

.date-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 1.2rem;
  line-height: 1;
}

.dashboard-welcome-card {
  display: grid;
  gap: 6px;
}

.dashboard-greeting {
  font-size: 1.08rem;
  line-height: 1.25;
}

.dashboard-date-only {
  display: block;
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 700;
  color: #334155;
}

.dashboard-mold-group-stack {
  display: grid;
  gap: 8px;
}

.dashboard-plan-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

/* Ana ekran ust satir: kutular mevcut genisligi esit paylasir (kucuk ekranda daralir, buyukte buyur) */
.dashboard-plan-group-grid.dashboard-daily-tile-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: clamp(4px, 0.9vw, 8px);
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-gutter: stable;
}

.dashboard-plan-group-tile {
  border: 1px solid #e6ebf1;
  background: #fff;
  border-radius: 16px;
  aspect-ratio: 1 / 1;
  padding: 10px 8px 12px;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.dashboard-plan-group-tile:hover {
  transform: translateY(-1px);
}

.dashboard-plan-group-tile.active {
  border-color: #bfdbfe;
  background: #fbfdff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* Esit paylasim: flex 1 1 0 + min-width 0 ile satir genisligine sigar; cok daralinca yatay kaydir */
.dashboard-daily-tile-row .dashboard-plan-group-tile {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  padding: clamp(5px, 1.2vw, 8px) clamp(4px, 1vw, 7px) clamp(6px, 1.2vw, 9px);
  aspect-ratio: unset;
  height: auto;
  align-self: stretch;
  align-content: start;
  justify-items: center;
  gap: clamp(3px, 0.6vw, 6px);
  overflow: visible;
}

.dashboard-daily-tile-row .dashboard-plan-group-name {
  font-size: 0.74rem;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
  min-height: 2.35em;
}

.dashboard-daily-tile-row .dashboard-plan-circle {
  width: clamp(36px, 7.5vw, 52px);
  height: clamp(36px, 7.5vw, 52px);
}

.dashboard-daily-tile-row .dashboard-plan-circle::after {
  inset: 4px;
}

.dashboard-daily-tile-row .dashboard-plan-circle > span {
  font-size: 0.72rem;
}

.dashboard-daily-tile-row .dashboard-plan-group-ratio {
  font-size: 0.85rem;
}

.dashboard-daily-tile-row .dashboard-plan-group-meta {
  font-size: 0.65rem;
}

.dashboard-plan-group-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-plan-circle,
.plan-circle {
  --pct: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(#23b15b calc(var(--pct) * 1%), #e8edf3 0);
  position: relative;
  display: grid;
  place-items: center;
}

.dashboard-plan-circle::after,
.plan-circle::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e6ebf1;
}

.dashboard-plan-circle > span,
.plan-circle > span {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 800;
  color: #128346;
}

.dashboard-plan-group-ratio {
  font-size: 1rem;
  line-height: 1.1;
  color: #0f172a;
}

.dashboard-plan-group-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-plan-group-tile.danger {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}

.dashboard-plan-group-tile.warn {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}

.dashboard-plan-group-tile.ok {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}

.dashboard-plan-group-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .24s ease, opacity .2s ease, margin-top .2s ease;
  margin-top: 0;
}

.dashboard-plan-group-detail.open {
  max-height: 900px;
  opacity: 1;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.dashboard-plan-assigned-list {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}

.dashboard-plan-assigned-item {
  border: 1px solid #e7edf4;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.dashboard-plan-assigned-main {
  min-width: 0;
}

.dashboard-plan-assigned-main strong,
.dashboard-plan-assigned-main .sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-pending-list {
  max-height: 340px;
  overflow: auto;
}

.planning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 10px;
  align-items: start;
}

.planning-project-panel {
  display: grid;
  gap: 10px;
}

.planning-project-panel .card {
  position: static;
}

.planning-project-panel .planning-project-compact-card {
  position: sticky;
  top: 10px;
}

.planning-plan-switch {
  margin-left: auto;
}

.planning-inline-meta {
  margin: 2px 0 10px;
  font-weight: 700;
}

.planning-safety-alert {
  display: block;
  margin: 8px 0 10px;
  border: 1px solid #f0b66c;
  border-left: 4px solid #f28c28;
  border-radius: 12px;
  background: #fff7eb;
  color: #7a4a00;
  padding: 10px 12px;
  line-height: 1.35;
}

.planning-safety-alert strong {
  font-size: 0.9rem;
}

.planning-safety-alert.admin {
  border-color: #9fd7b8;
  border-left-color: #15803d;
  background: #eefbf4;
  color: #14532d;
}

.planning-tooltip-host {
  position: relative;
  cursor: help;
}

.planning-tooltip-host::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: max-content;
  max-width: min(380px, calc(100vw - 36px));
  padding: 8px 10px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 700;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity .14s ease, transform .14s ease;
}

.planning-tooltip-host::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 16px;
  z-index: 121;
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.planning-tooltip-host:hover::after,
.planning-tooltip-host:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.planning-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.planning-filter-actions {
  display: grid;
}

.planning-project-compact-note {
  margin: -2px 0 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.planning-project-compact-list {
  gap: 8px;
}

.planning-project-compact-item {
  border: 1px solid #e5ebf2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.planning-project-compact-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
}

.planning-project-compact-item > summary::-webkit-details-marker {
  display: none;
}

.planning-project-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.planning-project-compact-head strong {
  font-size: 0.9rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-project-compact-head span {
  font-size: 0.75rem;
  color: #4f5f72;
  font-weight: 700;
  flex-shrink: 0;
}

.planning-project-compact-rows {
  border-top: 1px solid #edf2f7;
  padding: 7px 10px 9px;
  display: grid;
  gap: 5px;
}

.planning-project-waiting-note {
  font-size: 0.9rem;
  color: #0f172a;
  padding: 2px 0 4px;
}

.planning-project-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.planning-project-compact-row span {
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-project-compact-row strong {
  color: #0f7d41;
  font-size: 0.8rem;
}

.planning-project-open-btn {
  margin-top: 1px;
  min-height: 36px;
}

.planning-project-compact-summary-list {
  display: grid;
  gap: 5px;
}

.planning-project-compact-summary-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid #e6edf5;
  background: #f8fbff;
}

.planning-project-compact-summary-chip span {
  font-size: 0.8rem;
  color: #334155;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-project-compact-summary-chip strong {
  font-size: 0.78rem;
  color: #0f7d41;
  flex-shrink: 0;
}

.planning-project-compact-empty {
  font-size: 0.78rem;
  color: #64748b;
  padding: 6px 0 2px;
}

.planning-stuck-card {
  border-color: #f2d2a2;
}

.planning-stuck-list {
  max-height: none;
  overflow: visible;
}

.planning-stuck-item {
  display: grid;
  gap: 5px;
  border: 1px solid #ead7b8;
  border-radius: 12px;
  background: #fffaf0;
  padding: 9px 10px;
}

.planning-stuck-item.danger {
  border-color: #efb1b1;
  background: #fff4f4;
}

.planning-stuck-item strong {
  font-size: 0.84rem;
  line-height: 1.25;
  color: #111827;
}

.planning-stuck-item .btn {
  margin-top: 2px;
}

.planning-special-section {
  margin-top: 10px;
}

.planning-special-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.planning-assign-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.planning-assign-modal {
  width: min(720px, calc(100vw - 20px));
}

.planning-assign-modal-special {
  width: min(1120px, calc(100vw - 20px));
}

.planning-assign-warning-stack {
  display: grid;
  gap: 8px;
}

.planning-assign-form-grid {
  display: grid;
  gap: 10px;
}

.inline-form-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-form-action > .btn {
  white-space: nowrap;
}

.planning-assign-preview span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.planning-assign-preview strong {
  display: block;
  margin-top: 2px;
}

.planning-assign-warning {
  margin: 8px 0 10px;
  border: 1px solid #f5c47b;
  border-radius: 12px;
  background: #fff6e8;
  color: #8a5f0c;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 600;
}

.planning-assign-warning-strong {
  margin: 8px 0 0;
  border-color: #efb36a;
  color: #794400;
  font-weight: 800;
}

.planning-assign-mold-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.planning-assign-mold-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #e5ecf5;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.planning-assign-mold-check input {
  margin-top: 2px;
}

.planning-assign-mold-check span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.planning-assign-mold-check strong {
  font-size: 0.82rem;
  color: #0f172a;
}

.planning-assign-mold-check small {
  font-size: 0.72rem;
  color: #64748b;
}

.planning-assign-modal-special .planning-assign-warning-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planning-assign-modal-special .planning-assign-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.planning-assign-modal-special .planning-assign-preview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planning-assign-modal-special .planning-assign-mold-select-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planning-assign-modal-special .planning-assign-warning {
  margin: 0;
}

@media (max-width: 780px) {
  .planning-assign-modal-special .planning-assign-warning-stack,
  .planning-assign-modal-special .planning-assign-form-grid,
  .planning-assign-modal-special .planning-assign-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-assign-modal-special .planning-assign-mold-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.planning-group-stack {
  display: grid;
  gap: 10px;
}

.planning-group-tile-grid {
  margin-bottom: 10px;
}

.planning-active-group-detail {
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px;
}

.planning-active-group-detail.open {
  max-height: min(72vh, 760px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.planning-active-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 2px 2px 8px;
  background: linear-gradient(180deg, #f8fbff 70%, rgba(248, 251, 255, 0));
}

.planning-active-group-head strong {
  font-size: 0.95rem;
}

.planning-active-group-head span {
  font-size: 0.82rem;
  color: #4f5f72;
  font-weight: 700;
}

.planning-group-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
}

.planning-group-summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid #edf2fa;
}

.planning-group-summary::-webkit-details-marker {
  display: none;
}

.planning-group-summary-main {
  display: grid;
  gap: 2px;
}

.planning-group-summary-main strong {
  font-size: 0.95rem;
}

.planning-group-summary-main span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.planning-group-count-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
}

.planning-group-count-badge.active {
  background: #e9f8ef;
  color: #15803d;
}

.planning-group-count-badge.active-ok {
  background: #e9f8ef;
  color: #15803d;
}

.planning-group-count-badge.active-warn {
  background: #fff3d9;
  color: #a16207;
}

.planning-group-summary i {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--muted);
  transition: transform .15s ease;
}

.planning-group-card[open] .planning-group-summary i {
  transform: rotate(180deg);
}

.planning-mold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 8px;
}

.planning-mold-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-self: start;
}

.planning-mold-card > * {
  min-width: 0;
}

.planning-mold-collapsible {
  padding: 0;
  overflow: hidden;
}

.planning-mold-collapsible > summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 8px 9px;
}

.planning-mold-collapsible > summary::-webkit-details-marker {
  display: none;
}

.planning-mold-collapse-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}

.planning-mold-collapse-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.planning-mold-collapse-main strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.planning-mold-collapse-main .sub {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-size: 0.74rem;
}

.planning-mold-collapse-summary .tag {
  flex-shrink: 0;
  margin-top: 0;
}

.planning-mold-summary-badges {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.planning-mold-summary-badges .tag,
.planning-mold-collapse-summary > .tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  line-height: 1.2;
}

.planning-count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.planning-count-chip.ok {
  background: #e9f8ef;
  color: #15803d;
}

.planning-count-chip.warn {
  background: #fff3d9;
  color: #a16207;
}

.planning-count-chip.muted {
  background: #edf2f7;
  color: #64748b;
}

.planning-mold-collapse-body {
  padding: 0 8px 8px;
  display: grid;
  gap: 6px;
}

.planning-mold-assignment .item.planning-mold-assign-compact {
  padding: 7px 8px;
  border-radius: 10px;
}

.planning-mold-assign-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
}

.planning-mold-assign-line-dense {
  font-size: 0.68rem;
  line-height: 1.25;
}

.planning-mold-assign-k {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.planning-mold-assign-v {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-mold-assign-line:first-child .planning-mold-assign-v {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-size: 0.76rem;
}

.planning-mold-assign-sep {
  color: #94a3b8;
  font-weight: 700;
  padding: 0 1px;
}

.planning-mold-assign-note {
  margin-top: 2px;
  font-size: 0.66rem;
  line-height: 1.28;
  color: #475569;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-mold-assign-compact .item-actions {
  margin-top: 6px;
  gap: 6px;
}

.planning-mold-assign-compact .planning-mold-quick-actions {
  margin-top: 6px;
}

.planning-mold-card.status-danger {
  border-color: #f4b0b4;
  background: #fff7f8;
}

.planning-mold-card.status-warn {
  border-color: #f7d59a;
  background: #fffaf0;
}

.planning-mold-card.status-ok {
  border-color: #a9e7c4;
  background: #f2fdf7;
}

.planning-mold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.planning-mold-type {
  margin-top: -2px;
}

.planning-mold-code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: #334155;
  font-weight: 700;
}

.planning-mold-id {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 600;
}

.planning-mold-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.7rem;
  line-height: 1.25;
  color: #4b5b6d;
}

.planning-mold-meta-row b {
  color: #1a2433;
  font-weight: 800;
}

.planning-mold-assignment {
  border: 1px solid #e5ecf5;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  display: grid;
  gap: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-mold-assignment > .stack {
  gap: 6px;
}

.planning-mold-assignment-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: stretch;
}

.planning-mold-project-box {
  padding: 8px 10px;
}

.planning-mold-project {
  display: block;
  font-size: 1rem;
  line-height: 1.15;
  align-self: center;
  color: #162130;
}

.planning-mold-note-box {
  border: 1px solid #e7edf4;
  border-radius: 10px;
  background: #f8fafc;
  padding: 7px 9px;
  font-size: 0.76rem;
  line-height: 1.3;
  color: #4b5b6d;
  min-height: 42px;
}

.planning-mold-note-box b {
  color: #1a2433;
}

.planning-mold-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.planning-mold-side-box,
.planning-mold-side-btn {
  min-height: 40px;
  border-radius: 10px;
}

.planning-mold-side-box {
  border: 1px solid #e7edf4;
  background: #f8fafc;
  padding: 6px 8px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.planning-mold-side-box.compact {
  min-height: 40px;
}

.planning-mold-side-box span {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
}

.planning-mold-side-box strong {
  font-size: 0.86rem;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planning-mold-side-btn {
  width: 100%;
  padding: 7px 8px;
  text-align: center;
  line-height: 1.15;
  font-size: 0.8rem;
}

.planning-mold-assignment.empty {
  color: var(--muted);
}

.planning-occupied-note {
  display: grid;
  gap: 3px;
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 0.78rem;
  line-height: 1.32;
}

.planning-occupied-note strong {
  color: #1f2937;
}

.planning-occupied-note span {
  color: #4b5563;
  font-weight: 700;
}

.planning-occupied-note.warn {
  border: 1px solid #f5cf8f;
  background: #fff8ea;
}

.planning-occupied-note.danger {
  border: 1px solid #f3a6a6;
  background: #fff3f3;
}

.planning-mold-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.planning-mold-card .btn-compact,
.planning-mold-card .planning-mold-side-btn.btn-compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.planning-complete-btn {
  margin-top: 8px;
  border-radius: 10px;
  min-height: 42px;
  font-weight: 700;
}

.planning-mold-history {
  border: 1px solid #e5ecf5;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.planning-mold-history > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f2937;
}

.planning-mold-history > summary::-webkit-details-marker {
  display: none;
}

.planning-mold-history-list {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.planning-mold-history-item {
  border: 1px solid #e5ecf5;
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
  display: grid;
  gap: 3px;
}

.planning-mold-history-item strong {
  font-size: 0.75rem;
  color: #0f172a;
}

.planning-mold-history-item span {
  font-size: 0.72rem;
  color: #64748b;
}

.planning-mold-history-item p {
  margin: 0;
  font-size: 0.73rem;
  line-height: 1.25;
  color: #334155;
  overflow-wrap: anywhere;
}

.planning-mold-history-empty {
  font-size: 0.76rem;
  color: #64748b;
  border: 1px dashed #d8e0ea;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.dashboard-plan-grid {
  padding: 8px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.plan-tile {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 13px;
  aspect-ratio: 1 / 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  text-align: center;
}

button.plan-tile.plan-tile-selectable {
  appearance: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}

button.plan-tile.plan-tile-selectable:hover {
  border-color: #c7d7ee;
  background: #f8fbff;
}

button.plan-tile.plan-tile-selectable.active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.dashboard-plan-pick-model-hint {
  font-weight: 600;
  color: var(--muted);
  padding: 10px 6px;
  text-align: center;
  line-height: 1.35;
}

.plan-code {
  font-weight: 700;
  font-size: 0.82rem;
}

.plan-ratio {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.plan-percent {
  font-size: 0.72rem;
  color: var(--muted);
}

.plan-tile.danger {
  border-color: #f4b0b4;
  background: #fff1f2;
  color: #a91b24;
}

.plan-tile.warn {
  border-color: #f7d59a;
  background: #fff8ea;
  color: #9b6b10;
}

.plan-tile.ok {
  border-color: #a9e7c4;
  background: #edfbf3;
  color: #0f7d41;
}

.project-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 10px;
}

.project-head {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.project-prod-summary {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.project-prod-summary small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.project-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.project-expand.open {
  max-height: 1600px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.group-tile {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  min-height: 158px;
  padding: 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}

.group-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.group-total {
  font-size: 1rem;
  font-weight: 700;
}

.group-line {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.group-tile.danger {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}

.group-tile.warn {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}

.group-tile.ok {
  border-color: #e6ebf1;
  background: #fff;
  color: inherit;
}


.group-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.24s ease, margin-top 0.24s ease;
  margin-top: 0;
  border-radius: 12px;
  border: 1px solid transparent;
}

.group-detail.open {
  max-height: 360px;
  margin-top: 8px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.group-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.detail-stats > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.detail-stats span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.detail-stats strong {
  display: block;
  margin-top: 3px;
}

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

.flow-summary > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.flow-summary span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.flow-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.flow-item {
  display: grid;
  gap: 8px;
}

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

.flow-stats > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.flow-stats span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.flow-stats strong {
  display: block;
  margin-top: 3px;
}

.flow-actions .btn {
  min-height: 44px;
}

.flow-danger {
  grid-template-columns: 1fr;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-toggle-btn {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.section-toggle-btn h3 {
  margin: 0;
  font-size: 1.02rem;
}

.section-toggle-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.section-toggle-icon {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.section-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.26s ease, margin-top 0.26s ease;
  margin-top: 0;
}

.section-collapse.open {
  max-height: 2800px;
  margin-top: 10px;
}

.section-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.section-icon-clock {
  border: 1px solid #f4cf81;
  background: #fff3d8;
  color: #8a5f0c;
}

.section-icon-hourglass {
  border: 1px solid #f4cf81;
  background: #fff3d8;
  color: #8a5f0c;
}

.section-icon-progress {
  border: 1px solid #a9e7c4;
  background: #edfbf3;
  color: #0f7d41;
}

.section-icon-check {
  border: 1px solid #93dfb6;
  background: #e1f8eb;
  color: #0f7d41;
}

.section-icon-danger {
  border: 1px solid #f2a7ae;
  background: #ffe9eb;
  color: #b91c1c;
}

.fault-row-mini .head {
  margin-bottom: 2px;
}

.fault-item-row {
  background: #fff;
}

.fault-meta-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fault-meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 2px;
}

.fault-meta-grid span {
  font-size: 0.76rem;
  color: var(--muted);
}

.fault-meta-grid strong {
  font-size: 0.95rem;
}

.fault-report-box {
  margin-top: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
}

.fault-report-box span {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.fault-report-box p {
  margin: 0;
}

.danger-zone {
  border-color: #ffd4d8;
  background: #fff9fa;
}

.danger-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
}

.danger-delete-btn {
  min-height: 52px;
  font-size: 0.98rem;
  border-radius: 12px;
}

.project-info-card {
  padding: 10px 12px;
}

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

.project-info-grid .item {
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.project-info-grid .item strong {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.project-info-grid .item .sub {
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.2;
  color: var(--text);
}

.project-info-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.project-file-inline-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.project-inline-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  flex: 1 1 520px;
}

.project-inline-summary > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  min-width: 0;
}

.project-inline-summary span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.project-inline-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-project-row strong,
.report-project-row-head strong,
.sent-group-toggle strong,
.sent-group-toggle small,
.project-info-grid .item .sub,
.brand h1,
.brand p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.mini-item-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.mini-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.mini-item-title {
  font-size: 0.88rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-item-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
}

.mini-item-meta span {
  font-size: 0.78rem;
  color: var(--muted);
}

.mini-item-meta strong {
  font-size: 0.9rem;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-item-sub {
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-item-sub.sent {
  color: #0f7d41;
  background: #ecfbf3;
  border-color: #bce8d0;
}

.pdf-inline,
.pdf-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 7px 9px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.pdf-inline .tick,
.pdf-status-badge .tick {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.pdf-inline.ok,
.pdf-status-badge.ok {
  color: #0f7d41;
  background: #ecfbf3;
  border-color: #bce8d0;
}

.pdf-inline.ok .tick,
.pdf-status-badge.ok .tick {
  color: #fff;
  background: #16a34a;
}

.pdf-inline.waiting,
.pdf-status-badge.waiting {
  color: #8a5f0c;
  background: #fff3d8;
  border-color: #f4cf81;
}

.pdf-inline.waiting .tick,
.pdf-status-badge.waiting .tick {
  color: #fff;
  background: #d97706;
}

.pdf-inline.uploading {
  color: #155e75;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.pdf-inline.uploading .tick {
  color: #fff;
  background: #0284c7;
}

.form-success-note {
  margin: 0;
  color: #0f7d41;
  background: #ecfbf3;
  border: 1px solid #bce8d0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.project-file-upload-box {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fbff;
}

.project-file-readonly-note {
  margin: 0 0 12px;
}

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

.project-file-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.project-file-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.project-file-card-top strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.project-file-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.project-file-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.app-progress-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  z-index: 90;
}

.app-progress-overlay.show {
  display: flex;
}

.app-progress-card {
  min-width: 260px;
  max-width: 320px;
  padding: 22px 20px 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe7f4;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.app-progress-ring {
  position: relative;
  width: 112px;
  height: 112px;
}

.app-progress-ring svg {
  width: 112px;
  height: 112px;
  transform: rotate(-90deg);
}

.app-progress-ring circle {
  fill: none;
  stroke-width: 10;
}

.app-progress-ring .track {
  stroke: #e5edf6;
}

.app-progress-ring .value {
  stroke: #22c55e;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s ease;
}

.app-progress-ring strong {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: #10233f;
}

.app-progress-text h4 {
  margin: 0;
  font-size: 1.08rem;
  color: #10233f;
}

.app-progress-text p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #5c6f89;
}

.pdf-inline.error {
  color: #9f1a24;
  background: #ffe9eb;
  border-color: #f1a6ae;
}

.pdf-inline.error .tick {
  color: #fff;
  background: #dc2626;
}

.pdf-status-badge {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  font-size: 0.78rem;
}

.pdf-status-badge strong {
  max-width: 52%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font-size: 0.82rem;
}

.mini-item-top .tag {
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-item-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-item-actions .btn {
  min-height: 40px;
}

.mini-item-delete {
  background: #fff5f6;
  border-color: #f4c7ce;
  color: #ad2f3d;
}

.mini-item-delete:hover {
  background: #ffeef0;
}

.entered-items-list {
  display: grid;
  gap: 10px;
}

.draft-items-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.sent-items-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.sent-group-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.sent-group-toggle {
  border: 1px solid #d7dee8;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
  min-height: 86px;
  align-content: center;
}

.sent-group-toggle strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.sent-group-toggle span {
  font-size: 0.78rem;
  color: #0f7d41;
  font-weight: 700;
}

.sent-group-toggle small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.sent-group-toggle i {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
  justify-self: end;
}

.sent-group-toggle.active {
  border-color: #8edeb3;
  background: #ecfbf3;
}

.sent-group-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.sent-group-panel {
  border: 1px solid #deebf4;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: none;
}

.sent-group-panel.open {
  display: block;
}

.sent-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sent-group-head h4 {
  margin: 0;
  font-size: 0.96rem;
}

.sent-group-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.sent-group-subtypes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sent-group-subtype-chip {
  border: 1px solid #d6e5f2;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #35516f;
  background: #ffffff;
}

.draft-item-card {
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  min-height: 240px;
  height: 100%;
  min-width: 0;
}

.project-waiting-card {
  min-height: 176px;
  gap: 10px;
}

.draft-item-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.draft-item-kpi-row div {
  border: 1px solid #e6ebf2;
  border-radius: 9px;
  background: #f9fbff;
  padding: 8px;
  min-width: 0;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.draft-item-kpi-row span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.draft-item-kpi-row strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.draft-item-compact-count {
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f9fbff;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  width: fit-content;
  min-width: 112px;
}

.draft-item-compact-count strong {
  font-size: 1.05rem;
}

.draft-item-compact-count.complete {
  border-color: #b8e7ca;
  background: #eefcf4;
  color: #177245;
}

.mini-item-note {
  min-height: 36px;
  max-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-item-card .mini-item-actions .btn {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.draft-item-card .mini-item-actions {
  margin-top: auto;
}

.project-waiting-card .mini-item-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.project-waiting-done-note {
  border: 1px solid #b8e7ca;
  border-radius: 10px;
  background: #eefcf4;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #177245;
}

.project-waiting-complete-actions {
  margin-top: 10px;
}

.project-waiting-complete-actions .btn {
  width: 100%;
}

.sent-area-card {
  border-color: #bfe9d3;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  gap: 8px;
}

.sent-card-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.item-kebab-ghost {
  width: 30px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #d8dfeb;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.item-kebab-ghost i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6b7482;
  display: inline-block;
}

.item-history-pop {
  position: absolute;
  top: 44px;
  right: 10px;
  width: min(320px, calc(100% - 20px));
  max-height: 260px;
  overflow: auto;
  border: 1px solid #d6deea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 8px;
  z-index: 3;
  display: none;
}

.item-history-pop.open {
  display: block;
}

.item-history-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.item-history-row {
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 6px;
  background: #f8fafc;
}

.item-history-row strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
}

.item-history-row span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.item-history-row p {
  margin: 4px 0 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #334155;
}

.item-history-empty {
  border: 1px dashed #d5dce8;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

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

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

.sent-compact-meta div {
  border: 1px solid #e6ebf2;
  border-radius: 9px;
  background: #f9fbff;
  padding: 8px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sent-compact-meta span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.sent-compact-meta strong {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sent-compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sent-compact-actions .btn {
  flex: 1;
  min-width: 110px;
}

.sent-compact-actions .btn {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.mini-item-lock {
  font-size: 0.82rem;
  color: #5d6470;
  background: #f5f7fb;
  border: 1px solid #e1e6ef;
  border-radius: 10px;
  padding: 8px 10px;
}

.draft-summary-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.draft-summary-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  min-width: 150px;
  padding: 9px 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.draft-summary-chip span {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.draft-summary-chip strong {
  font-size: 0.98rem;
  color: var(--text);
}

.draft-summary-chip.active {
  border-color: #86d7ac;
  background: #ecfbf3;
}

.draft-summary-detail {
  display: none;
  margin-top: 8px;
}

.draft-summary-detail.open {
  display: block;
}

.draft-summary-detail-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

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

.field label {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
}

.settings-inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-inline-control input[readonly] {
  background: #f8fafc;
  color: #1f2937;
  font-weight: 700;
}

.field .btn-compact[data-action="add-mold-category"] {
  margin-top: 2px;
  width: fit-content;
  min-width: 130px;
}

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

.permission-section {
  margin-top: 14px;
}

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

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

.permission-group-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  padding: 12px;
}

.permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.permission-group-head strong {
  font-size: 0.96rem;
  color: var(--text);
}

.permission-subgroup + .permission-subgroup {
  margin-top: 12px;
}

.permission-subgroup-head {
  font-size: 0.86rem;
  font-weight: 700;
  color: #5a6780;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(112, 129, 160, 0.28);
}

.permission-grid-group {
  gap: 10px 12px;
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.permission-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.permission-check span {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.users-toolbar-card {
  margin-top: 2px;
}

.users-toolbar-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 10px;
}

.users-grid {
  align-items: stretch;
}

.user-card {
  display: grid;
  gap: 12px;
}

.user-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  border: 1px solid #bfdbfe;
}

.user-identity {
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 0.98rem;
  line-height: 1.2;
}

.user-identity .sub {
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status-stack {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.user-role-line {
  font-weight: 800;
  color: #173054;
  font-size: 0.9rem;
}

.user-contact-stack {
  display: grid;
  gap: 4px;
}

.user-contact-stack .sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-stat-strip > div {
  border: 1px solid #e4ecf5;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f8fbff;
}

.user-stat-strip span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.user-stat-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.users-empty {
  grid-column: 1 / -1;
}

.user-manage-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.user-manage-identity {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-manage-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  font-weight: 900;
  font-size: 1rem;
  border: 1px solid #bfdbfe;
}

.user-manage-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-manage-section-card {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .permission-grid-group {
    grid-template-columns: 1fr;
  }
  .users-toolbar-grid {
    grid-template-columns: 1fr;
  }
  .user-manage-hero {
    flex-direction: column;
  }
  .user-manage-meta {
    justify-content: flex-start;
  }
}

.settings-form-cta {
  display: flex;
  align-items: flex-end;
}

.mold-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.mold-group-stack {
  display: grid;
  gap: 10px;
}

.mold-group-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbff;
  overflow: hidden;
}

.mold-group-summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid #edf2fa;
}

.mold-group-summary::-webkit-details-marker {
  display: none;
}

.mold-group-summary-main {
  display: grid;
  gap: 2px;
}

.mold-group-summary-main strong {
  font-size: 0.96rem;
}

.mold-group-summary-main span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.mold-group-caret {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform .15s ease;
}

.mold-group-card[open] .mold-group-caret {
  transform: rotate(180deg);
}

.mold-model-grid.grouped {
  padding: 10px;
}

.mold-model-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.mold-model-card.mold-model-collapsible {
  padding: 0;
  overflow: hidden;
}

.mold-model-summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mold-model-summary::-webkit-details-marker {
  display: none;
}

.mold-model-summary-main {
  display: grid;
  gap: 2px;
}

.mold-model-summary-main span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.mold-model-caret {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform .15s ease;
}

.mold-model-card[open] .mold-model-caret {
  transform: rotate(180deg);
}

.mold-model-content {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.mold-model-title {
  font-size: 0.95rem;
  line-height: 1.2;
}

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

.mold-model-meta > div {
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f9fbff;
  padding: 8px;
}

.mold-model-meta > div.wide {
  grid-column: 1 / -1;
}

.mold-model-meta span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.mold-model-meta strong {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.mold-type-manager-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.mold-type-manager-card {
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.mold-type-manager-card h4 {
  margin: 0;
  font-size: 0.96rem;
}

.mold-type-manager-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.mold-type-manager-row {
  border: 1px solid #d8e4f2;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.mold-type-manager-row[data-action="manager-select-category"] {
  cursor: pointer;
}

.mold-type-manager-row.active {
  border-color: #93dfb6;
  box-shadow: inset 0 0 0 1px #93dfb6;
}

.mold-type-manager-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.mini-item-meta-grid > div {
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
}

.mini-item-meta-grid span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.mini-item-meta-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  padding: 15px;
  background: rgba(255, 255, 255, 0.68);
}

.qr-box {
  display: grid;
  gap: 8px;
}

.stock-scan-hero {
  gap: 14px;
}

.stock-scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.stock-scan-main {
  display: grid;
  gap: 10px;
}

.stock-scan-btn {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 800;
}

.stock-scan-mini-actions {
  display: flex;
  justify-content: flex-start;
}

.stock-last-scan-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe3ff;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(247, 251, 255, 0.92));
}

.stock-last-scan-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.stock-last-scan-head strong {
  font-size: 0.98rem;
}

.stock-last-scan-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.stock-last-scan-grid div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(207, 227, 255, 0.9);
  background: rgba(255, 255, 255, 0.86);
}

.stock-last-scan-grid span,
.stock-last-scan-foot span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.stock-last-scan-grid strong,
.stock-last-scan-foot strong {
  font-size: 0.94rem;
  color: var(--text);
}

.stock-last-scan-foot {
  display: grid;
  gap: 4px;
}

.stock-manual-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
}

.stock-manual-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.stock-manual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.stock-scan-preview {
  display: grid;
  gap: 10px;
  align-content: start;
}

.qr-video {
  width: 100%;
  min-height: 220px;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.qr-status {
  padding: 10px;
  border-radius: 11px;
  font-weight: 600;
  color: #175f37;
  background: #e8f8ee;
  border: 1px solid #c6ebd5;
}

.stock-scan-placeholder {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.stock-last-scan-slip {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.stock-last-scan-slip-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.stock-last-scan-logo {
  width: 96px;
  height: auto;
  object-fit: contain;
}

.stock-last-scan-title-wrap {
  text-align: center;
  align-self: center;
}

.stock-last-scan-title-wrap strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.stock-last-scan-code {
  text-align: right;
  align-self: center;
}

.stock-last-scan-code strong {
  font-size: 0.74rem;
  line-height: 1.2;
  word-break: break-word;
}

.stock-last-scan-slip-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stock-last-scan-slip-meta div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.stock-last-scan-slip-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.stock-last-scan-slip-meta strong {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

.app-modal-qr-decision {
  width: min(560px, calc(100vw - 20px));
}

.qr-decision-slip-wrap {
  display: grid;
  justify-items: center;
  margin-bottom: 10px;
}

.qr-decision-slip {
  width: min(86mm, 100%);
}

.qr-decision-status-card {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr-decision-status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qr-decision-status-head strong {
  font-size: 0.98rem;
}

.qr-decision-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f8ee;
  color: #166534;
  border: 1px solid #b7ebc9;
  font-size: 0.82rem;
  font-weight: 800;
}

.qr-decision-status-badge span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 0.74rem;
  line-height: 1;
}

.qr-decision-actions {
  display: grid;
  gap: 10px;
}

.stock-project-groups {
  display: grid;
  gap: 14px;
}

.stock-project-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.stock-project-toggle,
.stock-element-toggle {
  padding: 0;
  overflow: hidden;
}

.stock-project-toggle > summary,
.stock-element-toggle > summary {
  list-style: none;
  cursor: pointer;
}

.stock-project-toggle > summary::-webkit-details-marker,
.stock-element-toggle > summary::-webkit-details-marker {
  display: none;
}

.stock-project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
}

.stock-project-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.stock-project-items {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.stock-element-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.9);
}

.stock-element-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
}

.stock-element-items {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.stock-project-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(248, 251, 255, 0.86);
}

.stock-project-item-main strong {
  display: block;
}

.stock-project-item-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.shipment-shell {
  display: grid;
  gap: 18px;
}

.shipment-toolbar-card {
  display: grid;
  gap: 14px;
}

.shipment-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  position: relative;
}

.shipment-settings-menu {
  position: relative;
  display: inline-block;
}

.shipment-settings-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.shipment-settings-menu > summary::-webkit-details-marker {
  display: none;
}

.shipment-settings-menu > summary::after {
  content: "▾";
  margin-left: 7px;
  font-size: 0.74rem;
}

.shipment-settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 170px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.shipment-settings-item {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  padding: 9px 11px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.shipment-settings-item:hover,
.shipment-settings-item:focus-visible {
  background: #eef6ff;
  outline: none;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.25;
}

.shipment-toolbar-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.shipment-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.shipment-stat span {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}

.shipment-stat strong {
  font-size: 1.3rem;
}

.shipment-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

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

.shipment-reference-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.shipment-ref-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
}

.shipment-ref-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.shipment-ref-card-head,
.shipment-ref-card-actions,
.shipment-vehicle-head-actions,
.shipment-link-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shipment-manager-modal {
  gap: 14px;
}

.shipment-manager-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.shipment-manager-head > div {
  display: grid;
  gap: 4px;
}

.shipment-manager-list {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.shipment-manager-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96)),
    #fff;
}

.shipment-manager-icon {
  width: 54px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.86);
}

.shipment-manager-icon .shipment-inline-icon-img,
.shipment-manager-icon .shipment-inline-icon {
  width: 38px;
  height: 30px;
  object-fit: contain;
}

.shipment-manager-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.shipment-manager-copy strong {
  color: #0f172a;
  font-size: 0.92rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.shipment-manager-copy span,
.shipment-manager-copy small {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.shipment-manager-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shipment-shipped-modal {
  width: min(980px, calc(100vw - 28px));
}

.shipment-flow-row {
  align-items: flex-start;
}

.shipment-cancel-warning,
.qr-slip-status-note,
.qr-slip-card-note {
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 14px;
  background: #fff7ed;
  color: #92400e;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
}

.qr-slip-card-note {
  margin-top: 10px;
  font-size: 0.78rem;
}

.shipment-manifest-row.cancelled {
  border-color: rgba(239, 68, 68, 0.22);
  background: #fff1f2;
}

.shipment-manifest-row small {
  color: #991b1b;
  font-weight: 700;
}

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

.shipment-vehicle-list,
.shipment-ready-groups {
  display: grid;
  gap: 14px;
}

.shipment-vehicle-grid {
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
}

.shipment-vehicle-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.shipment-vehicle-card.compact {
  gap: 9px;
  padding: 10px;
  align-content: start;
}

.shipment-vehicle-head,
.shipment-section-head,
.shipment-category-head,
.shipment-item-head,
.shipment-project-head,
.shipment-vehicle-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shipment-category-head,
.shipment-item-head,
.shipment-project-head {
  align-items: center;
  padding: 12px 14px;
}

.shipment-category-head strong,
.shipment-item-head strong,
.shipment-project-head strong {
  color: #0f172a;
}

.shipment-vehicle-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.shipment-vehicle-title > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.shipment-vehicle-title strong {
  display: block;
  max-width: 100%;
  color: #0f172a;
  font-size: 0.88rem;
  line-height: 1.12;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.shipment-vehicle-title-text.title-fit-md {
  font-size: 0.78rem;
}

.shipment-vehicle-title-text.title-fit-sm {
  font-size: 0.68rem;
  letter-spacing: -0.01em;
}

.shipment-vehicle-title-text.title-fit-xs {
  font-size: 0.6rem;
  letter-spacing: -0.02em;
}

.shipment-vehicle-title-text.title-fit-xxs {
  font-size: 0.54rem;
  letter-spacing: -0.03em;
}

.shipment-vehicle-title .sub {
  font-size: 0.74rem;
  line-height: 1.15;
  white-space: nowrap;
}

.shipment-inline-icon {
  width: 26px;
  height: 26px;
  stroke: #1f2937;
  stroke-width: 1.7;
  fill: none;
  flex: 0 0 auto;
}

.shipment-inline-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  stroke: none;
  fill: none;
  opacity: 0.92;
}

.shipment-inline-icon-trailer {
  width: 28px;
}

.shipment-inline-icon-combo {
  width: 34px;
  height: 24px;
  opacity: 0.95;
}

.shipment-ready-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shipment-mini-card-head .shipment-inline-icon-img {
  width: 20px;
  height: 20px;
}

.shipment-mini-card-head .shipment-inline-icon-trailer {
  width: 23px;
}

.shipment-link-grid,
.shipment-vehicle-stats,
.shipment-vehicle-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shipment-vehicle-stack {
  display: grid;
  gap: 10px;
}

.shipment-mini-cards {
  display: grid;
  gap: 8px;
}

.shipment-vehicle-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 16px;
  background:
    radial-gradient(110px 70px at 15% 20%, rgba(255, 127, 42, 0.08), transparent 70%),
    radial-gradient(120px 80px at 85% 20%, rgba(24, 169, 87, 0.08), transparent 70%),
    #ffffff;
}

.shipment-vehicle-unit {
  min-width: 0;
  min-height: 104px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.88);
  padding: 8px 6px;
  text-align: center;
  cursor: default;
}

.shipment-vehicle-unit-icon {
  display: grid;
  place-items: center;
  min-height: 36px;
}

.shipment-vehicle-unit-icon .shipment-inline-icon-img {
  width: 52px;
  height: 34px;
  object-fit: contain;
}

.shipment-vehicle-unit-icon .shipment-inline-icon-trailer {
  width: 56px;
}

.shipment-vehicle-unit span:not(.shipment-vehicle-unit-icon) {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
}

.shipment-vehicle-unit strong {
  max-width: 100%;
  color: #0f172a;
  font-size: 0.86rem;
  line-height: 1.08;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shipment-vehicle-plate {
  display: block;
  width: 100%;
}

.shipment-vehicle-plate.plate-fit-md {
  font-size: 0.78rem;
}

.shipment-vehicle-plate.plate-fit-sm {
  font-size: 0.7rem;
}

.shipment-vehicle-plate.plate-fit-xs {
  font-size: 0.62rem;
}

.shipment-vehicle-plate.plate-fit-xxs {
  font-size: 0.56rem;
}

.shipment-vehicle-unit small {
  max-width: 100%;
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shipment-vehicle-unit.empty {
  background: #f1f5f9;
  border-style: dashed;
}

.shipment-vehicle-unit.empty .shipment-inline-icon-img {
  filter: grayscale(1);
  opacity: 0.34;
}

.shipment-vehicle-unit.empty strong,
.shipment-vehicle-unit.empty small {
  color: #94a3b8;
}

.shipment-vehicle-coupler {
  position: relative;
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #cbd5e1;
}

.shipment-vehicle-coupler::before,
.shipment-vehicle-coupler::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  transform: translateY(-50%);
}

.shipment-vehicle-coupler::before {
  left: -2px;
}

.shipment-vehicle-coupler::after {
  right: -2px;
}

.shipment-vehicle-coupler.connected,
.shipment-vehicle-coupler.connected::before,
.shipment-vehicle-coupler.connected::after {
  background: #18a957;
}

.shipment-mini-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.shipment-mini-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.shipment-mini-card strong {
  font-size: 1rem;
}

.shipment-vehicle-actions.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shipment-vehicle-actions.compact .btn {
  width: 100%;
  min-height: 42px;
}

.shipment-link-card,
.shipment-vehicle-stat,
.shipment-vehicle-meta div,
.shipment-assign-summary div,
.shipment-manifest-meta-grid div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fdfefe;
}

.shipment-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.shipment-link-card > div {
  display: grid;
  gap: 4px;
}

.shipment-link-card strong {
  display: block;
}

.shipment-ready-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
}

.shipment-ready-summary strong {
  font-size: 1.5rem;
}

.shipment-ready-count-summary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
}

.shipment-ready-project-list {
  display: grid;
  gap: 8px;
}

.shipment-ready-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.shipment-ready-project-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.shipment-ready-project-row span {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.shipment-link-card span,
.shipment-vehicle-stat span,
.shipment-vehicle-meta span,
.shipment-assign-summary span,
.shipment-manifest-meta-grid span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.shipment-vehicle-body,
.shipment-load-list,
.shipment-manifest-list,
.shipment-project-body,
.shipment-item-body {
  display: grid;
  gap: 10px;
}

.shipment-panel-section {
  display: grid;
  gap: 10px;
}

.shipment-reference-grid.compact {
  gap: 12px;
}

.shipment-ref-list.compact {
  max-height: 180px;
}

.shipment-load-row,
.shipment-ready-row,
.shipment-manifest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

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

.shipment-manifest-row {
  grid-template-columns: 1fr;
  text-align: left;
  cursor: pointer;
}

.shipment-project-toggle,
.shipment-category-toggle,
.shipment-item-toggle {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.shipment-category-toggle {
  border-radius: 14px;
  background: #f8fafc;
}

.shipment-section-toggle {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.shipment-section-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
}

.shipment-section-toggle > summary::-webkit-details-marker {
  display: none;
}

.shipment-section-toggle .shipment-load-list,
.shipment-section-toggle .shipment-manifest-list {
  padding: 0 12px 12px;
}

.shipment-project-toggle > summary,
.shipment-category-toggle > summary,
.shipment-item-toggle > summary {
  list-style: none;
  cursor: pointer;
}

.shipment-project-toggle > summary::-webkit-details-marker,
.shipment-category-toggle > summary::-webkit-details-marker,
.shipment-item-toggle > summary::-webkit-details-marker {
  display: none;
}

.shipment-project-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.shipment-category-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.shipment-item-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.shipment-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.shipment-form-span {
  grid-column: 1 / -1;
}

.shipment-modal-card {
  width: min(860px, calc(100vw - 24px));
}

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

.shipment-manifest-modal {
  width: min(860px, calc(100vw - 24px));
  display: grid;
  gap: 14px;
}

.app-modal-card.app-modal-pdf.shipment-manifest-modal {
  width: min(1180px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.app-modal-card.app-modal-pdf.shipment-manifest-modal.shipment-manifest-success-modal {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.shipment-pdf-preview-head {
  padding: 2px 2px 8px;
  border-bottom: 1px solid #e6edf5;
}

.pdf-preview-shell.shipment-manifest-preview-shell {
  height: auto;
  min-height: 0;
  padding: 18px;
}

.app-modal-card.shipment-load-modal {
  width: min(1180px, calc(100vw - 72px));
  max-height: calc(100vh - 72px);
  overflow-x: hidden;
  overflow-y: auto;
  gap: 18px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.shipment-load-modal .shipment-load-top-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shipment-load-modal .field {
  min-width: 0;
}

.shipment-load-modal select {
  width: 100%;
  min-width: 0;
  font-size: 0.92rem;
}

.shipment-load-inline-warning {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: #fff7ed;
  color: #92400e;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.shipment-load-modal .shipment-project-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  min-width: 0;
}

.shipment-load-modal .shipment-item-body {
  display: grid;
  gap: 8px;
}

.shipment-load-modal .shipment-load-picker {
  max-height: 56vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.shipment-manifest-print-sheet {
  display: grid;
  gap: 8px;
  width: min(794px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
  background: #fff;
  color: #111827;
}

.shipment-invoice-frame {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid #111827;
  background: #fff;
}

.shipment-invoice-top {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1.5px solid #111827;
  padding-bottom: 5px;
}

.shipment-invoice-company,
.shipment-invoice-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipment-invoice-company strong {
  font-size: 0.9rem;
  color: #111827;
  letter-spacing: 0;
}

.shipment-invoice-company span,
.shipment-invoice-title small,
.shipment-party-grid small {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
}

.shipment-invoice-title {
  justify-items: end;
  text-align: right;
}

.shipment-invoice-title span {
  font-size: 0.68rem;
  font-weight: 900;
  color: #334155;
}

.shipment-invoice-title h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #111827;
}

.shipment-party-grid,
.shipment-approval-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.shipment-party-grid > div,
.shipment-approval-grid > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.shipment-party-grid span,
.shipment-approval-grid span {
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-party-grid strong,
.shipment-approval-grid strong {
  color: #111827;
  font-size: 0.76rem;
}

.shipment-manifest-detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.shipment-manifest-detail-grid > div {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.shipment-manifest-detail-grid span {
  color: #64748b;
  font-size: 0.54rem;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-manifest-detail-grid strong {
  color: #111827;
  font-size: 0.66rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.shipment-manifest-detail-grid small {
  color: #475569;
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1.05;
}

.shipment-success-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: #ecfdf5;
  color: #14532d;
}

.shipment-success-check {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}

.shipment-success-banner strong,
.shipment-success-banner span {
  display: block;
}

.shipment-success-banner span {
  color: #166534;
  font-weight: 700;
  font-size: 0.86rem;
}

.shipment-summary-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}

.shipment-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #111827;
}

.shipment-summary-head span {
  color: #64748b;
  font-weight: 800;
  font-size: 0.82rem;
}

.shipment-summary-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.shipment-summary-table th,
.shipment-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.shipment-summary-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-summary-table tr:last-child td {
  border-bottom: 0;
}

.shipment-manifest-brandline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.shipment-manifest-logo {
  width: 152px;
  max-width: 58%;
  object-fit: contain;
}

.shipment-manifest-brandtext {
  display: grid;
  gap: 4px;
  text-align: right;
  flex: 1 1 auto;
}

.shipment-manifest-qr {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.shipment-manifest-qr img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.shipment-manifest-qr span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-align: center;
}

.shipment-manifest-qr-footer {
  align-self: end;
  width: 64px;
}

.shipment-manifest-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shipment-manifest-meta-top {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-weight: 700;
}

.shipment-manifest-info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  padding: 2px 0;
  color: #111827;
  font-size: 0.64rem;
  line-height: 1.2;
}

.shipment-manifest-info-line span {
  white-space: nowrap;
}

.shipment-manifest-info-line b {
  color: #475569;
  font-weight: 900;
}

.shipment-manifest-items {
  display: grid;
  gap: 4px;
  max-height: 50vh;
  overflow: auto;
}

.shipment-manifest-preview-shell .shipment-manifest-items {
  max-height: none;
  overflow: visible;
}

.shipment-manifest-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #111827;
  border-radius: 0;
  overflow: hidden;
  font-size: 0.72rem;
}

.shipment-manifest-table th,
.shipment-manifest-table td {
  padding: 4px 5px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.12;
}

.shipment-manifest-table th:last-child,
.shipment-manifest-table td:last-child {
  border-right: 0;
}

.shipment-manifest-table th {
  background: #111827;
  color: #fff;
  font-size: 0.58rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shipment-manifest-table th:nth-child(1),
.shipment-manifest-table td:nth-child(1) {
  width: 5%;
  text-align: center;
}

.shipment-manifest-table th:nth-child(2),
.shipment-manifest-table td:nth-child(2) {
  width: 23%;
}

.shipment-manifest-table th:nth-child(3),
.shipment-manifest-table td:nth-child(3) {
  width: 28%;
}

.shipment-manifest-table th:nth-child(4),
.shipment-manifest-table td:nth-child(4) {
  width: 12%;
}

.shipment-manifest-table th:nth-child(5),
.shipment-manifest-table td:nth-child(5) {
  width: 22%;
  text-align: left;
  font-size: 0.64rem;
}

.shipment-manifest-table th:nth-child(6),
.shipment-manifest-table td:nth-child(6) {
  width: 10%;
  text-align: center;
}

.shipment-manifest-table tr:last-child td {
  border-bottom: 0;
}

.shipment-manifest-table tr.cancelled td {
  color: #991b1b;
  text-decoration: line-through;
  background: #fff5f5;
}

.shipment-manifest-cancel-note td {
  color: #991b1b;
  font-size: 0.78rem;
  background: #fff7ed;
}

.shipment-manifest-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 0.58rem;
  line-height: 1.2;
}

.shipment-manifest-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: auto;
}

.shipment-manifest-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.shipment-manifest-signatures > div {
  display: grid;
  gap: 3px;
  padding: 6px 7px;
  border: 1px solid #111827;
  border-radius: 0;
  background: #fff;
}

.shipment-manifest-signatures span {
  color: #111827;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.shipment-manifest-signatures label {
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 800;
}

.shipment-signature-name {
  min-height: 14px;
  border-bottom: 1px solid #cbd5e1;
  color: #111827;
  font-weight: 800;
  font-size: 0.72rem;
}

.shipment-signature-line {
  height: 22px;
  border-bottom: 1px solid #111827;
}

.shipment-signature-details {
  display: grid;
  gap: 1px;
  min-height: 10px;
  color: #475569;
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1.05;
}

.shipment-signature-details small {
  display: block;
}

.shipment-load-picker {
  display: grid;
  gap: 12px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.shipment-select-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.shipment-select-row input {
  margin-top: 2px;
}

@media (max-width: 980px) {
  .shipment-grid {
    grid-template-columns: 1fr;
  }

  .shipment-reference-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shipment-reference-grid,
  .shipment-toolbar-stats,
  .shipment-link-grid,
  .shipment-vehicle-stats,
  .shipment-vehicle-meta,
  .shipment-load-top-grid,
  .shipment-assign-summary,
  .shipment-manifest-meta-grid,
  .shipment-manifest-detail-grid,
  .shipment-party-grid,
  .shipment-approval-grid,
  .shipment-form-grid,
  .shipment-manifest-signatures {
    grid-template-columns: 1fr;
  }

  .shipment-invoice-top {
    grid-template-columns: 1fr;
  }

  .shipment-invoice-title {
    justify-items: start;
    text-align: left;
  }

  .shipment-ready-row,
  .shipment-load-row {
    grid-template-columns: 1fr;
  }

  .shipment-ready-count-summary,
  .shipment-ready-project-row {
    grid-template-columns: 1fr;
  }

  .shipment-manifest-footer {
    grid-template-columns: 1fr;
  }

  .shipment-manifest-qr-footer {
    justify-self: start;
  }

  .shipment-manifest-info-line span {
    white-space: normal;
  }

  .shipment-vehicle-actions,
  .shipment-vehicle-head,
  .shipment-manager-head,
  .shipment-project-head,
  .shipment-item-head,
  .shipment-manifest-head {
    flex-direction: column;
    align-items: stretch;
  }

  .shipment-manager-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .shipment-manager-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .shipment-manager-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 820px) {
  .app-modal-card.shipment-load-modal {
    width: min(760px, calc(100vw - 20px));
    max-height: 92vh;
  }

  .shipment-load-modal .shipment-load-top-grid {
    grid-template-columns: 1fr;
  }

  .shipment-load-modal .shipment-project-body {
    grid-template-columns: 1fr;
  }
}

.stock-project-item-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .stock-mobile-summary {
    display: none;
  }

  .stock-scan-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stock-project-item-row {
    grid-template-columns: 1fr;
  }

  .stock-project-item-actions {
    justify-content: flex-start;
  }

  .stock-project-head,
  .stock-element-head {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-last-scan-head {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-last-scan-grid {
    grid-template-columns: 1fr;
  }

  .stock-scan-hero {
    padding: 10px;
  }

  .stock-scan-hero .head {
    margin-bottom: 4px;
  }

  .stock-scan-hero .head h3 {
    font-size: 1.02rem;
  }

  .stock-scan-main {
    gap: 8px;
  }

  .stock-scan-btn {
    min-height: 46px;
    font-size: 0.96rem;
  }

  .qr-status {
    padding: 8px 10px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .stock-manual-panel {
    padding: 8px 10px;
  }

  .stock-manual-panel summary {
    font-size: 0.9rem;
  }

  .stock-scan-mini-actions .btn {
    min-height: 38px;
    font-size: 0.88rem;
  }

  .stock-scan-preview {
    gap: 8px;
  }

  .qr-video {
    min-height: 230px;
    max-height: 280px;
    border-radius: 14px;
  }

  .stock-scan-placeholder {
    min-height: 96px;
    font-size: 0.88rem;
  }

  .stock-last-scan-slip {
    padding: 10px;
    gap: 8px;
  }

  .stock-last-scan-slip-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .stock-last-scan-logo {
    width: 110px;
  }

  .stock-last-scan-title-wrap strong {
    font-size: 0.98rem;
  }

  .stock-last-scan-code {
    text-align: center;
  }

  .stock-last-scan-code strong {
    font-size: 0.76rem;
  }

  .stock-last-scan-slip-meta {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stock-last-scan-slip-meta div {
    padding: 7px 8px;
  }

  .stock-last-scan-slip-meta span {
    font-size: 0.68rem;
  }

  .stock-last-scan-slip-meta strong {
    font-size: 0.82rem;
  }

  .stock-project-card {
    padding: 10px;
    gap: 10px;
  }

  .stock-project-head {
    padding: 10px;
  }

  .stock-project-items {
    padding: 0 10px 10px;
  }

  .stock-element-head {
    padding: 10px 12px;
  }

  .stock-element-items {
    padding: 0 10px 10px;
  }

  .stock-project-item-row {
    padding: 10px;
    gap: 10px;
  }

  .app-modal-qr-decision {
    width: min(100vw - 16px, 480px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 12px;
  }

  .qr-decision-slip-wrap {
    margin-bottom: 8px;
  }

  .qr-decision-status-card {
    padding: 9px 10px;
    gap: 5px;
  }

  .qr-decision-status-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .qr-decision-status-head strong {
    font-size: 0.92rem;
  }

  .qr-decision-status-badge {
    font-size: 0.78rem;
    padding: 5px 9px;
  }

  .qr-decision-actions .btn {
    min-height: 46px;
  }
}

.mobile-backdrop {
  display: none;
}

.no-scroll {
  overflow: hidden;
}

.app-modal-root {
  display: none;
}

.app-modal-root.show {
  display: block;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 24, 0.48);
  z-index: 60;
}

.app-modal-card {
  position: fixed;
  z-index: 61;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 24px));
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  padding: 14px;
  display: grid;
  gap: 10px;
  overscroll-behavior: contain;
}

.app-modal-card.app-modal-xl {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.app-modal-card.app-modal-pdf {
  width: min(1180px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  padding: 10px;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
}

.app-modal-card.app-modal-fault-photo {
  width: min(860px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
}

.fault-photo-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px;
}

.fault-photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.pdf-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdf-preview-title h3 {
  margin: 0;
  font-size: 1.02rem;
}

.pdf-preview-title .sub {
  margin-top: 2px;
  font-size: 0.82rem;
}

.pdf-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdf-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: 10px;
  min-height: 0;
}

.pdf-preview-footer {
  border-top: 1px solid #e6edf5;
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.pdf-preview-confirm-note {
  font-size: 0.84rem;
  color: #475569;
  font-weight: 600;
}

.pdf-zoom-label {
  min-width: 58px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
}

.pdf-preview-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f5f8;
  overflow: auto;
  height: min(78vh, 860px);
}

.pdf-preview-scale {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transition: width 0.12s ease, height 0.12s ease;
}

#pdfPreviewEmbed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pdf-info-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  overflow: auto;
  min-height: 0;
}

.pdf-info-panel h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.pdf-info-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.pdf-info-tab {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.pdf-info-tab.active {
  border-color: #9fd3b7;
  background: #ecfbf3;
  color: #0f7d41;
}

.pdf-tab-panel {
  display: none;
}

.pdf-tab-panel.open {
  display: block;
}

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

.pdf-info-grid > div {
  border: 1px solid #e3e8f1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.pdf-info-grid span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.pdf-info-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-info-note {
  margin-top: 8px;
  border: 1px solid #e3e8f1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.pdf-info-note span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}

.pdf-info-note p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #334155;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-history-list {
  display: grid;
  gap: 8px;
}

.pdf-history-item {
  border: 1px solid #e3e8f1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.pdf-history-item strong {
  display: block;
  font-size: 0.82rem;
  color: #0f172a;
}

.app-success-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #a9e7c4;
  background: #f1fcf5;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-success-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-success-toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1faa59;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 0 0 0 rgba(31, 170, 89, 0.28);
  animation: toastCheckPulse 0.7s ease;
}

.app-success-toast-text {
  font-size: 0.88rem;
  line-height: 1.35;
  color: #14532d;
  font-weight: 700;
}

@keyframes toastCheckPulse {
  0% {
    transform: scale(0.72);
    box-shadow: 0 0 0 0 rgba(31, 170, 89, 0.36);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 14px rgba(31, 170, 89, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(31, 170, 89, 0);
  }
}

.pdf-history-item span {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--muted);
}

.pdf-history-item p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #334155;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-modal-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.app-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notification-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
  max-height: min(58vh, 520px);
  overflow: auto;
}

.notification-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.notification-card.project {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.notification-card.item {
  border-color: #d1fae5;
  background: linear-gradient(180deg, #f7fffb 0%, #ffffff 100%);
}

.notification-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.notification-card-head strong {
  font-size: 0.98rem;
  color: #111827;
}

.notification-card-head span {
  color: #6b7280;
  font-size: 0.78rem;
  white-space: nowrap;
}

.notification-card-project {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.notification-card-desc,
.notification-card-meta {
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.45;
}

.notification-card-meta {
  margin-top: 6px;
}

.app-activity-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 90;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-width: min(360px, calc(100vw - 24px));
  max-width: min(420px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .22s ease, transform .22s ease;
}

.app-activity-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-activity-toast.project {
  border-color: #bfdbfe;
}

.app-activity-toast.item {
  border-color: #bbf7d0;
}

.app-activity-toast-bell {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-size: 18px;
}

.app-activity-toast-text strong {
  display: block;
  margin-bottom: 2px;
  color: #111827;
}

.app-activity-toast-text div {
  color: #4b5563;
  font-size: 0.88rem;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(520px, 100%);
}

.login-logo {
  width: min(280px, 100%);
  height: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 16px;
}

.login-title {
  margin: 0;
}

.login-help-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-weight: 600;
  line-height: 1.45;
}

.login-error {
  margin: 10px 0 0;
  min-height: 20px;
  font-weight: 700;
  color: #b42318;
}

.onur-sync-alert {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 12000;
  display: none;
  max-width: min(720px, 100%);
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(180, 35, 24, 0.35);
  background: var(--danger-soft);
  color: #5c1818;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  font-weight: 600;
  line-height: 1.45;
}

.onur-sync-alert.show {
  display: block;
}

.onur-sync-alert-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.onur-sync-alert-text {
  flex: 1 1 220px;
  min-width: 0;
}

.qr-slip-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.qr-slip-print-root {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86mm, 1fr));
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 2px;
}

.qr-slip-card {
  width: min(86mm, 100%);
  min-height: 54mm;
  height: 54mm;
  border: 1px solid #d6dbe3;
  border-radius: 10px;
  background: #fff;
  padding: 5px 6px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 3px;
}

.qr-slip-head {
  display: block;
}

.qr-slip-topline {
  display: grid;
  grid-template-columns: 30mm 1fr 14mm;
  align-items: center;
  gap: 4px;
}

.qr-slip-brand {
  width: 30mm;
  max-height: 14mm;
  object-fit: contain;
  object-position: left center;
}

.qr-slip-title-wrap {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 0;
  min-height: 14mm;
}

.qr-slip-head strong,
.qr-slip-title-wrap strong {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.qr-slip-head span,
.qr-slip-title-wrap span {
  font-size: 0.58rem;
  color: #4b5563;
  font-weight: 700;
  line-height: 1.05;
}

.qr-slip-head-qr {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
}

.qr-slip-head-code {
  width: 11mm;
  height: 11mm;
  object-fit: contain;
}

.qr-slip-head-qr strong {
  font-size: 0.38rem;
  line-height: 1.02;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.qr-slip-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.qr-slip-meta div {
  border: 1px solid #d8dde6;
  border-radius: 6px;
  background: #fff;
  padding: 2px 3px;
  min-height: 24px;
  overflow: hidden;
}

.qr-slip-meta span {
  display: block;
  font-size: 0.54rem;
  color: #4b5563;
  font-weight: 700;
  line-height: 1.05;
}

.qr-slip-meta strong {
  display: block;
  margin-top: 1px;
  font-size: 0.66rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body.print-qr-slips .app-shell,
  body.print-qr-slips .mobile-tabbar,
  body.print-qr-slips .topbar,
  body.print-qr-slips .sidebar,
  body.print-qr-slips .app-modal-backdrop {
    display: none !important;
  }

  body.print-qr-slips .app-modal-root,
  body.print-qr-slips .app-modal-root.show {
    display: block !important;
  }

  body.print-qr-slips .app-modal-card {
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.print-qr-slips .app-modal-card > :not(.qr-slip-print-root) {
    display: none !important;
  }

  body.print-qr-slips .qr-slip-print-root {
    max-height: none !important;
    overflow: visible !important;
    grid-template-columns: repeat(2, 86mm) !important;
    gap: 6mm !important;
    justify-content: center;
    padding: 4mm;
  }

  body.print-qr-slips .qr-slip-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-shipment-manifest .app-shell,
  body.print-shipment-manifest .mobile-tabbar,
  body.print-shipment-manifest .topbar,
  body.print-shipment-manifest .sidebar,
  body.print-shipment-manifest .app-modal-backdrop {
    display: none !important;
  }

  body.print-shipment-manifest,
  body.print-shipment-manifest .app-modal-root,
  body.print-shipment-manifest .app-modal-root.show {
    display: block !important;
    background: #fff !important;
  }

  body.print-shipment-manifest .app-modal-card {
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.print-shipment-manifest .shipment-manifest-modal > :not(.shipment-manifest-preview-shell) {
    display: none !important;
  }

  body.print-shipment-manifest .shipment-manifest-preview-shell {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  body.print-shipment-manifest .shipment-manifest-print-sheet {
    width: 190mm !important;
    min-height: 277mm !important;
    gap: 0 !important;
    padding: 0 !important;
    color: #111827 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.print-shipment-manifest .shipment-invoice-frame {
    min-height: 263mm !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1.4mm !important;
    padding: 3mm 4mm !important;
    border: 0.5mm solid #111827 !important;
  }

  body.print-shipment-manifest .shipment-invoice-top {
    grid-template-columns: 50mm 1fr !important;
    gap: 2mm !important;
    align-items: center !important;
    padding-bottom: 1.2mm !important;
    border-bottom: 0.5mm solid #111827 !important;
  }

  body.print-shipment-manifest .shipment-manifest-logo {
    width: 39mm !important;
    max-width: 39mm !important;
  }

  body.print-shipment-manifest .shipment-manifest-brandline {
    grid-template-columns: 44mm 1fr 30mm !important;
    align-items: start !important;
  }

  body.print-shipment-manifest .shipment-manifest-brandtext h3 {
    font-size: 18pt !important;
    margin: 0 !important;
  }

  body.print-shipment-manifest .shipment-manifest-qr {
    padding: 0.8mm !important;
    border-radius: 1mm !important;
  }

  body.print-shipment-manifest .shipment-manifest-qr img {
    width: 13mm !important;
    height: 13mm !important;
  }

  body.print-shipment-manifest .shipment-party-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.2mm !important;
  }

  body.print-shipment-manifest .shipment-manifest-detail-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 1mm !important;
  }

  body.print-shipment-manifest .shipment-party-grid > div,
  body.print-shipment-manifest .shipment-manifest-detail-grid > div,
  body.print-shipment-manifest .shipment-manifest-note,
  body.print-shipment-manifest .shipment-manifest-signatures > div {
    border-radius: 0 !important;
    break-inside: avoid;
  }

  body.print-shipment-manifest .shipment-party-grid > div {
    gap: 0.45mm !important;
    padding: 1mm 1.5mm !important;
  }

  body.print-shipment-manifest .shipment-manifest-detail-grid > div {
    gap: 0.35mm !important;
    padding: 0.8mm 1mm !important;
  }

  body.print-shipment-manifest .shipment-invoice-company strong {
    font-size: 9pt !important;
  }

  body.print-shipment-manifest .shipment-invoice-company span,
  body.print-shipment-manifest .shipment-invoice-title small,
  body.print-shipment-manifest .shipment-party-grid small {
    font-size: 5.7pt !important;
  }

  body.print-shipment-manifest .shipment-invoice-title h3 {
    font-size: 13pt !important;
  }

  body.print-shipment-manifest .shipment-party-grid strong {
    font-size: 6.7pt !important;
    line-height: 1.05 !important;
  }

  body.print-shipment-manifest .shipment-manifest-detail-grid strong {
    font-size: 5.9pt !important;
    line-height: 1.05 !important;
  }

  body.print-shipment-manifest .shipment-party-grid span,
  body.print-shipment-manifest .shipment-manifest-detail-grid span {
    font-size: 5.2pt !important;
  }

  body.print-shipment-manifest .shipment-manifest-detail-grid small,
  body.print-shipment-manifest .shipment-signature-details {
    font-size: 5pt !important;
  }

  body.print-shipment-manifest .shipment-manifest-info-line {
    gap: 0.5mm 2.2mm !important;
    padding: 0 !important;
    font-size: 5.7pt !important;
    line-height: 1.05 !important;
  }

  body.print-shipment-manifest .shipment-manifest-items {
    max-height: none !important;
    overflow: visible !important;
  }

  body.print-shipment-manifest .shipment-manifest-table {
    font-size: 6.4pt !important;
    border-radius: 0 !important;
  }

  body.print-shipment-manifest .shipment-manifest-table th,
  body.print-shipment-manifest .shipment-manifest-table td {
    padding: 0.8mm 1mm !important;
    line-height: 1.05 !important;
  }

  body.print-shipment-manifest .shipment-manifest-table th:nth-child(5),
  body.print-shipment-manifest .shipment-manifest-table td:nth-child(5) {
    font-size: 5.8pt !important;
  }

  body.print-shipment-manifest .shipment-manifest-table th {
    font-size: 5.3pt !important;
    letter-spacing: 0 !important;
  }

  body.print-shipment-manifest .shipment-manifest-note {
    grid-template-columns: auto 1fr !important;
    gap: 1.5mm !important;
    padding: 0.8mm 0 0 !important;
    font-size: 5.3pt !important;
    line-height: 1.1 !important;
  }

  body.print-shipment-manifest .shipment-manifest-footer {
    grid-template-columns: 1fr 16mm !important;
    gap: 2mm !important;
    align-items: end !important;
    margin-top: auto !important;
  }

  body.print-shipment-manifest .shipment-manifest-signatures {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2mm !important;
    break-inside: avoid;
  }

  body.print-shipment-manifest .shipment-manifest-signatures > div {
    gap: 0.8mm !important;
    padding: 1.5mm 2mm !important;
  }

  body.print-shipment-manifest .shipment-manifest-signatures span {
    font-size: 6pt !important;
  }

  body.print-shipment-manifest .shipment-manifest-signatures label {
    font-size: 5.4pt !important;
  }

  body.print-shipment-manifest .shipment-signature-name {
    min-height: 3mm !important;
    font-size: 6.2pt !important;
  }

  body.print-shipment-manifest .shipment-signature-line {
    height: 7mm !important;
  }
}

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

  /* Dar / tablet genislik: proje kartlari tam genislik (ustte plan, altta projeler) */
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

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

  .report-hero-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .report-date-switch,
  .report-action-grid {
    justify-self: stretch;
    justify-content: flex-start;
  }

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

  .report-project-inline-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 930px) {
  .main {
    padding: 10px 10px calc(var(--mobile-tabbar-h) + 16px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    background: rgba(243, 245, 248, 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .content {
    gap: 10px;
  }

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 29;
  }

  .menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .main {
    padding: 10px 10px calc(var(--mobile-tabbar-h) + 16px + env(safe-area-inset-bottom));
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

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

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

  .mold-type-manager-layout {
    grid-template-columns: 1fr;
  }

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

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

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

  .planning-project-panel .card {
    position: static;
  }

  .planning-assign-preview {
    grid-template-columns: 1fr;
  }

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

  .report-hero-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .report-hero-logo {
    width: 180px;
    max-width: 52vw;
  }

  .report-project-row-head,
  .report-day-summary-head,
  .planning-active-group-head,
  .planning-group-summary,
  .planning-mold-collapse-summary {
    align-items: center;
    flex-wrap: wrap;
  }

  .report-project-row-head {
    flex-direction: column;
  }

  .app-modal-card {
    width: min(560px, calc(100vw - 12px));
    max-height: calc(100vh - 12px);
    border-radius: 14px;
  }

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

  .qr-slip-print-root {
    grid-template-columns: 1fr;
    max-height: 52vh;
  }

  .qr-slip-card {
    justify-self: center;
  }

  .dashboard-plan-switch {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 44px;
    justify-content: stretch;
  }

  .dashboard-plan-switch strong,
  .dashboard-plan-date-text {
    min-width: 0;
  }

  .dashboard-plan-fill {
    min-width: 0;
  }

  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    row-gap: 8px;
  }

  .topbar > .head {
    flex: 1 1 auto;
    min-width: min(0, 200px);
    max-width: 100%;
  }

  .topbar > .head .topbar-titles h2 {
    font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .top-actions {
    width: auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 1 auto;
  }

  .top-actions > .btn[data-action="open-project-create"] {
    flex: 1 1 100%;
    order: -1;
    justify-content: center;
  }

  .top-actions .btn {
    width: auto;
    min-height: 44px;
    padding: 0 12px;
  }

  .top-notification-btn {
    justify-content: center;
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
  }

  .top-notification-label {
    display: none !important;
  }

  .top-user-desktop {
    display: none !important;
  }

  .top-user-mobile {
    display: block;
  }

  body[data-page="dashboard"] .dashboard-top-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  body[data-page="dashboard"] .dashboard-top-strip .dashboard-welcome-card {
    display: none !important;
  }

  body[data-page="dashboard"] .dashboard-top-strip .kpi-card {
    min-height: 0;
    padding: 8px 6px;
  }

  body[data-page="dashboard"] .dashboard-top-strip .kpi-label {
    font-size: 0.58rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  body[data-page="dashboard"] .dashboard-top-strip .kpi-value {
    margin-top: 4px;
    font-size: clamp(0.95rem, 3.8vw, 1.2rem);
    line-height: 1.1;
  }

  .app-activity-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    min-width: 0;
    max-width: none;
  }

  .notification-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .mobile-tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    gap: 6px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    height: var(--mobile-tabbar-h);
    z-index: 32;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-tabbar::-webkit-scrollbar {
    display: none;
  }

  .mobile-tab-link {
    position: relative;
    border-radius: 12px;
    min-height: calc(var(--mobile-tabbar-h) - 14px);
    min-width: 72px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.01em;
  }

  .mobile-tab-link.active {
    background: #eef3f9;
    color: #0f172a;
  }

  .mobile-tab-icon {
    display: block;
    font-size: 1rem;
    line-height: 1;
  }

  .mobile-tab-label {
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-tab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #f27a1a;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
  }

  .app-modal-card.app-modal-pdf {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 12px;
    padding: 8px;
  }

  .pdf-preview-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pdf-preview-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .pdf-preview-toolbar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .pdf-preview-shell {
    height: calc(100vh - 220px);
  }

  .pdf-info-panel {
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .mobile-tabbar {
    left: 8px;
    right: 8px;
    gap: 4px;
  }

  .mobile-tab-link {
    min-height: calc(var(--mobile-tabbar-h) - 16px);
    min-width: 68px;
    font-size: 0.66rem;
  }

  .mobile-tab-icon {
    font-size: 0.95rem;
  }

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

  body[data-page="planning"] .planning-kpi-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="planning"] .planning-kpi-grid > .kpi-card {
    flex: 0 0 min(68vw, 220px);
    min-height: 56px;
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  body[data-page="planning"] .planning-kpi-grid .kpi-label {
    font-size: 0.76rem;
    white-space: nowrap;
  }

  body[data-page="planning"] .planning-kpi-grid .kpi-value {
    margin-top: 4px;
    font-size: 1.24rem;
    white-space: nowrap;
  }

  body[data-page="planning"] .planning-inline-meta,
  body[data-page="planning"] .planning-safety-alert {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.3;
  }

  body[data-page="planning"] .planning-safety-alert strong {
    font-size: 0.83rem;
  }

  body[data-page="dashboard"] .dashboard-top-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-page="dashboard"] .dashboard-top-strip .dashboard-welcome-card {
    display: none !important;
  }

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

  .settings-inline-control {
    grid-template-columns: 1fr;
  }

  .mold-type-manager-quick-grid {
    grid-template-columns: 1fr;
  }

  .planning-mold-grid {
    grid-template-columns: 1fr;
    padding: 8px 0 0;
  }

  .planning-active-group-detail.open {
    max-height: calc(100vh - 230px);
    padding: 8px;
  }

  .planning-active-group-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .planning-filter-grid {
    grid-template-columns: 1fr;
  }

  .report-kpi-grid,
  .report-project-inline-stats,
  .report-hero-card {
    grid-template-columns: 1fr;
  }

  .report-date-switch {
    width: 100%;
    justify-content: space-between;
  }

  .report-action-grid {
    width: 100%;
  }

  .report-action-grid .btn {
    flex: 1 1 100%;
  }

  .dashboard-plan-group-grid:not(.dashboard-daily-tile-row),
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-project-compact-head,
  .planning-project-compact-row,
  .report-day-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .planning-project-compact-head span,
  .planning-project-compact-row strong {
    flex-shrink: 1;
  }

  .planning-mold-assignment-head,
  .planning-mold-quick-actions,
  .planning-mold-actions {
    grid-template-columns: 1fr;
  }

  .planning-assign-preview,
  .planning-assign-form-grid,
  .planning-assign-modal-special .planning-assign-warning-stack,
  .planning-assign-modal-special .planning-assign-form-grid,
  .planning-assign-modal-special .planning-assign-preview,
  .planning-assign-modal-special .planning-assign-mold-select-grid {
    grid-template-columns: 1fr;
  }

  .planning-assign-warning {
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .planning-assign-mold-check {
    padding: 8px;
  }

  .planning-mold-project {
    font-size: 0.94rem;
  }

  .planning-mold-note-box {
    min-height: 0;
  }

  .project-card,
  .planning-mold-card,
  .report-project-row,
  .report-plan-group,
  .report-day-summary {
    padding: 12px;
  }

  .planning-project-compact-item > summary,
  .planning-project-compact-rows {
    padding-left: 8px;
    padding-right: 8px;
  }

  .planning-project-compact-row,
  .planning-project-compact-summary-chip {
    flex-direction: column;
    align-items: flex-start;
  }

  .planning-mold-assignment-head {
    grid-template-columns: 1fr;
  }

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

  .fault-meta-grid {
    grid-template-columns: 1fr;
  }

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

  .planning-mold-actions {
    grid-template-columns: 1fr;
  }

  .qr-slip-toolbar {
    grid-template-columns: 1fr;
  }

  .qr-slip-card {
    min-height: 54mm;
    height: 54mm;
  }

  .mini-item-meta-grid {
    grid-template-columns: 1fr;
  }

  .topbar h2 {
    font-size: 1.32rem;
  }

  .btn {
    min-height: 48px;
  }

  .kpi-value {
    font-size: 1.8rem;
  }

  .kpi-card-compact .kpi-value {
    font-size: clamp(1rem, 4.6vw, 1.22rem);
  }

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

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

  .project-inline-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

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

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

  .btn-compact {
    min-height: 44px;
    font-size: 0.9rem;
  }

  .item-actions {
    grid-template-columns: 1fr 1fr;
  }

  .mini-items-grid {
    grid-template-columns: 1fr;
  }

  .mini-item-actions {
    grid-template-columns: 1fr;
  }

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

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

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

  .sent-group-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .sent-group-meta {
    text-align: left;
  }

  .draft-item-card {
    min-height: 170px;
  }

  .section-toggle-btn {
    grid-template-columns: 1fr auto;
  }

  .section-toggle-btn h3 {
    grid-column: 1 / -1;
    font-size: 0.96rem;
  }
}
