:root {
  color-scheme: dark;
  --bg: #030507;
  --panel: #080b10;
  --panel-soft: #0d1117;
  --ink: #f4f7fb;
  --muted: #8b96a8;
  --line: #1d2530;
  --line-soft: #141b24;
  --accent: #14b8a6;
  --accent-soft: #0d2a27;
  --warning: #f59e0b;
  --warning-soft: #2b1e08;
  --info: #60a5fa;
  --info-soft: #0c1f3d;
  --success: #22c55e;
  --success-soft: #0d2817;
  --danger: #f87171;
  --danger-soft: #2d1010;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

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

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

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  
  .form-panel {
    position: static;
  }
}

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

  .topbar-actions {
    width: 100%;
  }

  .toolbar-button, .file-trigger {
    flex: 1;
    justify-content: center;
  }

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

  /* Table to Card Refinement */
  .table-wrap {
    border: none;
    overflow: visible;
  }

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

  thead tr {
    display: none;
  }

  tr {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

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

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

  td::before {
    content: attr(data-label);
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    text-align: left;
    flex: 1;
  }

  .actions-column {
    width: 100%;
  }

  .status-pill {
    min-width: 100px;
    margin-left: 10px;
  }

  .filters-row {
    flex-direction: column;
    gap: 10px;
  }

  .search-wrap, .filters-row select, .neutral-button {
    width: 100%;
    max-width: none;
  }

  .field-row {
    flex-direction: column;
  }

  .field.compact {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .topbar-actions {
    flex-direction: column;
  }

  .brand h1 {
    font-size: 1.2rem;
  }
}

