/* Levantamento DXF SPDA — tema escuro alinhado ao Portal do Raio.
   Paleta da portal-common.css (--pr-*). Estrutura idêntica à versão sandbox
   (levantamento-dxf-spda-clean/styles.css); só as cores mudam. */
:root {
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(245, 158, 11, 0.18);
  --line-soft: rgba(255, 255, 255, 0.08);
  --panel: #1a2432;
  --soft: #0a1520;
  --input-bg: #0d1926;
  --orange: #f59e0b;
  --orange-dark: #d97706;
  --green: #34d399;
  --green-bg: rgba(16, 185, 129, 0.12);
  --amber: #fcd34d;
  --amber-bg: rgba(245, 158, 11, 0.10);
  --red: #fca5a5;
  --red-bg: rgba(239, 68, 68, 0.12);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; padding-top: 48px; color: var(--ink); background: var(--soft); }
button, input, textarea, select { font: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--soft); }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }
.app-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding: 26px 32px; background: linear-gradient(135deg, #0d1926 0%, #1a2432 100%); color: #f3f4f6; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: #fdba74; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.subtitle { margin: 8px 0 0; max-width: 820px; color: #94a3b8; }
.header-actions, .upload-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 700; text-align: center; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #0a1520; background: var(--orange); }
.button.primary:hover:not(:disabled) { background: #fbbf24; }
.button.secondary { color: var(--ink); background: rgba(255, 255, 255, 0.04); border-color: rgba(245, 158, 11, 0.25); }
.button.secondary:hover:not(:disabled) { background: rgba(245, 158, 11, 0.12); border-color: var(--orange); }
.button.small { padding: 7px 10px; font-size: 12px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; }
.notice { padding: 12px 32px; background: var(--amber-bg); border-bottom: 1px solid rgba(245, 158, 11, 0.25); color: #fbbf24; }
.page-shell { width: min(1500px, calc(100% - 32px)); margin: 20px auto 50px; display: grid; gap: 18px; }
.upload-card, .result-card, .setting-card, .summary-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.upload-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px; }
.upload-card h2, .result-card h2 { margin: 0; }
.upload-card p, .card-heading p { margin: 5px 0 0; color: var(--muted); }
.status { padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--input-bg); }
.status.ok { color: var(--green); background: var(--green-bg); border-color: rgba(16, 185, 129, .35); }
.status.warning { color: var(--amber); background: var(--amber-bg); border-color: rgba(245, 158, 11, .35); }
.status.error { color: var(--red); background: var(--red-bg); border-color: rgba(239, 68, 68, .4); }
.status.working { color: #93c5fd; background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.setting-card { padding: 15px; display: grid; gap: 9px; }
.setting-card label { display: grid; gap: 6px; }
.setting-card input, .setting-card textarea, .setting-card select { width: 100%; border: 1px solid #2a3a5c; border-radius: 10px; padding: 9px 10px; background: var(--input-bg); color: var(--ink); }
.setting-card input:focus, .setting-card textarea:focus, .setting-card select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12); }
.setting-card select option { background: var(--input-bg); color: var(--ink); }
.setting-card textarea { resize: vertical; min-height: 112px; }
.setting-card small { color: var(--muted); line-height: 1.35; }
.selection-card { grid-row: span 2; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; }
.summary-card { padding: 16px; display: grid; gap: 5px; }
.summary-card span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .035em; }
.summary-card strong { font-size: 24px; color: var(--orange); }
.result-card { overflow: hidden; }
.card-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 1050px; border-collapse: collapse; table-layout: fixed; }
.data-table th, .data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; text-align: left; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #0d1926; color: #f3f4f6; font-size: 12px; }
.data-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:hover { background: rgba(245, 158, 11, 0.08); }
.data-table td { overflow-wrap: break-word; word-break: normal; }
.layer-table th:nth-child(1) { width: 90px; }
.layer-table th:nth-child(2) { width: 26%; }
.layer-table th:nth-child(3) { width: 120px; }
.layer-table th:nth-child(4) { width: 190px; }
.layer-table th:nth-child(5), .layer-table th:nth-child(6) { width: 130px; }
.block-table .col-action { width: 96px; }
.block-table .col-select { width: 105px; }
.block-table .col-name { width: 42%; }
.block-table .col-qty { width: 110px; }
.block-table .col-layer { width: 22%; }
.block-table .col-info { width: auto; }
.block-name { white-space: normal; line-height: 1.4; }
.check-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.chip { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: #cbd5e1; font-size: 11px; }
.chip.primary { background: rgba(245, 158, 11, 0.16); color: #fbbf24; font-weight: 800; }
.footer { padding: 24px 32px; text-align: center; color: var(--muted); }
@media (max-width: 1000px) {
  .app-header, .upload-card { flex-direction: column; }
  .settings-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
  .app-header { padding: 22px 18px; }
  .notice { padding: 12px 18px; }
  .page-shell { width: min(100% - 18px, 1500px); }
  .settings-grid, .summary-grid { grid-template-columns: 1fr; }
}
