/* GBH Customer Portal — Phase 14 HTTP surface. Mobile-first, no framework, no build step. */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --border: #e4e1da;
  --text: #1c1b19;
  --text-muted: #6b6860;
  --accent: #14532d;
  --accent-strong: #0d3b20;
  --accent-contrast: #ffffff;
  --warn-bg: #fff4e0;
  --warn-text: #8a5a00;
  --danger-bg: #fdecec;
  --danger-text: #9a2626;
  --ok-bg: #e9f5ec;
  --ok-text: #1e6b3a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.06), 0 1px 12px rgba(20, 20, 15, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #201f18;
    --surface-2: #262418;
    --border: #38352a;
    --text: #f1efe7;
    --text-muted: #a8a396;
    --accent: #4fae74;
    --accent-strong: #6fc78f;
    --accent-contrast: #0c1a10;
    --warn-bg: #3a2c10;
    --warn-text: #e3b45a;
    --danger-bg: #3a1a1a;
    --danger-text: #f0a3a3;
    --ok-bg: #16301f;
    --ok-text: #78d19a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

a { color: var(--accent-strong); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.gbh-shell { min-height: 100vh; display: flex; flex-direction: column; }

.gbh-topbar {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 14px 16px;
}
.gbh-topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.gbh-brand { font-weight: 700; letter-spacing: 0.02em; font-size: 15px; }
.gbh-project-name { font-size: 13px; opacity: 0.85; }
.gbh-logout-form { margin: 0; }
.gbh-logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: inherit;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.gbh-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gbh-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 12px;
  min-width: max-content;
}
.gbh-nav a {
  display: inline-block;
  padding: 12px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.gbh-nav a.active { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.gbh-nav a:hover { color: var(--text); }

.gbh-main { flex: 1; padding: 20px 16px 48px; }
.gbh-container { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.gbh-page-title { font-size: 20px; font-weight: 700; margin: 4px 0 0; }
.gbh-page-sub { color: var(--text-muted); margin: 0 0 4px; font-size: 13.5px; }

.gbh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.gbh-card h2 { margin: 0 0 10px; font-size: 15px; }
.gbh-card h3 { margin: 0 0 8px; font-size: 14px; }
.gbh-card + .gbh-card { margin-top: 0; }

.gbh-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .gbh-grid.gbh-grid-2 { grid-template-columns: 1fr 1fr; } }

.gbh-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.gbh-kv:last-child { border-bottom: none; }
.gbh-kv dt { color: var(--text-muted); }
.gbh-kv dd { margin: 0; font-weight: 600; text-align: right; }

.gbh-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.gbh-badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.gbh-badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.gbh-badge-muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.gbh-notice { border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; }
.gbh-notice-ok { background: var(--ok-bg); color: var(--ok-text); }
.gbh-notice-warn { background: var(--warn-bg); color: var(--warn-text); }
.gbh-notice-danger { background: var(--danger-bg); color: var(--danger-text); }

.gbh-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gbh-list-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
}
.gbh-list-item-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gbh-list-item-title { font-weight: 600; font-size: 14px; }
.gbh-list-item-meta { color: var(--text-muted); font-size: 12.5px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted); }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px; /* >=16px avoids iOS zoom on focus in practice at 15px+system fonts; kept consistent with body */
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.gbh-field { margin-bottom: 12px; }
.gbh-field:last-child { margin-bottom: 0; }
fieldset { border: none; padding: 0; margin: 0; }

.gbh-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.gbh-btn:hover { background: var(--accent-strong); }
.gbh-btn-secondary { background: transparent; color: var(--accent-strong); border: 1px solid var(--accent-strong); }
.gbh-btn-secondary:hover { background: var(--ok-bg); }
.gbh-btn-danger { background: var(--danger-text); }
.gbh-btn[disabled], .gbh-btn-disabled { opacity: 0.5; pointer-events: none; }
.gbh-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.gbh-empty { color: var(--text-muted); font-size: 13.5px; padding: 8px 0; }

.gbh-section-body p { margin: 0 0 8px; }
.gbh-section-body ul { margin: 0 0 8px 18px; padding: 0; }

.gbh-footer { text-align: center; color: var(--text-muted); font-size: 12px; padding: 24px 16px; }

@media (max-width: 480px) {
  .gbh-main { padding: 14px 10px 40px; }
  .gbh-card { padding: 13px; }
  .gbh-page-title { font-size: 18px; }
}
