* {
  box-sizing: border-box;
}

:root {
  --bg: #0f3f49;
  --panel: #111c2e;
  --panel-2: #071120;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --blue: #38bdf8;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --orange: #fb923c;
  --purple: #a78bfa;
  --pink: #f472b6;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 35%),
    linear-gradient(135deg, #0f3f49, #0b2530 45%, #06111f);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
a {
  font-family: inherit;
}

button {
  border: none;
  background: var(--blue);
  color: #042033;
  font-weight: 900;
  padding: 12px 16px;
  border-radius: 15px;
  cursor: pointer;
  transition: 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button.secondary {
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

input {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 15px;
  color: #e5e7eb;
  padding: 13px 14px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

a {
  color: inherit;
}

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

.hero {
  background: linear-gradient(135deg, #111827, #152238);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 28px;
  padding: 42px 34px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  margin-bottom: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.eyebrow {
  display: inline-block;
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: 44px;
  line-height: 1;
  margin: 0 0 22px;
}

.hero p {
  max-width: 780px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  font-weight: 600;
}

.status-stack {
  display: grid;
  gap: 12px;
  min-width: 280px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  padding: 18px;
}

.status-card strong {
  display: block;
  font-size: 17px;
}

.status-card small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.dot.green {
  background: var(--green);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
}

.dot.blue {
  background: var(--blue);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
}

.panel {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.16);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.panel h2 {
  font-size: 26px;
  margin: 0 0 6px;
}

.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.import-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.import-grid {
  display: grid;
  grid-template-columns: 150px 150px 150px 86px 150px 105px;
  gap: 12px;
  align-items: end;
}

.link-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 15px;
  font-weight: 900;
}

.link-button.green {
  background: var(--green);
  color: #052e16;
}

.date-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.date-filter input {
  width: 100%;
  min-height: 44px;
}

.date-filter.small input {
  width: 86px;
}

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

.metrics article {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  padding: 22px;
}

.metrics small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.metrics strong {
  font-size: 38px;
}

.create-op-panel {
  display: grid;
  grid-template-columns: 1fr minmax(520px, 1.2fr);
  gap: 24px;
  align-items: center;
}

.create-op-panel h2 {
  margin: 0 0 6px;
}

.create-op-actions {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.62fr);
  gap: 24px;
}

.cards-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.empty {
  background: rgba(2, 6, 23, 0.55);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  padding: 22px;
  color: var(--muted);
  font-weight: 700;
}

.pedido-card,
.op-card {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 20px;
  padding: 18px;
}

.pedido-card.selecionado {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.pedido-card.bloqueado {
  opacity: 0.82;
}

.pedido-topo,
.op-topo {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.pedido-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.check-pedido {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--blue);
}

.pedido-card h3,
.op-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.pedido-card p,
.op-card p {
  margin: 4px 0;
  color: var(--muted);
  font-weight: 700;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
  white-space: nowrap;
}

.badge.blue {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.badge.yellow {
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.08);
}

.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.actions button {
  padding: 10px 13px;
  font-size: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 42px 22px;
  overflow: auto;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(1180px, 100%);
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 28px;
  position: relative;
  color: #e5e7eb;
}

.modal-close {
  position: absolute;
  right: 22px;
  top: 18px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #1e293b;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.modal-header {
  margin-bottom: 22px;
}

.modal-header h2 {
  font-size: 32px;
  margin: 8px 0 4px;
}

.modal-header p {
  color: var(--muted);
  margin: 0;
}

.op-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}

.op-summary-grid div {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 15px;
}

.op-summary-grid small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
}

.op-summary-grid strong {
  font-size: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.op-details-list {
  display: grid;
  gap: 16px;
}

.op-detail-card {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  padding: 18px;
}

.op-detail-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.op-detail-top h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.op-detail-top p {
  margin: 0;
  color: var(--muted);
}

.op-flow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 14px 0 18px;
}

.op-flow span {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  padding: 8px 5px;
  background: #0f172a;
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.op-flow span.done {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.op-flow span.active {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.45);
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.modal-table th {
  background: #1e293b;
  color: #e5e7eb;
  text-align: left;
  padding: 11px;
  font-size: 12px;
}

.modal-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 11px;
  color: #cbd5e1;
  font-size: 13px;
}

.modal-table small {
  color: var(--yellow);
  font-size: 12px;
}

.modal-table.compact th,
.modal-table.compact td {
  font-size: 12px;
  padding: 9px;
}

.status-laser {
  color: var(--blue) !important;
}

.status-dobra {
  color: var(--purple) !important;
}

.status-solda {
  color: var(--orange) !important;
}

.status-pintura {
  color: var(--pink) !important;
}

.status-montagem {
  color: var(--yellow) !important;
}

.status-expedicao {
  color: #60a5fa !important;
}

.status-finalizado {
  color: #4ade80 !important;
}

.status-pendencia {
  color: #f87171 !important;
}

.status-neutro {
  color: var(--muted) !important;
}

@media (max-width: 1200px) {
  .import-panel {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

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

@media (max-width: 680px) {
  .app-shell {
    width: calc(100% - 24px);
    margin: 12px auto;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .status-stack {
    width: 100%;
  }

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

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

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

  .pedido-topo,
  .op-topo {
    flex-direction: column;
  }

  .badges {
    align-items: flex-start;
  }
}