:root {
  --bg: #f4f7fb;
  --sidebar: #0f172a;
  --sidebar-soft: #111c32;
  --sidebar-line: rgba(255, 255, 255, 0.11);
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5eaf2;
  --line-strong: #d6deeb;
  --primary: #2f5bea;
  --primary-strong: #1d4ed8;
  --primary-soft: #e9efff;
  --green: #16a34a;
  --green-soft: #eaf8ef;
  --amber: #d97706;
  --amber-soft: #fff4df;
  --red: #dc2626;
  --red-soft: #fff1f2;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar-width: 320px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  color: #e5e7eb;
  background:
    radial-gradient(circle at 16% 0%, rgba(47, 91, 234, 0.24), transparent 35%),
    linear-gradient(180deg, #111827 0%, #0b1120 100%);
  border-right: 1px solid var(--sidebar-line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 20px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f7cff 0%, #1f9a70 100%);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 16px 30px rgba(47, 91, 234, 0.28);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #a8b3c7;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 700;
  text-align: left;
  transition: 0.18s ease;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.06);
}

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

.nav-item.active {
  color: #ffffff;
  background: rgba(47, 91, 234, 0.22);
  border-color: rgba(147, 197, 253, 0.28);
  box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-section {
  padding: 16px;
  border: 1px solid var(--sidebar-line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.45);
}

.section-caption,
.label {
  margin-bottom: 10px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-action {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.stack-card {
  display: grid;
  gap: 11px;
}

.stack-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #cbd5e1;
}

.stack-line span {
  width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.stack-line strong {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #dbe3ef;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--sidebar-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.footer-kicker {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-status {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-weight: 700;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.main-content {
  min-width: 0;
  padding: 38px clamp(28px, 4vw, 56px) 52px;
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 91, 234, 0.12), transparent 26%),
    var(--bg);
}

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

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 800;
  color: var(--text);
}

h2 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 800;
}

h3 {
  font-size: 17px;
  font-weight: 800;
}

.page-subtitle {
  max-width: 700px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  padding: 13px 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #3b66f5 0%, #1d4ed8 100%);
  box-shadow: 0 16px 30px rgba(29, 78, 216, 0.24);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  padding: 12px 18px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid #d6e0ff;
}

.ghost-button {
  padding: 10px 12px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 28px;
  line-height: 1;
}

.large {
  padding: 16px 24px;
  border-radius: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.status-message {
  position: sticky;
  top: 16px;
  z-index: 20;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.status-message.error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.hidden {
  display: none !important;
}

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

.metric-card {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.metric-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
}

.metric-icon.blue { color: var(--primary); background: var(--primary-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  margin-top: 5px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.workflow-panel {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 22px;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.workflow-step span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.workflow-step.active span {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.workflow-step strong {
  font-size: 13px;
  white-space: nowrap;
}

.workflow-line {
  height: 1px;
  background: var(--line);
}

.list-panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.toolbar-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  min-width: min(420px, 42vw);
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--muted);
}

.search-box svg {
  width: 18px;
  height: 18px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

select {
  width: auto;
  min-width: 160px;
  height: 46px;
  padding: 0 38px 0 14px;
  border-radius: 14px;
  font-weight: 700;
}

input {
  height: 50px;
  padding: 0 15px;
  border-radius: 14px;
}

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 14px 15px;
  border-radius: 16px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9ab3ff;
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.12);
}

.change-table-wrap {
  overflow-x: auto;
}

.change-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.change-table th {
  padding: 14px 18px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.change-table td {
  padding: 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: #1f2937;
  font-size: 14px;
}

.change-table tr:last-child td {
  border-bottom: 0;
}

.change-table tr:hover td {
  background: #fbfdff;
}

.request-id {
  font-weight: 800;
  color: var(--primary-strong);
}

.summary-cell {
  max-width: 420px;
}

.summary-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 800;
  line-height: 1.4;
}

.summary-sub {
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
}

.person-cell strong,
.part-cell strong {
  display: block;
  margin-bottom: 4px;
}

.person-cell span,
.part-cell span,
.date-cell {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.status-submitted { color: #1e3a8a; background: #dbeafe; }
.badge.status-review { color: #92400e; background: #fef3c7; }
.badge.status-approved { color: #166534; background: #dcfce7; }
.badge.status-rejected { color: #991b1b; background: #fee2e2; }
.badge.priority-high { color: #991b1b; background: #fee2e2; }
.badge.priority-medium { color: #1e3a8a; background: #e0e7ff; }
.badge.priority-low { color: #166534; background: #dcfce7; }

.table-action {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--primary-strong);
  font-weight: 800;
}

.empty-state {
  padding: 72px 24px;
  text-align: center;
}

.empty-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 32px;
  font-weight: 800;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.empty-state p {
  margin-bottom: 20px;
  color: var(--muted);
}

.request-layout {
  display: grid;
  gap: 22px;
  max-width: 1500px;
}

.form-panel {
  padding: 26px;
}

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

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading p,
.helper-text {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.required-pill {
  padding: 8px 12px;
  border-radius: 999px;
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  font-size: 12px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.textarea-grid textarea {
  min-height: 140px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.wide-label {
  margin-top: 16px;
}

.required > span::after {
  content: " *";
  color: var(--red);
}

.parts-container {
  display: grid;
  gap: 16px;
}

.part-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfdff;
}

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

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

.upload-box {
  min-height: 150px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed #b8c6da;
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
}

.upload-box span {
  font-weight: 800;
}

.upload-box small {
  color: var(--muted);
  font-weight: 600;
}

.upload-box input[type="file"] {
  height: auto;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
}

.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.preview-strip img,
.photo-strip img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.submit-bar {
  position: sticky;
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.submit-bar p {
  margin-top: 5px;
  color: var(--muted);
}

.detail-modal {
  width: min(980px, calc(100vw - 36px));
  max-height: min(860px, calc(100vh - 36px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 35px 90px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.detail-modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
}

.detail-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.detail-content {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 24px;
  background: #f8fafc;
}

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

.detail-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-item p {
  color: #1f2937;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-section-title {
  margin: 24px 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.part-detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.part-detail-card + .part-detail-card {
  margin-top: 12px;
}

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

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

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

  .sidebar-section.stack-card,
  .sidebar-footer {
    display: none;
  }

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

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

  .workflow-line {
    display: none;
  }

  .panel-header,
  .topbar,
  .submit-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-panel {
    align-items: stretch;
  }

  .search-box {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .main-content {
    padding: 24px 16px 36px;
  }

  .top-actions,
  .toolbar-panel,
  .form-grid.two,
  .photo-grid,
  .detail-grid,
  .part-detail-row {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  h1 {
    font-size: 36px;
  }

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


.translating-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.translating-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}
