:root {
  color-scheme: dark;
  --bg: #05080f;
  --panel: #0a0f1a;
  --panel-soft: #111827;
  --ink: #e2e8f0;
  --muted: #64748b;
  --line: #1e293b;
  --line-soft: #0f172a;
  
  /* Neon Blue Theme */
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-glow: 0 0 15px rgba(56, 189, 248, 0.4);
  
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.1);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.1);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.1);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.1);
  
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --font-main: 'Inter', system-ui, sans-serif;
}

/* Add neon glow to accents */
button, .primary-button, .summary-card {
  box-shadow: var(--shadow);
}

.primary-button {
  box-shadow: var(--accent-glow);
}

.brand-mark {
  box-shadow: var(--accent-glow);
}
/* (rest of the file remains largely the same, but the variables now drive the neon blue look) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
}

button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex-shrink: 0;
}

.app-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

/* Header & Brand */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

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

.brand-mark {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--accent);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 2px;
}

h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 16px;
  font-weight: 700;
}

/* Actions */
.topbar-actions {
  display: flex;
  gap: 12px;
}

.toolbar-button {
  background: var(--panel-soft);
  font-weight: 600;
  padding: 10px 16px;
}

.toolbar-button.primary-import {
  background: var(--accent);
  color: var(--bg);
  border: none;
}

.toolbar-button.primary-import:hover {
  filter: brightness(1.1);
  background: var(--accent);
}

.file-trigger input {
  display: none;
}

/* Summary KPI Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--panel);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.summary-card strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.summary-card span {
  color: var(--muted);
  font-weight: 600;
}

.summary-card small {
  font-size: 11px;
  color: var(--muted);
}

.summary-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.summary-card.neutral::after { background: var(--muted); }
.summary-card.warning::after { background: var(--warning); }
.summary-card.info::after { background: var(--info); }
.summary-card.success::after { background: var(--success); }

/* Layout Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

/* Panels */
.form-panel, .operation-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.field input, .field select, .field textarea {
  background: var(--panel-soft);
  padding: 10px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row > .field {
  flex: 1;
}

.field.compact {
  flex: 0 0 100px;
}

.quantity-control {
  display: flex;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.quantity-control button {
  border: none;
  background: transparent;
  width: 36px;
  font-size: 18px;
  padding: 0;
}

.quantity-control input {
  border: none;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  background: transparent;
}

/* Status & OS Selectors */
.status-selector, .os-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.choice-button {
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  border-color: var(--line);
}

.choice-button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Collapsible Section */
.optional-fields {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.optional-fields summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.optional-fields summary::before {
  content: '→';
  transition: transform 0.2s;
}

.optional-fields[open] summary::before {
  transform: rotate(90deg);
}

/* Primary Button */
.primary-button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.primary-button:hover {
  background: var(--accent);
  filter: brightness(1.1);
}

/* Operation Panel - Coverage */
.coverage-row {
  background: var(--panel-soft);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coverage-row div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.coverage-row strong {
  font-size: 18px;
  color: var(--accent);
}

.coverage-track {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.coverage-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Client List Cards */
.client-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.client-item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-meta {
  font-size: 11px;
  color: var(--muted);
}

.client-bar {
  height: 4px;
  background: var(--line);
  margin-top: 4px;
  border-radius: 2px;
}

.client-bar-fill {
  height: 100%;
  background: var(--info);
}

/* Filters */
.filters-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding-left: 36px;
  background: var(--panel-soft);
}

.filters-row select {
  background: var(--panel-soft);
  padding: 8px 32px 8px 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%238b96a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.neutral-button {
  background: var(--panel-soft);
  color: var(--muted);
}

.danger-button {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}

/* Table Styles */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

th {
  background: var(--panel-soft);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

tr:last-child td {
  border-bottom: none;
}

code {
  background: var(--panel-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--accent);
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  text-transform: capitalize;
}

.status-pausado { background: var(--warning-soft); color: var(--warning); }
.status-em-implantacao { background: var(--info-soft); color: var(--info); }
.status-implantado { background: var(--success-soft); color: var(--success); }
.status-cancelado { background: var(--danger-soft); color: var(--danger); }

.actions-column {
  width: 80px;
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.icon-button {
  padding: 6px;
  border: none;
  color: var(--muted);
}

.icon-button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.delete-action:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 600;
  animation: slideIn 0.3s ease-out;
}

.toast-success { border-color: var(--success); color: var(--success); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-warning { border-color: var(--warning); color: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tooltip & Empty States */
.help-tooltip {
  display: inline-flex;
  width: 16px;
  height: 16px;
  background: var(--line);
  border-radius: 50%;
  font-size: 10px;
  align-items: center;
  justify-content: center;
  cursor: help;
  color: var(--muted);
}

.empty-state, .inline-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .table-wrap {
    border: none;
  }

  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }

  thead tr {
    display: none;
  }

  tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 12px;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  td:last-child {
    border-bottom: none;
    justify-content: center;
    margin-top: 8px;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
  }
}
