:root {
  --navy: #1c2548;
  --navy-2: #283566;
  --fog: #eef1f7;
  --line: #e2e7f0;
  --ink: #1a1f36;
  --muted: #5a6278;
  --red: #e63946;
  --white: #fff;
  --sidebar: 240px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Syne", sans-serif;
  --shadow: 0 12px 32px rgba(28, 37, 72, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--fog); }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--display); margin: 0; }
h2 { font-size: 1.05rem; }

.dash-body {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 40% at 90% 0%, rgba(230, 57, 70, 0.07), transparent 50%),
    var(--fog);
}

.dash-sidebar {
  background: linear-gradient(180deg, #151c38, var(--navy));
  color: rgba(255,255,255,.86);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  min-height: 100vh;
}
.brand {
  display: flex;
  gap: .75rem;
  align-items: center;
  color: #fff;
  text-decoration: none;
}
.brand strong { display: block; font-family: var(--display); }
.brand small { opacity: .65; font-size: .75rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800;
}
.brand-mark.solo { margin: 0 auto 1rem; }

.side-nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.side-heading {
  margin: .45rem .4rem .2rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
}
.side-empty { padding: .25rem .75rem; font-size: .8rem; }
.side-nav a {
  color: inherit; text-decoration: none;
  padding: .65rem .75rem; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.side-nav a:hover, .side-nav a.is-on { background: rgba(255,255,255,.08); }
.side-nav em {
  font-style: normal; background: var(--red); color: #fff;
  font-size: .7rem; padding: .1rem .4rem; border-radius: 999px;
}
.side-foot { font-size: .85rem; opacity: .8; display: flex; justify-content: space-between; }
.linkish {
  background: none; border: 0; color: inherit; cursor: pointer;
  font: inherit; text-decoration: underline;
}

.dash-main { padding: 1.4rem 1.6rem 2.4rem; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1.2rem; }
.eyebrow { margin: 0 0 .2rem; color: var(--muted); font-size: .85rem; }
.top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn {
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: .55rem .95rem; font: inherit; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  margin-bottom: 1.3rem;
}
.stat-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: #fff; border-radius: 16px; padding: 1rem 1.1rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat span, .stat small { color: var(--muted); font-size: .8rem; }
.stat strong { display: block; font-size: 1.8rem; font-family: var(--display); margin: .2rem 0; }

.split { display: grid; grid-template-columns: 1.6fr .9fr; gap: 1rem; align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .7rem; }
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .8rem;
}
.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: .95rem; color: inherit; text-decoration: none;
  box-shadow: var(--shadow);
}
.p-card:hover { text-decoration: none; transform: translateY(-2px); }
.p-card header { display: flex; gap: .5rem; align-items: center; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--navy));
  display: inline-block;
}
.dot.sm { width: 8px; height: 8px; margin-right: .4rem; vertical-align: middle; }
.p-card dl {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .8rem 0 0;
}
.p-card dt { color: var(--muted); font-size: .72rem; }
.p-card dd { margin: 0; font-weight: 650; }

.rail { display: flex; flex-direction: column; gap: .8rem; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 1rem; box-shadow: var(--shadow);
}
.panel.inner { margin: 0 0 1rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.plain li:last-child { border: 0; }
.muted { color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); }
.flash-wrap { margin-bottom: .8rem; }
.flash { background: #e8f7ee; border: 1px solid #b7e4c7; padding: .6rem .8rem; border-radius: 10px; }
.flash.bad { background: #fde8ea; border-color: #f5b5bb; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
.table th { background: #f7f8fc; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.table.tight td, .table.tight th { padding: .5rem .65rem; }

.pill { font-size: .72rem; padding: .15rem .45rem; border-radius: 999px; background: #eef1f7; }
.pill.new { background: #ffe8ea; color: #9f1239; }
.pill.in_progress { background: #fff4d6; color: #854d0e; }
.pill.resolved, .pill.closed { background: #e8f7ee; color: #166534; }

.form-card, .filters {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.form-card label, .login-card label { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; font-size: .9rem; }
.input, select.input, textarea.input {
  font: inherit; padding: .55rem .7rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfcfe; width: 100%;
}
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 160px; flex: 1; }
.row-end { display: flex; justify-content: flex-end; gap: .5rem; }
.err { color: var(--red); font-size: .8rem; }
.tabs { display: flex; gap: .6rem; }
.tabs a { padding: .3rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.tabs a.is-on { background: var(--navy); color: #fff; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.meta dt { color: var(--muted); font-size: .75rem; }
.meta dd { margin: 0; }
.body-copy { line-height: 1.5; }
.key { display: block; word-break: break-all; background: #f7f8fc; padding: .6rem; border-radius: 8px; margin: .6rem 0; font-size: .78rem; }
.timeline { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: .8rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font-size: .85rem; }

.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #151c38, #283566);
}
.login-card {
  width: min(400px, 92vw); background: #fff; border-radius: 20px;
  padding: 1.6rem; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.login-card h1 { font-family: var(--display); margin: 0 0 .3rem; text-align: center; }
.login-card .muted { text-align: center; margin-bottom: 1.1rem; }
.login-card .btn { width: 100%; justify-content: center; }

@media (max-width: 960px) {
  .dash-body { grid-template-columns: 1fr; }
  .dash-sidebar { min-height: auto; }
  .stat-grid, .split { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; }
}
