:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #f8f9fb;
  --border: #e2e8f0;
  --text: #1a202c;
  --muted: #718096;
  --blue: #1F5F8E;
  --blue-light: #2b7fc2;
  --green: #276749;
  --green-bg: #e6f4ec;
  --amber: #92600a;
  --amber-bg: #fef3cd;
  --red: #c0392b;
  --red-bg: #fde8e8;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  font-size: 14px;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 230px;
  height: 100vh;
  background: var(--blue);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0,0,0,.1);
}

.main { margin-left: 230px; padding: 2rem; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.logo img {
  max-width: 160px;
  filter: brightness(0) invert(1);
  opacity: .95;
}

/* Nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  border-radius: 7px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .88rem;
  margin-bottom: .2rem;
  transition: all .15s;
  font-weight: 500;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 600;
}

.nav-item.danger { color: rgba(255,120,120,.85); }
.nav-item.danger:hover { background: rgba(255,80,80,.15); color: #ff8080; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1rem;
}

.user-info {
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  padding: .4rem .75rem .75rem;
}

.user-info strong { color: #fff; display: block; margin-bottom: .2rem; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.stat-card { text-align: center; padding: 1.5rem 1rem; }
.stat-num { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.num-green { color: var(--green); }
.num-amber { color: var(--amber); }
.num-red   { color: var(--red); }
.num-blue  { color: var(--blue); }

/* ── Section title ── */
h5.section-title, h5.st {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

/* ── RAG ── */
.rag { font-size: .82rem; font-weight: 600; }
.rag.green { color: var(--green); }
.rag.amber { color: var(--amber); }
.rag.red   { color: var(--red); }

/* ── Tables ── */
.table { color: var(--text); }
.table th {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  border-color: var(--border);
  background: var(--surface2);
}
.table td { border-color: var(--border); vertical-align: middle; font-size: .88rem; }
.table tbody tr:hover { background: var(--surface2); cursor: pointer; }

/* ── Budget bar ── */
.budget-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 3px; }

/* ── Days pills ── */
.days-pill { font-size: .72rem; padding: .2rem .5rem; border-radius: 4px; font-weight: 600; }
.days-urgent { background: var(--red-bg); color: var(--red); }
.days-soon   { background: var(--amber-bg); color: var(--amber); }
.days-ok     { background: var(--green-bg); color: var(--green); }

/* ── Avatar ── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ── Person row ── */
.person-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.person-row:last-child { border-bottom: none; }
.project-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.project-pill {
  font-size: .72rem; padding: .15rem .4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}
.project-pill:hover { background: var(--surface2); }

/* ── Forms ── */
.form-control, .form-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .2rem rgba(31,95,142,.12);
  color: var(--text);
  background: var(--surface);
}
.form-label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }

/* ── Buttons ── */
.btn-primary { background: var(--blue); border: none; font-weight: 600; border-radius: 7px; }
.btn-primary:hover { background: var(--blue-light); }

/* ── Badges ── */
.badge { font-size: .72rem; font-weight: 600; }

/* ── Page header ── */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--text); }
.page-header p { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }

/* ── Comment ── */
.comment-item { display: flex; gap: .75rem; margin-bottom: 1.25rem; }
.comment-body {
  background: #f0f7ff;
  border: 1px solid #cce0f5;
  border-radius: 8px;
  padding: .75rem 1rem;
  flex: 1;
}
.comment-body .meta { font-size: .75rem; color: var(--muted); margin-bottom: .25rem; }

/* ── Milestone ── */
.milestone-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.milestone-row:last-child { border-bottom: none; }
.milestone-row.done .ms-name { text-decoration: line-through; color: var(--muted); }
.ms-date { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ms-check { cursor: pointer; font-size: 1.1rem; }

/* ── Info grid ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.info-item label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: .2rem; font-weight: 600; }
.info-item span { font-size: .95rem; font-weight: 500; }

/* ── RAG options ── */
.rag-option {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  margin-bottom: .4rem;
  background: var(--surface);
}
.rag-option.sel-green { border-color: #27ae60; background: var(--green-bg); }
.rag-option.sel-amber { border-color: #e67e22; background: var(--amber-bg); }
.rag-option.sel-red   { border-color: #e74c3c; background: var(--red-bg); }

/* ── Filter buttons ── */
.filter-btn {
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}
.filter-btn.active, .filter-btn:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ── Info row (profile) ── */
.info-row {
  display: flex; justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row label { color: var(--muted); }

/* ── Login card ── */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.login-card h1 { font-size: 1.4rem; font-weight: 700; color: var(--blue); margin-bottom: .25rem; }
.login-card p.sub { font-size: .85rem; color: var(--muted); margin-bottom: 1.8rem; }
