:root {
  --bg: #0b1020;
  --bg-soft: #141a2d;
  --panel: rgba(20, 26, 45, 0.9);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --muted: #a6b0cf;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --danger: #fb7185;
  --warn: #fbbf24;
  --success: #4ade80;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.25), transparent 25%),
    radial-gradient(circle at bottom right, rgba(94,234,212,0.18), transparent 20%),
    var(--bg);
  color: var(--text);
}

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

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(6, 10, 22, 0.86);
  border-right: 1px solid var(--panel-border);
  padding: 24px 18px;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03111d;
}

.brand-wrap h1, .brand-wrap p { margin: 0; }
.brand-wrap p { color: var(--muted); font-size: 0.9rem; }

.nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.main-content {
  padding: 28px;
}

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

.topbar h2, .topbar p { margin: 0; }
.topbar p { color: var(--muted); margin-top: 6px; }
.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03111d;
}

.secondary-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--panel-border);
}

.content-section { display: none; }
.content-section.active { display: block; }

.stats-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card, .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 2rem;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-head h3 { margin: 0; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
}

textarea { resize: vertical; }
.full-span { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 10px;
}

.card-list, .list-stack {
  display: grid;
  gap: 12px;
}

.item-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.035);
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255,255,255,0.08);
}

.priority-High, .priority-Emergency { background: rgba(251, 113, 133, 0.18); color: #fecdd3; }
.priority-Medium { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.priority-Low { background: rgba(74, 222, 128, 0.16); color: #bbf7d0; }
.status-Open { background: rgba(96, 165, 250, 0.16); color: #bfdbfe; }
.status-In\ Progress { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.status-Completed { background: rgba(74, 222, 128, 0.16); color: #bbf7d0; }

.small-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.small-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.notes-block, .code-preview {
  color: var(--muted);
  line-height: 1.7;
}

.code-preview {
  background: rgba(0,0,0,0.28);
  border-radius: 18px;
  padding: 16px;
  min-height: 320px;
  overflow: auto;
}

.empty-state {
  color: var(--muted);
  padding: 14px 2px;
}

.toggle-done {
  background: rgba(74, 222, 128, 0.18);
  color: #bbf7d0;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--panel-border); }
  .stats-grid, .two-up, .form-grid { grid-template-columns: 1fr; }
}
