* ,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050714;
  --bg-elevated: #0b0f23;
  --bg-soft: #12172f;
  --border-subtle: #262b47;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --accent-strong: #6366f1;
  --text: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #eab308;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #030712 100%);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, #020617, #040719 45%, #020617 100%);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 600;
  font-size: 14px;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.nav-item {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.nav-item:hover {
  background: #0b1120;
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--border-subtle);
}

.nav-item.active .nav-dot {
  background: var(--accent-strong);
}

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main */

.main {
  padding: 18px 24px 24px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.main-header h1 {
  margin: 0;
  font-size: 22px;
}

.view-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Buttons */

.btn {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  color: #f9fafb;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: #020617;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: #020617;
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Cards, grids */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 14px 16px 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.65);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
}

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

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

.mt-lg {
  margin-top: 14px;
}

/* Metrics */

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 600;
}

.metric-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Lists, tags */

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 4px;
}

.tag-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.tag-green {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.tag-purple {
  background: rgba(168, 85, 247, 0.17);
  color: #a855f7;
}

.tag-yellow {
  background: rgba(234, 179, 8, 0.17);
  color: #facc15;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Table */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 6px;
  text-align: left;
}

.table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.5);
}

/* Kanban */

.kanban {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kanban > li > h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.kanban-card {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 8px 9px;
  font-size: 13px;
  margin-bottom: 6px;
}

.kanban-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Settings */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  font-size: 13px;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* Views */

.view {
  display: none;
}

.view.view-active {
  display: block;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  background: #020617;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 16px 16px 14px;
  width: min(440px, 100% - 40px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.modal textarea {
  width: 100%;
  min-height: 110px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #020617;
  color: var(--text);
  padding: 8px;
  font-size: 13px;
  resize: vertical;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* Responsive */

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar-header .logo-text,
  .nav-item span:nth-child(2),
  .sidebar-footer .user-meta {
    display: none;
  }

  .sidebar {
    padding-inline: 10px;
  }
}

@media (max-width: 720px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .kanban,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
