:root {
  --ink: #111827;
  --accent: #4338CA;
  --accent-hover: #3730A3;
  --cream: #F9FAFB;
  --line: #E5E7EB;
  --red: #DC2626;
  --green: #16A34A;
  --amber: #D97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
}
a { text-decoration: none; color: inherit; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.sidebar-header .brand { font-weight: 600; }
.sidebar-header .meta { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }
.sidebar nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.1); }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer button {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 14px; cursor: pointer; padding: 0;
}

.main { flex: 1; padding: 32px; }

h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.subtitle { color: #6B7280; margin: 0 0 24px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.stat-label { font-size: 12px; color: #6B7280; }
.stat-value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.stat-value.warn { color: var(--red); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-input, select.form-input, textarea.form-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
}

.list { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list-item {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #F9FAFB; }
.text-muted { color: #6B7280; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-accent { color: var(--accent); }

.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.board-col { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.board-col-title { font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.task-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}
.task-card select { width: 100%; margin-top: 4px; font-size: 12px; padding: 2px; }
.task-actions { display: flex; gap: 8px; margin-top: 4px; }
.task-actions button, .task-actions a { font-size: 11px; background: none; border: none; cursor: pointer; padding: 0; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.login-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #EEF2FF;
  color: var(--accent);
}
.error-text { color: var(--red); font-size: 13px; }
.success-text { color: var(--green); font-size: 13px; }

.role-pill {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.role-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.bell-wrap { position: relative; }
.bell-btn { background: none; border: none; color: rgba(255,255,255,0.8); cursor: pointer; font-size: 18px; position: relative; }
.bell-badge {
  position: absolute; top: -4px; right: -6px;
  background: var(--red); color: #fff; font-size: 10px;
  border-radius: 999px; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  position: absolute; left: 0; top: 28px; width: 280px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  max-height: 360px; overflow-y: auto; z-index: 50; display: none;
}
.notif-dropdown.open { display: block; }
.notif-item { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; display: block; }
.notif-item:last-child { border-bottom: none; }

.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.avatar-placeholder {
  width: 64px; height: 64px; border-radius: 50%; background: #E5E7EB;
  display: flex; align-items: center; justify-content: center; color: #6B7280; font-size: 20px;
}
.star-rating { font-size: 28px; cursor: pointer; }
.star-rating .star { color: #D1D5DB; }
.star-rating .star.active { color: var(--amber); }
