:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3a;
  --accent:    #4f8ef7;
  --accent-h:  #3a7ae8;
  --text:      #e2e4ed;
  --text-muted:#7c7f93;
  --danger:    #e05c5c;
  --radius:    8px;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-error { background: rgba(224,92,92,.15); border: 1px solid var(--danger); color: var(--danger); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline label { margin-bottom: 0; font-size: 14px; color: var(--text); }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-full { width: 100%; margin-top: 8px; }
.btn-link { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0; }
.btn-link:hover { color: var(--text); }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-nav { list-style: none; flex: 1; }
.nav-link {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted);
  font-size: 14px;
  border-radius: 0;
  transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.04); }

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sidebar-user { font-size: 13px; color: var(--text-muted); }

.main-content { flex: 1; padding: 32px 36px; overflow-y: auto; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 22px; font-weight: 600; }

/* ── Project grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--text); }
.project-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.project-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.project-note { font-size: 13px; color: var(--text-muted); }
.note-label { color: var(--accent); font-weight: 500; }

.empty-state { color: var(--text-muted); margin-bottom: 40px; }

/* ── Alert panel ── */
.alert-panel { margin-top: 16px; }
.alert-panel-title { font-size: 15px; font-weight: 600; color: var(--danger); margin-bottom: 12px; }

.alert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.alert-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.alert-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-family: "SF Mono", "Consolas", monospace;
}
