:root {
  color-scheme: dark;
  --bg-primary: #0a0c12;
  --bg-secondary: rgba(18, 22, 34, 0.88);
  --bg-tertiary: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f7fb;
  --text-secondary: #a9b2c7;
  --accent: #ff2b43;
  --accent-strong: #ff5a6d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(255, 43, 67, 0.22), transparent 28%),
    radial-gradient(circle at right center, rgba(80, 112, 255, 0.16), transparent 24%),
    linear-gradient(135deg, #07090f 0%, #101522 45%, #0b0e15 100%);
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 10px;
}

.toast-notification {
  background-color: #2ec4b6;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: sans-serif;
  font-weight: 700;
  animation: fadeIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

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

.auth-layout {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card,
.dashboard,
.panel-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.login-card {
  width: min(100%, 520px);
  display: grid;
  gap: 32px;
}

.brand-chip,
.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 43, 67, 0.12);
  color: #ffd6dc;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-card h2,
.dashboard-header h2 {
  margin: 18px 0 12px;
  line-height: 1.05;
}

.card-text,
.panel-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.field-group input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field-group select {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  appearance: none;
  color-scheme: dark;
}

.field-group select {
  background: #2a2a2a;
  color: #f5f7fb;
}

.field-group input::placeholder {
  color: #7f889d;
}

.field-group input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.field-group select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.field-group input:focus {
  border-color: rgba(255, 90, 109, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 43, 67, 0.18);
  transform: translateY(-1px);
}

.field-group select:focus {
  border-color: rgba(255, 90, 109, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 43, 67, 0.18);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.tab-button,
.ghost-button,
.danger-button,
.warning-button,
.success-button {
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(255, 43, 67, 0.28);
}

.primary-button:hover,
.secondary-button:hover,
.tab-button:hover,
.ghost-button:hover,
.danger-button:hover,
.warning-button:hover,
.success-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: 0 22px 44px rgba(255, 43, 67, 0.35);
}

.secondary-button,
.tab-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-button,
.danger-button,
.warning-button,
.success-button {
  padding: 0 18px;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
}

#addSpecificationItemButton {
  background: #dc2626;
  color: #ffffff;
  border-color: rgba(220, 38, 38, 0.92);
}

#addSpecificationItemButton:hover {
  background: #b91c1c;
}

.danger-button {
  background: rgba(255, 59, 92, 0.14);
}

.warning-button {
  background: rgba(255, 174, 66, 0.14);
}

.success-button {
  background: rgba(43, 212, 139, 0.14);
}

.secondary-button:hover,
.tab-button:hover,
.ghost-button:hover,
.danger-button:hover,
.warning-button:hover,
.success-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: #ff8f9d;
}

.form-message-success {
  color: #7ee2ae;
}

.dashboard {
  background: rgba(10, 14, 22, 0.82);
  border-radius: 32px;
  padding: 28px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

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

.subtle-admin-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.tab-button {
  padding: 0 22px;
  font-weight: 600;
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(255, 43, 67, 0.95), rgba(255, 90, 109, 0.88));
  border-color: transparent;
  box-shadow: 0 18px 38px rgba(255, 43, 67, 0.22);
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
}

.single-panel {
  grid-template-columns: 1fr;
}

.panel-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 28px;
}

.panel-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
}

.admin-tab-panel {
  display: grid;
  gap: 24px;
}

.admin-content-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.9fr);
}

.form-card {
  display: grid;
  gap: 22px;
}

.project-form-panel.form-card {
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.compact-heading {
  align-items: center;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.entity-form {
  display: grid;
  gap: 12px;
}

.project-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.8fr);
  gap: 12px;
}

.specification-fieldset {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.specification-fieldset legend {
  padding: 0 10px;
  color: var(--text-primary);
  font-weight: 700;
}

.spec-grid,
.stats-grid,
.project-cards-grid,
.workers-list-grid {
  display: grid;
  gap: 16px;
}

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

.spec-builder {
  display: grid;
  gap: 10px;
}

.spec-builder-grid {
  align-items: end;
}

.compact-spec-builder-grid {
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.5fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
}

.compact-spec-builder-grid .field-group {
  gap: 6px;
  font-size: 0.9rem;
}

.compact-spec-builder-grid .field-group input,
.compact-spec-builder-grid .field-group select {
  min-height: 42px;
  padding: 10px 12px;
}

.compact-spec-actions {
  align-items: stretch;
  gap: 8px;
}

.compact-spec-actions .ghost-button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.specification-list {
  display: grid;
  gap: 14px;
}

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

.specification-group-head h4 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.2;
}

.specification-group-head-composite h4 {
  color: #007bff;
}

.composite-highlight {
  color: #007bff !important;
}

.specification-group-head-finished h4 {
  color: #e63946;
}

.specification-group-list {
  display: grid;
  gap: 10px;
}

.specification-flat-card {
  display: grid;
  gap: 8px;
}

.specification-node {
  display: grid;
  gap: 6px;
}

.specification-children {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
}

.specification-recipe-details {
  display: grid;
  gap: 8px;
  margin-top: -2px;
  padding: 8px 10px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.specification-recipe-details[hidden] {
  display: none;
}

.specification-recipe-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(124, 183, 255, 0.18);
  border-radius: 999px;
  background: rgba(124, 183, 255, 0.08);
  color: #7cb7ff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.specification-recipe-toggle:hover {
  background: rgba(124, 183, 255, 0.14);
  border-color: rgba(124, 183, 255, 0.28);
}

.specification-recipe-toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

.specification-recipe-toggle.is-expanded .specification-recipe-toggle-icon {
  transform: rotate(180deg);
}

.specification-recipe-tree {
  display: grid;
  gap: 6px;
}

.spec-components-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
}

.spec-components-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.spec-components-copy {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.spec-components-note {
  margin: 8px 0 0;
  color: #7cb7ff;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.45;
}

.spec-components-list {
  display: grid;
  gap: 8px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
}

.spec-components-details {
  max-width: 100%;
  overflow: hidden;
}

.spec-components-summary {
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--text-primary);
  padding: 2px 0;
}

.spec-components-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.spec-component-option {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  font-size: 0.8rem;
}

.spec-component-option.is-selected {
  border-color: rgba(124, 183, 255, 0.35);
  background: rgba(124, 183, 255, 0.08);
}

.spec-component-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.spec-component-copy strong {
  font-size: 0.8rem;
  line-height: 1.2;
}

.spec-component-copy small,
.spec-components-empty small {
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.15;
}

.spec-component-qty input {
  min-height: 26px;
  max-width: 64px;
  padding: 2px 6px;
  font-size: 0.8rem;
}

.spec-component-check input {
  width: 14px;
  height: 14px;
}

.specification-row,
.specification-empty {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.specification-row-tree {
  min-height: 42px;
}

.specification-tree-branch {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.specification-empty {
  display: grid;
  grid-template-columns: 1fr;
}

.specification-cell {
  min-width: 0;
}

.specification-left-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 1 1 auto;
}

.specification-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.specification-name {
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.25;
}

.specification-name-composite {
  color: #007bff;
}

.specification-name-finished {
  color: #e63946;
}

.specification-category-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.64rem;
  white-space: nowrap;
}

.specification-category-tag-simple {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.specification-category-tag-composite {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}

.specification-category-tag-finished {
  background: rgba(255, 43, 67, 0.18);
  color: #ff9aa7;
}

.specification-right-group {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  padding-top: 1px;
}

.specification-qty-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.specification-qty-group-stacked {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.specification-qty-label {
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.05;
}

.item-qty {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

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

.spec-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  transition: color 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.spec-edit-button:hover {
  color: #7cb7ff;
  background: rgba(124, 183, 255, 0.08);
}

.spec-delete-button:hover {
  color: #ff8f9d;
  background: rgba(255, 95, 122, 0.08);
}

.spec-action-button:hover {
  opacity: 1;
}

.specification-cell span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.specification-cell strong {
  display: block;
  word-break: break-word;
  font-size: 0.84rem;
}

.project-form-panel input[type="number"].number-field-empty,
.inventory-card input[type="number"].number-field-empty {
  border: 2px solid #ef4444;
}

.project-form-panel input[type="number"].number-field-empty:focus,
.inventory-card input[type="number"].number-field-empty:focus {
  border-color: rgba(255, 90, 109, 0.9);
}

.highlight-ready-product {
  color: #ef4444 !important;
  font-weight: 700 !important;
}

.inventory-panel-card {
  gap: 18px;
}

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

.inventory-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inventory-card .field-group {
  gap: 6px;
}

.inventory-card .field-group input,
.inventory-card .field-group select,
.inventory-card .primary-button {
  min-height: 42px;
}

.inventory-card-heading h4 {
  margin: 0;
}

.inventory-card-waste {
  border-color: rgba(255, 90, 109, 0.28);
  background: rgba(255, 90, 109, 0.06);
}

.inventory-card-found {
  border-color: rgba(74, 222, 128, 0.26);
  background: rgba(74, 222, 128, 0.06);
}

.icon-button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 59, 92, 0.14);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 59, 92, 0.22);
}

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

.records-section {
  display: grid;
  gap: 18px;
}

.project-view-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.project-view-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
}

.project-view-button.active {
  background: linear-gradient(135deg, rgba(255, 43, 67, 0.95), rgba(255, 90, 109, 0.88));
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(255, 43, 67, 0.2);
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
}

.analytics-filter {
  width: min(100%, 360px);
}

.analytics-filter-small {
  width: min(100%, 220px);
}

.analytics-filter input[type="date"] {
  min-height: 48px;
}

.time-analytics-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.time-analytics-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.time-analytics-card-head h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.15;
}

.time-analytics-card-subtitle {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.time-analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 6px;
  width: min(100%, 420px);
}

.time-analytics-summary-grid.is-day {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  width: min(100%, 460px);
}

.time-analytics-summary-item {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.time-analytics-summary-item span {
  color: var(--text-secondary);
  font-size: 0.66rem;
  line-height: 1.1;
}

.time-analytics-summary-item strong {
  font-size: 0.84rem;
  line-height: 1.1;
}

.time-analytics-table-shell {
  overflow-x: auto;
}

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

.time-analytics-table th,
.time-analytics-table td {
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  line-height: 1.2;
}

.time-analytics-table th {
  color: var(--text-secondary);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-analytics-table td {
  font-size: 0.8rem;
}

.time-analytics-table tbody tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.export-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.project-form-panel {
  max-width: 960px;
}

.worker-form-panel {
  max-width: 760px;
}

.worker-form-panel.hidden + .records-section {
  margin-top: 0;
}

.table-shell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.workers-table,
.projects-table,
.reports-table {
  width: 100%;
  border-collapse: collapse;
}

.workers-table th,
.workers-table td,
.projects-table th,
.projects-table td,
.reports-table th,
.reports-table td {
  padding: 18px 20px;
  text-align: left;
  vertical-align: middle;
}

.projects-table th,
.projects-table td {
  padding: 4px 8px;
  vertical-align: middle;
  line-height: 1.15;
}

.workers-table thead th,
.projects-table thead th,
.reports-table thead th {
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.workers-table tbody tr {
  transition: background 0.2s ease;
}

.workers-table tbody tr:hover,
.projects-table tbody tr:hover,
.reports-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.workers-table tbody tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.projects-table tbody tr + tr td,
.reports-table tbody tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reports-table tbody tr {
  transition: background 0.2s ease;
}

.reports-table td {
  white-space: nowrap;
}

.reports-table td.report-detail-cell {
  white-space: normal;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-meta {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

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

.pagination-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
}

.pagination-current {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

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

.warehouse-negative {
  color: #ff8f9d;
}

.assembly-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.assembly-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.assembly-capacity-box {
  display: grid;
  gap: 2px;
  min-width: 126px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.assembly-capacity-box span {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.assembly-capacity-box strong {
  font-size: 1rem;
}

#assemblyList {
  gap: 8px;
}

#assemblyList .table-shell {
  border-radius: 12px;
}

#assemblyList .assembly-forecast-table {
  width: 100%;
  table-layout: fixed;
}

#assemblyList .assembly-col-name {
  width: 52%;
}

#assemblyList .assembly-col-required,
#assemblyList .assembly-col-available,
#assemblyList .assembly-col-capacity {
  width: 16%;
}

#assemblyList .progress-table th,
#assemblyList .progress-table td {
  padding: 6px 8px;
  vertical-align: top;
}

#assemblyList .progress-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

#assemblyList .progress-detail-name {
  font-size: 0.88rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

#assemblyList .progress-detail-category {
  margin-top: 2px;
  font-size: 0.7rem;
}

#assemblyList .progress-number-cell {
  font-size: 0.84rem;
}

#assemblyList .assembly-forecast-head,
#assemblyList .assembly-forecast-number-cell {
  text-align: center;
}

#assemblyList .assembly-forecast-head-name {
  text-align: left;
}

#assemblyList .assembly-forecast-name-cell {
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  line-height: 1.4;
}

#assemblyList .assembly-forecast-number-cell {
  white-space: nowrap;
  vertical-align: top;
}

#assemblyList .panel-card {
  gap: 8px;
}

.progress-table-shell {
  overflow-x: auto;
}

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

.progress-table th,
.progress-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.negative-balance {
  color: #ef4444;
  font-weight: 700;
}

.progress-table thead th {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.th-subtitle {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.1;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
}

.progress-table tbody tr {
  transition: background 0.2s ease;
}

.progress-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.progress-table tbody tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-table-row-editing td {
  background: rgba(255, 255, 255, 0.025);
}

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

.shipment-overview-head h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
}

.shipment-overview-head p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.shipment-overview-badge {
  white-space: nowrap;
}

.shipment-table th:last-child,
.shipment-table td:last-child {
  width: 24%;
}

.shipment-status-stack {
  display: grid;
  gap: 10px;
}

.shipment-action-inline {
  align-items: center;
  gap: 10px;
}

.shipment-action-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.shipment-inline-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.shipment-inline-form {
  width: 100%;
}

.shipment-inline-edit-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.shipment-inline-edit-row input {
  min-width: 0;
}

.shipment-save-button {
  min-height: 36px;
  padding: 0 12px;
}

.shipment-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.shipment-status-idle {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
}

.shipment-status-active {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
}

.shipment-status-complete {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.shipment-status-muted {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.progress-detail-name {
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.25;
}

.progress-detail-category,
.progress-caption,
.correction-note {
  color: var(--text-secondary);
}

.progress-detail-category {
  margin-top: 4px;
  font-size: 0.76rem;
}

.progress-number-cell {
  font-weight: 700;
  white-space: nowrap;
}

.progress-fact-inline,
.progress-bar-head,
.correction-form-row {
  display: grid;
  gap: 2px;
}

.progress-fact-inline {
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.progress-bar-cell {
  min-width: 260px;
}

.progress-bar-track {
  position: relative;
  overflow: hidden;
  min-height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
  width: min(var(--progress-width, 0%), 100%);
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2b43 0%, #ff6b7b 50%, #ffd166 100%);
  box-shadow: 0 6px 18px rgba(255, 43, 67, 0.24);
  transition: width 0.6s ease;
}

.progress-bar-head {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.progress-percent {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.progress-caption {
  font-size: 0.74rem;
  line-height: 1.3;
}

.progress-edit-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.82rem;
}

.correction-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compact-correction-row {
  align-items: end;
}

.correction-field {
  flex: 1 1 220px;
  gap: 6px;
}

.correction-field span {
  font-size: 0.75rem;
}

.correction-form .field-group input {
  min-height: 38px;
  padding: 8px 10px;
}

.correction-actions {
  gap: 8px;
}

.correction-actions .primary-button,
.correction-actions .ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

.correction-note {
  font-size: 0.74rem;
  line-height: 1.4;
}

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

.projects-table .table-actions {
  align-items: center;
  gap: 4px;
}

.table-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.projects-table .table-button {
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1;
  border-width: 1px;
  background: transparent;
  box-shadow: none;
}

.table-role {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-role.archived-role {
  background: rgba(255, 174, 66, 0.12);
  border-color: rgba(255, 174, 66, 0.26);
}

.table-role.active-role {
  background: rgba(43, 212, 139, 0.12);
  border-color: rgba(43, 212, 139, 0.26);
}

.project-name-cell {
  display: grid;
  gap: 4px;
}

.projects-table .project-name-cell {
  gap: 2px;
}

.projects-table .project-name-cell strong {
  line-height: 1.15;
}

.projects-table .project-name-cell small {
  line-height: 1;
}

.projects-table .table-role {
  min-height: 20px;
  padding: 2px 8px;
  font-size: 0.68rem;
  line-height: 1;
}

.project-name-cell small,
.modal-copy {
  color: var(--text-secondary);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 9, 16, 0.78);
  backdrop-filter: blur(16px);
}

.modal-dialog {
  width: min(100%, 560px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18, 22, 34, 0.96), rgba(10, 13, 21, 0.98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
  padding: 28px;
}

.restore-project-modal {
  display: grid;
  gap: 22px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-close-button {
  min-height: 40px;
  padding: 0 14px;
}

.modal-copy {
  margin: 0;
  line-height: 1.6;
}

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

.modal-actions .success-button,
.modal-actions .warning-button {
  min-height: 50px;
  padding: 10px 16px;
  text-align: center;
}

.worker-flow-shell {
  display: grid;
  justify-items: center;
}

.worker-header-main {
  min-width: 0;
}

.worker-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: none;
}

.worker-logout-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.worker-logout-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.worker-flow-card {
  width: min(100%, 760px);
  display: grid;
  gap: 24px;
  padding: 32px;
}

.worker-step-heading {
  display: grid;
  gap: 10px;
  text-align: center;
}

.worker-step-heading h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.worker-step-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.worker-entry-form {
  display: grid;
  gap: 20px;
}

.worker-entry-form .field-group input,
.worker-entry-form .field-group select,
.worker-cta-button {
  min-height: 68px;
  font-size: 1.05rem;
}

.worker-actions-stack {
  display: grid;
  gap: 14px;
}

.worker-cart-list {
  display: grid;
  gap: 14px;
}

.worker-cart-item {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.worker-cart-content {
  display: grid;
  gap: 8px;
}

.worker-cart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.worker-cart-item h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1.3;
}

.worker-cart-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.worker-cart-summary {
  color: var(--text-secondary);
  line-height: 1.6;
}

.worker-cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.worker-cart-quantity {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 800;
}

.worker-cart-remove-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 90, 109, 0.22);
  border-radius: 8px;
  background: rgba(255, 59, 92, 0.1);
  color: #ff9eaa;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.worker-cart-remove-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 59, 92, 0.16);
  border-color: rgba(255, 90, 109, 0.34);
}

.success-state {
  justify-items: center;
}

.empty-table-state {
  padding: 26px 20px;
}

.project-cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.project-card,
.stat-box {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.project-card {
  padding: 24px;
}

.project-card {
  display: grid;
  gap: 18px;
}

.project-card.is-archived {
  opacity: 0.82;
  border-color: rgba(255, 174, 66, 0.32);
}

.card-header,
.card-actions,
.specification-summary,
.worker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header {
  align-items: flex-start;
  justify-content: space-between;
}

.card-header h4 {
  margin: 0 0 8px;
}

.meta-label,
.empty-state small {
  color: var(--text-secondary);
}

.specification-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.spec-pill {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.spec-pill span,
.stat-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.spec-pill strong,
.stat-box strong {
  font-size: 1.25rem;
}

.card-actions button {
  min-height: 46px;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

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

.stat-box {
  padding: 20px;
}

.tab-placeholder,
.empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.empty-state {
  align-items: flex-start;
}

.hidden {
  display: none !important;
}

.muted-card,
.worker-empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}

@media (max-width: 920px) {
  .panel-grid,
  .admin-content-grid,
  .inventory-grid,
  .project-top-grid,
  .spec-grid,
  .specification-summary,
  .specification-row,
  .spec-component-option {
    grid-template-columns: 1fr;
  }

  .specification-right-group {
    justify-content: flex-end;
  }

  .shipment-overview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .shipment-table th:last-child,
  .shipment-table td:last-child {
    width: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding: 20px 0;
  }

  .login-card,
  .dashboard {
    padding: 24px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  #workerDashboard .dashboard-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .admin-header-actions {
    justify-content: stretch;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .section-heading,
  .card-header,
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .project-view-switch,
  .modal-actions {
    width: 100%;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .table-shell {
    overflow-x: auto;
  }

  .workers-table {
    min-width: 720px;
  }

  .projects-table,
  .reports-table {
    min-width: 720px;
  }
}
