:root {
  --bg:         #080d14;
  --surface:    #0e1620;
  --border:     #1a2535;
  --border-hi:  #243347;
  --text:       #dce6f0;
  --muted:      #4a6278;
  --label:      #2d4458;
  --green:      #1fd49a;
  --green-bg:   #0d3326;
  --red:        #f56060;
  --red-bg:     #3a1212;
  --amber:      #f0a830;
  --amber-bg:   #3a2a08;
  --accent:     #3a7bd5;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── LOGIN ── */
.login-body { display: flex; align-items: center; justify-content: center; }

.login-wrap {
  width: 100%;
  max-width: 360px;
  padding: 2.5rem 2rem;
  margin: auto;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.login-logo-mark {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.login-logo-name { font-size: 1rem; font-weight: 700; letter-spacing: .12em; color: var(--text); }
.login-logo-sub  { font-size: .75rem; color: var(--muted); letter-spacing: .06em; margin-top: 1px; }

.login-form { display: flex; flex-direction: column; gap: .75rem; }

.login-input {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: .75rem 1rem;
  outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: var(--accent); }
.login-input::placeholder { color: var(--muted); }

.login-error {
  font-size: .82rem;
  color: var(--red);
  padding: .4rem .75rem;
  background: var(--red-bg);
  border-radius: 6px;
}

.login-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  padding: .75rem 1rem;
  transition: opacity .15s;
}
.login-btn:hover { opacity: .85; }

/* ── HEADER ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 10;
}

.header-brand { display: flex; align-items: center; gap: .8rem; }

.header-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.header-name { font-size: .85rem; font-weight: 700; letter-spacing: .12em; color: var(--text); }
.header-sub  { font-size: .7rem; color: var(--muted); letter-spacing: .05em; }

.logout-link {
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color .15s, border-color .15s;
}
.logout-link:hover { color: var(--text); border-color: var(--border-hi); }

/* ── MAIN ── */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ── SECTION ── */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--label);
}

.as-of {
  font-size: .7rem;
  color: var(--muted);
  margin-left: auto;
}

/* ── STATUS TILES ── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}

.status-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.tile-name {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}

.tile-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.tile-val {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.dot-green { background: var(--green); }
.dot-red   { background: var(--red); }
.dot-amber { background: var(--amber); }
.val-green { color: var(--green); }
.val-red   { color: var(--red); }
.val-amber { color: var(--amber); }

/* ── METRIC TILES ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  max-width: 380px;
}

.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 1rem;
}

.metric-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: .35rem;
}

.metric-name {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── MILESTONES ── */
.milestone-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.milestone-item:last-child { border-bottom: none; }

.m-icon {
  font-size: .85rem;
  font-weight: 700;
  width: 1.2rem;
  flex-shrink: 0;
}

.done .m-icon   { color: var(--green); }
.pending .m-icon { color: var(--label); }

.m-name {
  font-size: .9rem;
  flex: 1;
}
.done .m-name   { color: var(--muted); }
.pending .m-name { color: var(--text); }

.m-date {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── QUICK LINKS ── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.link-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  transition: border-color .15s, background .15s;
}
.link-tile:hover {
  border-color: var(--border-hi);
  background: #131f2e;
}

.link-icon { font-size: 1.1rem; flex-shrink: 0; }
.link-name { font-size: .88rem; font-weight: 500; color: var(--text); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .status-grid  { grid-template-columns: repeat(2, 1fr); }
  .links-grid   { grid-template-columns: repeat(2, 1fr); }
  .metric-grid  { max-width: 100%; }
  .main { padding: 1.25rem 1rem 3rem; gap: 2rem; }
}

@media (max-width: 380px) {
  .links-grid { grid-template-columns: 1fr 1fr; }
}
