/* PCC theme — matches the Solar4Good "Sneat" admin look (amber on light grey). */
:root {
  --bg: #f5f5f9;
  --surface: #ffffff;
  --heading: #566a7f;
  --text: #697a8d;
  --muted: #a1acb8;
  --border: #d9dee3;
  --accent: #f9a40e;          /* Solar4Good amber */
  --accent-press: #e08900;
  --accent-soft: #fef1da;     /* light amber tint */
  --green: #71dd37; --green-soft:#e8fadf; --green-ink:#5a9e2a;
  --red: #ff3e1d; --red-soft:#ffe5e0; --red-ink:#d8341a;
  --orange: #ffab00; --orange-soft:#fff2d6; --orange-ink:#b07d00;
  --radius: 0.5rem; --radius-sm: 0.375rem;
  --shadow: 0 0.25rem 1.125rem rgba(75, 70, 92, 0.1);
  --shadow-sm: 0 0.125rem 0.5rem rgba(75, 70, 92, 0.08);
  --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; font-size: 15px; }

/* Top navbar (replaces the old bottom tab bar) */
.navbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--surface);
  box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--border);
}
.navbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--heading); font-size: 1.05rem; }
.navbar-brand img { width: 30px; height: 30px; border-radius: 7px; }
.navbar-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.navbar-links a {
  color: var(--text); font-weight: 500; font-size: 0.9rem;
  padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none;
}
.navbar-links a:hover { background: var(--accent-soft); color: var(--accent-press); }
.navbar-links a.active { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(249,164,14,.4); }
.navbar-links a.logout { color: var(--red); }
.navbar-links a.logout:hover { background: var(--red-soft); color: var(--red-ink); }

.app { max-width: 880px; margin: 0 auto; padding: 24px 16px 56px; }
.back-btn { font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.back-btn:hover { background: var(--accent-soft); color: var(--accent-press); border-color: var(--accent-soft); }
h1 { font-size: 1.5rem; font-weight: 700; color: var(--heading); letter-spacing: -.01em; margin-bottom: 16px; }
h2 { font-size: 1.05rem; font-weight: 600; color: var(--heading); margin: 24px 0 12px; }
.muted { color: var(--muted); font-size: 0.85rem; }
a { color: var(--accent-press); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Page header row (was the sticky .topbar) */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar strong { font-size: 1.25rem; font-weight: 700; color: var(--heading); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 16px; display: grid; gap: 14px; }

label { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--heading); }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 0.92rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,164,14,.15); }
textarea { resize: vertical; min-height: 84px; }

.btn { font: inherit; font-weight: 600; font-size: 0.9rem; padding: 10px 18px; border: none; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: scale(.99); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(249,164,14,.4); }
.btn-primary:hover { background: var(--accent-press); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-press); }
.btn-secondary:hover { background: #fce3b8; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; }
.alert-error { background: var(--red-soft); color: var(--red-ink); }
.alert-success { background: var(--green-soft); color: var(--green-ink); }

/* Item rows */
.item { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 12px; color: inherit; border: 1px solid transparent; }
a.item:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.item strong { color: var(--heading); }
.item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.badge { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-press); text-transform: capitalize; }
.badge.pending { background: var(--orange-soft); color: var(--orange-ink); }
.badge.complete { background: var(--green-soft); color: var(--green-ink); }
.badge.failed { background: var(--red-soft); color: var(--red-ink); }

/* Auth pages */
.auth { max-width: 400px; margin: 7vh auto 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 24px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 10px; }
.auth-brand span { font-size: 1.25rem; font-weight: 700; color: var(--heading); }

/* Project cards (Home) */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 8px; }
.project-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px; border: 1px solid transparent; color: inherit; min-height: 120px;
}
.project-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); transition: transform .12s, box-shadow .12s; }
.project-card-company { font-size: 0.68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-press); }
.project-card strong { font-size: 1.05rem; color: var(--heading); }
.project-card .muted { font-size: 0.82rem; }
.project-card-count { margin-top: auto; font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* Drawing canvas (Capture) */
.draw-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.draw-toolbar input[type=color] { width: 40px; height: 38px; padding: 2px; border-radius: var(--radius-sm); cursor: pointer; }
#drawCanvas { width: 100%; height: auto; aspect-ratio: 900 / 560; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }

.credit { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 28px 0 8px; }
.credit span { color: var(--accent); }

.offline-badge { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: var(--orange); color: #fff; font-size: 0.78rem; padding: 6px 14px; border-radius: 999px; display: none; z-index: 40; box-shadow: var(--shadow); }
.offline-badge.show { display: block; }

@media (max-width: 520px) {
  .navbar { padding: 10px 14px; }
  .navbar-links { gap: 2px; }
  .navbar-links a { padding: 7px 10px; font-size: 0.82rem; }
  .navbar-brand span { display: none; }
}
