:root {
  --bg-primary: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-alt: #16161f;
  --border: #2a2a3a;
  --text-primary: #e0e0e8;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent: #7b8cde;
  --accent-dim: #5a6abf;
  --red: #e5534b;
  --red-bg: rgba(229, 83, 75, 0.1);
  --yellow: #e5b84b;
  --yellow-bg: rgba(229, 184, 75, 0.1);
  --green: #4bc97b;
  --green-bg: rgba(75, 201, 123, 0.1);
}

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

body {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100dvh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

section { margin-bottom: 32px; }

/* Header */
header {
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.badge.accent { background: rgba(123, 140, 222, 0.15); color: var(--accent); }
.badge.muted { background: rgba(85, 85, 106, 0.2); color: var(--text-muted); }

.meta-text {
  color: var(--text-secondary);
  font-size: 11px;
}

/* Section headings */
.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 8px;
  vertical-align: top;
  border-bottom: 1px solid #1a1a25;
  white-space: nowrap;
}

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

td.wrap { white-space: normal; }

/* Status indicators */
.status-red { color: var(--red); }
.status-yellow { color: var(--yellow); }
.status-green { color: var(--green); }

.sev-badge {
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.sev-critical { background: var(--red-bg); color: var(--red); }
.sev-high { background: var(--red-bg); color: var(--red); }
.sev-medium { background: var(--yellow-bg); color: var(--yellow); }

/* Priority cards */
.priority-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.priority-row:last-child { margin-bottom: 0; }

.priority-id {
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
}

.priority-info { flex: 1; }
.priority-name { font-weight: 500; }
.priority-progress {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
  white-space: normal;
}

.priority-status {
  font-size: 11px;
  min-width: fit-content;
}

/* Metrics */
.metrics-table th,
.metrics-table td { padding: 8px 12px; }
.metrics-table td:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Parking lot */
.parking-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.parking-toggle::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.parking-toggle.open::before {
  transform: rotate(90deg);
}

.parking-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.parking-items.open {
  max-height: 2000px;
}

.parking-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.parking-item-name { font-weight: 500; width: 100%; }
.parking-item-desc {
  color: var(--text-secondary);
  font-size: 11px;
  width: 100%;
}
.parking-item-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}
.parking-item-priority {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(123, 140, 222, 0.1);
  color: var(--accent);
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

@media (max-width: 640px) {
  .container { padding: 12px; }
  
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr {
    padding: 8px 0;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
  }
  td {
    border: none;
    border-bottom: 1px solid #1a1a25;
    padding: 6px 10px;
    white-space: normal;
  }
  td:last-child { border-bottom: none; }
  td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2px;
  }

  .priority-row { flex-wrap: wrap; }
  .priority-status { margin-top: 4px; }
}

/* Refresh button */
.refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 1rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.refresh-btn:hover {
  background: var(--bg-hover);
}
.refresh-btn.spinning {
  animation: spin 0.6s ease;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
