:root {
  --concord: #e07b1a;
  --concord-dark: #b8630f;
  --applied: #c0392b;
  --applied-dark: #9c2e21;

  --bg: #f2f3f5;
  --surface: #ffffff;
  --border: #e4e6ea;
  --text: #1f2328;
  --text-muted: #6b7280;

  --header-bg: #2b3440;
  --header-fg: #f2f2f2;
  --header-fg-muted: #9aa3ae;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 1px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 10px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.4rem; font-weight: 650; margin: 0 0 var(--space-2); letter-spacing: -0.01em; }
p { color: var(--text-muted); margin: 0 0 var(--space-4); }

/* ---------- header ---------- */

header {
  background: var(--header-bg);
  color: var(--header-fg);
  position: sticky;
  top: 0;
  z-index: 10;
  /* round 46: links left, logo dead centre, account right -- left/right
     edges line up with the full-width Timecards board below */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-4);
  font-size: 0.83rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.25);
}
/* round 46b: on desktop, first menu link and Log out line up with the
   edges of the Timecards white table (board 16px + table inset 23px). */
@media (min-width: 700px) {
  header { padding-left: 39px; padding-right: 39px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-right: var(--space-2);
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.brand:hover { opacity: 0.85; }
.brand .dots { display: inline-flex; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--header-bg); }
.brand .dot.c { background: var(--concord); }
.brand .dot.a { background: var(--applied); margin-left: -3px; }

nav.sections { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-self: start; }
nav.sections a {
  color: var(--header-fg-muted);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-2) 0;
  white-space: nowrap;
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
nav.sections a:hover:not(.locked):not(.active) { color: var(--header-fg); border-bottom-color: rgba(255, 255, 255, 0.35); }
nav.sections a.active { color: var(--header-fg); font-weight: 700; border-bottom-color: var(--concord); }
nav.sections a.locked { opacity: 0.35; pointer-events: none; }
nav.sections a:focus-visible { outline: 2px solid var(--header-fg); outline-offset: 2px; }


.account { justify-self: end; display: flex; align-items: center; gap: var(--space-3); white-space: nowrap; color: var(--header-fg-muted); }
.account a { color: var(--header-fg-muted); text-decoration: none; font-weight: 500; }
.account a:hover { color: var(--header-fg); text-decoration: underline; }

/* ---------- layout ---------- */

main { padding: var(--space-6) var(--space-4) var(--space-8); max-width: 900px; margin: 0 auto; }
main.full-bleed { max-width: none; margin: 0; padding: 0; }

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ---------- tiles ---------- */

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin: var(--space-6) 0; }
.tile-stack { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-6) 0; }
.tile-stack .tile { padding: var(--space-4) var(--space-6); }
.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--space-4);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tile:not(.locked):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile.locked { opacity: 0.45; pointer-events: none; }
.tile { position: relative; }
.tile strong { display: block; font-size: 0.98rem; }
.tile .status { color: var(--text-muted); font-size: 0.82rem; margin-top: var(--space-1); }
.tile .badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--header-bg);
  color: white;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}
.tile .badge.phase-marker {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong, #b9bec5);
}

/* ---------- tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  color: white;
}
.tag.concord { background: var(--concord); }
.tag.applied { background: var(--applied); }

/* ---------- lists ---------- */

.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.item-list li:last-child { border-bottom: none; }

/* ---------- login ---------- */

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--space-4); }
.login-card { width: 100%; max-width: 340px; padding: var(--space-8) var(--space-6); }
.login-card .brand-mark { display: flex; align-items: center; gap: var(--space-2); justify-content: center; margin-bottom: var(--space-6); font-weight: 650; font-size: 1.05rem; }
.login-card .brand-mark .dot { width: 10px; height: 10px; border-radius: 50%; }
.login-card .brand-mark .dot.c { background: var(--concord); }
.login-card .brand-mark .dot.a { background: var(--applied); margin-left: -4px; }

label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: var(--space-1); }
input[type="email"], input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
}
input[type="email"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--concord);
  box-shadow: 0 0 0 3px rgba(224, 123, 26, 0.15);
}

.btn {
  width: 100%;
  padding: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: var(--header-bg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: #26292f; }

.error { color: var(--applied); font-size: 0.85rem; margin-bottom: var(--space-4); }

/* ---------- Timecards: forms, tables, small buttons ---------- */

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin-bottom: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--concord);
  box-shadow: 0 0 0 3px rgba(224, 123, 26, 0.15);
}
.form-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }
.checkbox-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: 0.9rem; }
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }
.checkbox-list { max-height: 260px; overflow-y: auto; padding: var(--space-3); background: var(--bg); border-radius: var(--radius-sm); margin-bottom: var(--space-3); }

.btn-sm {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: var(--header-bg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}
.btn-sm:hover { background: #26292f; }
.btn-sm.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-sm.danger { background: var(--applied); }
.btn-sm.ok { background: var(--ok, #2e7d5b); }

.section { margin: var(--space-6) 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-head h2 { font-size: 1.05rem; margin: 0; font-weight: 650; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data-table th, table.data-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table .actions { white-space: nowrap; text-align: right; }
table.data-table .actions form { display: inline; }

.pill-inactive { opacity: 0.5; }
.flag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--wait, #d6540f);
  color: white;
}
.hint { color: var(--text-muted); font-size: 0.8rem; margin: 0 0 var(--space-3); }
.callout {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.88rem;
}
.crumb { font-size: 0.82rem; margin-bottom: var(--space-2); }
.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.entry-card { padding: var(--space-4); margin-bottom: var(--space-3); }
.entry-card h3 { margin: 0 0 var(--space-3); font-size: 0.95rem; }
