/* Lookopen Projects — sibling of the Network Status theme.
   Same family (dark, gold, Ubuntu) with a cooler background and blue links
   to tell the two apps apart at a glance.

   Text is neutral off-white for long-session readability; gold is reserved
   for brand, primary actions and in-progress state. Status colours are the
   shared vocabulary: they appear consistently in badges, card edges, the
   stat strip and the status select. */

:root {
  --bg: #26282b;
  --surface: #303236;
  --surface2: #383b40;
  --surface3: #414549;
  --border: #46484c;
  --border-light: #55585c;
  --text: #e9e6df;
  --text-secondary: #b8b4aa;
  --text-muted: #8b8779;
  --gold: #f5be00;
  --gold-light: #FFD153;
  --gold-dark: #d19e00;
  --gold-bg: rgba(245, 190, 0, 0.08);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --blue: #649CC8;
  --blue-light: #85b4d9;
  --blue-bg: rgba(100, 156, 200, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--blue-light); text-decoration: none; }
a:hover { color: var(--gold-light); }
:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.45rem; margin: 0 0 0.25rem; font-weight: 500; letter-spacing: -0.01em; }
h3 {
  margin: 0 0 0.85rem; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-secondary);
}
h3 .muted { text-transform: none; letter-spacing: 0; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.accent { color: var(--gold); }
.overdue { color: var(--red); font-weight: 700; }

/* ---------- Navigation ---------- */

.topnav {
  display: flex; align-items: center; gap: 1.25rem;
  height: 56px; padding: 0 28px;
  background: linear-gradient(180deg, #313335, #2a2c2e);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text-secondary); font-size: 13px; letter-spacing: 0.3px; }
.brand:hover { color: var(--text-secondary); }
.brand img { height: 26px; }
.brand span { color: var(--gold); font-weight: 700; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  padding: 5px 14px; border-radius: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-muted);
  border: 1px solid transparent; transition: all 0.15s;
}
.nav-links a:hover { color: var(--text-secondary); border-color: var(--border); }
.nav-links a.active { color: var(--gold); background: var(--gold-bg); border-color: rgba(245, 190, 0, 0.25); }
.nav-links a.btn-primary { color: #26282b; }
.nav-user { margin-left: auto; display: flex; gap: 0.9rem; align-items: center; font-size: 12px; }
.nav-user a { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.nav-user a:hover { color: var(--gold); }
.linklike { background: none; border: none; color: var(--blue-light); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--gold-light); }
.linklike.danger { color: var(--text-muted); font-size: 1.05rem; line-height: 1; }
.linklike.danger:hover { color: var(--red); }
.nav-user .linklike { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
.nav-user .linklike:hover { color: var(--gold); }

/* ---------- Layout ---------- */

.container { max-width: 1240px; margin: 1.75rem auto; padding: 0 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filters input[type="search"] { min-width: 180px; }
.layout-2col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}
.layout-2col .card { margin-bottom: 1.25rem; }
.layout-2col > div > .card:last-child { margin-bottom: 0; }

/* ---------- Stat strip (dashboard triage) ---------- */

.stat-strip { display: flex; gap: 0.6rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.stat {
  flex: 1 1 0; min-width: 108px;
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  border-left-width: 3px;
  color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.stat:hover { background: var(--surface2); color: var(--text); border-color: var(--border-light); }
.stat.active { background: var(--surface2); border-color: var(--gold-dark); }
.stat-count { font-size: 1.35rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.stat.st-blocked .stat-count { color: var(--red); }
.stat.st-in_progress .stat-count { color: var(--gold); }
.stat.st-scheduled .stat-count { color: var(--blue-light); }
.stat.st-awaiting_requirements .stat-count { color: var(--yellow); }
.stat.st-planning .stat-count { color: var(--text-secondary); }
.stat.st-blocked { border-left-color: var(--red); }
.stat.st-in_progress { border-left-color: var(--gold); }
.stat.st-scheduled { border-left-color: var(--blue); }
.stat.st-awaiting_requirements { border-left-color: var(--yellow); }
.stat.st-planning { border-left-color: var(--border-light); }

/* ---------- Project cards ---------- */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; align-content: start; }
.project-card {
  display: block; color: var(--text); margin-bottom: 0;
  border-left-width: 3px; border-left-color: var(--border-light);
  transition: border-color 0.15s, background 0.15s;
}
.project-card:hover { color: var(--text); border-color: var(--gold-dark); background: var(--surface2); }
.project-card h3 { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); margin: 0.2rem 0; }
.project-card.st-blocked { border-left-color: var(--red); }
.project-card.st-in_progress { border-left-color: var(--gold); }
.project-card.st-scheduled { border-left-color: var(--blue); }
.project-card.st-awaiting_requirements { border-left-color: var(--yellow); }
.project-card.st-completed { border-left-color: var(--green); }
.project-card.st-planning, .project-card.st-cancelled { border-left-color: var(--border-light); }
.card-top { display: flex; justify-content: space-between; margin-bottom: 0.5rem; gap: 0.5rem; }
.card-top .muted { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; }
.card-sub { color: var(--text-secondary); font-size: 0.85rem; }
.card-meta { display: flex; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; align-items: center; }

.progress { height: 4px; margin-top: 0.7rem; border-radius: 999px; background: var(--surface3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--gold); transition: width 0.3s ease; }
.progress-fill.complete { background: var(--green); }

/* ---------- Badges ---------- */

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.badge-planning { background: var(--surface2); color: var(--text-secondary); }
.badge-awaiting_requirements, .badge-planned, .badge-prospect { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(245, 158, 11, 0.25); }
.badge-scheduled { background: var(--blue-bg); color: var(--blue-light); border-color: rgba(100, 156, 200, 0.3); }
.badge-in_progress, .badge-on_site, .badge-confirmed { background: var(--gold-bg); color: var(--gold); border-color: rgba(245, 190, 0, 0.3); }
.badge-blocked { background: var(--red-bg); color: var(--red); border-color: rgba(239, 68, 68, 0.25); }
.badge-completed, .badge-done { background: var(--green-bg); color: var(--green); border-color: rgba(16, 185, 129, 0.25); }
.badge-cancelled { background: var(--surface2); color: var(--text-muted); text-decoration: line-through; }
.badge-drive, .badge-area { background: var(--blue-bg); color: var(--blue-light); border-color: rgba(100, 156, 200, 0.3); }

/* ---------- Status select (project header) ---------- */

.status-select { font-weight: 700; }
.status-select.st-blocked { color: var(--red); border-color: rgba(239, 68, 68, 0.45); background: var(--red-bg); }
.status-select.st-in_progress { color: var(--gold); border-color: rgba(245, 190, 0, 0.45); background: var(--gold-bg); }
.status-select.st-scheduled { color: var(--blue-light); border-color: rgba(100, 156, 200, 0.5); background: var(--blue-bg); }
.status-select.st-awaiting_requirements { color: var(--yellow); border-color: rgba(245, 158, 11, 0.45); background: var(--yellow-bg); }
.status-select.st-completed { color: var(--green); border-color: rgba(16, 185, 129, 0.45); background: var(--green-bg); }
.status-select.st-planning, .status-select.st-cancelled { color: var(--text-secondary); }
.status-select option { color: var(--text); background: var(--surface2); font-weight: 400; }

/* ---------- Contractors ---------- */

.contractor-name { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); margin-bottom: 0; }
.contractor-meta { font-size: 0.76rem; color: var(--text-muted); margin: 2px 0 0.6rem; text-transform: uppercase; letter-spacing: 0.4px; }
.contractor-meta .loc { color: var(--blue-light); font-weight: 700; }
.contractor-card { margin-bottom: 0; }
.contractor-card .card-top { align-items: flex-start; margin-bottom: 0.3rem; }
.action-link { font-size: 0.78rem; }
.danger-hover:hover { color: var(--red); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.edit-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.76rem; color: var(--text-secondary); }
.edit-grid .edit-wide { grid-column: 1 / -1; }
.errorlist { color: var(--red); font-size: 0.8rem; margin: 0.25rem 0; padding-left: 1rem; }

/* ---------- Collapsible cards ---------- */

details.collapse > summary {
  cursor: pointer; list-style: none;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-secondary);
  user-select: none;
}
details.collapse > summary::before { content: "▸"; display: inline-block; margin-right: 0.5rem; color: var(--text-muted); transition: transform 0.15s; }
details.collapse[open] > summary::before { transform: rotate(90deg); }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary:hover { color: var(--gold-light); }
details.collapse[open] > summary { margin-bottom: 0.85rem; }

/* ---------- Lists ---------- */

.checklist, .task-list, .file-list, .feed { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.check-row, .task-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--surface3);
}
.check-row:last-child, .task-row:last-child { border-bottom: none; }
.check-row.done .check-name { color: var(--text-muted); }
.check-status { width: 1.2rem; text-align: center; }
.check-satisfied { color: var(--green); font-weight: 700; }
.check-waived { color: var(--text-muted); }
.check-name { flex: 1; }
.row-actions { display: flex; gap: 0.3rem; }
.task-title { flex: 1; }
.task-row.status-done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-status { font-size: 0.78rem; }
.file-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--surface3); }
.file-list li:last-child { border-bottom: none; }

.feed li { padding: 0.5rem 0; border-bottom: 1px solid var(--surface3); font-size: 0.86rem; }
.feed li:last-child { border-bottom: none; }
.feed.activity { font-size: 0.78rem; color: var(--text-muted); }
.feed.activity strong { color: var(--text-secondary); font-weight: 500; }

/* ---------- Buttons & forms ---------- */

.btn {
  display: inline-block; padding: 0.42rem 0.95rem; border-radius: 7px;
  border: 1px solid var(--border-light); background: var(--surface2); color: var(--text);
  font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--gold-dark); background: var(--gold-bg); color: var(--gold-light); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #26282b; font-weight: 700; }
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: #26282b; }
.btn-sm { padding: 0.2rem 0.65rem; font-size: 0.76rem; }
.btn-block { width: 100%; }
@media (pointer: coarse) {
  .btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
  .linklike.danger { padding: 0.4rem; }
}

.inline-form { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 1; min-width: 140px; }
input, select, textarea {
  font: inherit; font-size: 0.85rem; padding: 0.38rem 0.55rem;
  border: 1px solid var(--border-light); border-radius: 6px;
  background: var(--surface2); color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 2px var(--gold-bg); }
input[type="date"] { color-scheme: dark; }
input[type="file"] { border: none; background: none; padding-left: 0; }
.checkbox-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.form-card { max-width: 620px; }
.form-card > div { margin-bottom: 0.85rem; display: flex; flex-direction: column; gap: 0.25rem; }
.form-card label { font-weight: 500; font-size: 0.82rem; color: var(--text-secondary); }
.form-card .helptext { font-size: 0.75rem; color: var(--text-muted); }
.form-actions { display: flex; gap: 0.5rem; }

.status-control { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-end; }
.link-row { display: flex; gap: 1rem; margin-top: 0.35rem; font-size: 0.85rem; align-items: center; }
.link-row .linklike { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Login ---------- */

/* Centred against the viewport, not the layout container, so it can never drift. */
.login-box {
  position: fixed; inset: 0; margin: auto;
  width: min(380px, calc(100vw - 2rem)); height: fit-content;
  text-align: center; padding: 2rem;
}
.login-box h1 { font-size: 1.2rem; color: var(--text-secondary); }
.login-logo { display: block; width: min(100%, 260px); height: auto; margin: 0 auto 1.25rem; }
.login-box form { text-align: left; margin-top: 1.25rem; }
.login-box .divider {
  margin: 1.1rem 0; color: var(--text-muted); font-size: 0.75rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.login-box .divider::before, .login-box .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-box form > div { margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.login-box label { font-size: 0.8rem; color: var(--text-secondary); }
.login-box input { width: 100%; }
.remember-row label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.remember-row input { width: auto; }
img { max-width: 100%; }

/* ---------- Feedback ---------- */

.notice {
  background: var(--yellow-bg); color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.25); border-radius: 7px;
  padding: 0.5rem 0.8rem; font-size: 0.8rem; margin-bottom: 0.6rem;
}
.messages { max-width: 1240px; margin: 0.75rem auto 0; padding: 0 28px; }
.message {
  padding: 0.5rem 0.9rem; border-radius: 7px; margin-bottom: 0.4rem;
  background: var(--blue-bg); border: 1px solid rgba(100, 156, 200, 0.3); font-size: 0.85rem;
}
.message-error { background: var(--red-bg); color: var(--red); border-color: rgba(239, 68, 68, 0.25); }
.empty { color: var(--text-muted); padding: 2.5rem; text-align: center; grid-column: 1 / -1; }

.just-updated { animation: settle-glow 0.7s ease-out; }
@keyframes settle-glow {
  0% { box-shadow: 0 0 0 2px rgba(245, 190, 0, 0.35); }
  100% { box-shadow: 0 0 0 2px rgba(245, 190, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
