/* ═══════════════════════════════════════════
   Census 2026 — Global Stylesheet
   Primary:  #1B6B45  (forest green)
   Surface:  #F2F4F6
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --green:       #1B6B45;
  --green-dark:  #145236;
  --green-light: #E8F5EE;
  --green-mid:   #2E8A5A;
  --surface:     #F2F4F6;
  --white:       #ffffff;
  --border:      #E0E4E9;
  --text:        #111827;
  --muted:       #6B7280;
  --red:         #DC2626;
  --radius:      10px;
  --shadow:      0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', system-ui, sans-serif; color: var(--text); background: var(--surface); line-height: 1.5; }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ════════ LOGIN ════════ */
.login-page { background: var(--green); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap  { width: 100%; max-width: 460px; padding: 20px; }
.login-card  { background: var(--white); border-radius: 16px; padding: 48px 40px; box-shadow: var(--shadow-md); }
.login-logo  {
  width: 80px; height: 80px; background: var(--green); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; margin: 0 auto 20px;
}
.login-title { text-align: center; font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 28px; }
.form-group  { margin-bottom: 18px; }
.form-label  { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.req         { color: var(--red); }
.form-input  {
  width: 100%; padding: 11px 14px; font-size: 14px; font-family: inherit;
  background: #F0F4F8; border: 1.5px solid transparent; border-radius: 8px;
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--green); background: #fff; }
.login-row   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--green); }
.forgot-link { color: var(--green); font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }
.btn-login {
  width: 100%; padding: 13px; background: var(--green); color: #fff; font-size: 15px; font-weight: 600;
  font-family: inherit; border: none; border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.btn-login:hover { background: var(--green-dark); }

/* ════════ TOP NAV ════════ */
.topnav {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 56px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.nav-left  { display: flex; align-items: center; gap: 24px; }
.nav-logo  {
  width: 36px; height: 36px; background: var(--green); border-radius: 8px;
  font-size: 14px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-links { display: flex; gap: 4px; }
.nav-link  { font-size: 14px; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 6px; transition: all 0.15s; }
.nav-link:hover, .nav-link.active { color: var(--green); background: var(--green-light); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user  { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.nav-logout { font-size: 18px; color: var(--muted); cursor: pointer; transition: color 0.15s; padding: 4px; }
.nav-logout:hover { color: var(--red); }

/* ════════ PAGE LAYOUT ════════ */
.page-body   { padding: 32px; max-width: 1200px; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title  { font-size: 28px; font-weight: 700; color: var(--text); }

/* ════════ BUTTONS ════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; font-size: 14px; font-weight: 600; font-family: inherit;
  border-radius: 8px; border: none; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-outline:hover { background: var(--green-light); }
.btn-ghost   { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-group   { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════ TABLE ════════ */
.table-wrap { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.data-table  { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead tr { background: var(--white); border-bottom: 1.5px solid var(--border); }
.data-table th { padding: 14px 20px; text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.data-table th .sort { font-size: 11px; margin-left: 4px; color: #ccc; }
.data-table td { padding: 13px 20px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table td.name-cell { color: var(--green); font-weight: 500; cursor: pointer; }
.data-table td.name-cell:hover { text-decoration: underline; }

/* ════════ PAGINATION ════════ */
.pagination  { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
.page-nums   { display: flex; gap: 4px; align-items: center; }
.page-btn    { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border); background: var(--white); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); transition: all 0.15s; }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.page-btn:hover:not(.active) { border-color: var(--green); color: var(--green); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-dots   { padding: 0 4px; color: var(--muted); }

/* ════════ MODAL ════════ */
.overlay  { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; align-items: center; justify-content: center; }
.overlay.open { display: flex; }
.modal    { background: var(--white); border-radius: 14px; padding: 0; min-width: 500px; max-width: 96vw; box-shadow: 0 12px 40px rgba(0,0,0,0.15); overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close { font-size: 20px; font-weight: 700; color: var(--green); cursor: pointer; line-height: 1; background: none; border: none; }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* File input row */
.file-input-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.file-input-row:hover { border-color: var(--green); }
.file-input-row .paperclip { font-size: 18px; color: #ccc; }
.file-input-row span { font-size: 14px; color: var(--muted); }
.file-input-row.has-file span { color: var(--text); font-weight: 500; }
.file-input-row input[type=file] { display: none; }

/* ════════ TOAST ════════ */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 500; display: none; z-index: 999; box-shadow: var(--shadow-md); }

/* ════════ SPINNER ════════ */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-dark { border: 2px solid rgba(0,0,0,0.15); border-top-color: var(--green); }

/* ════════ DASHBOARD CARDS ════════ */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card  {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; align-items: flex-start; gap: 16px;
}
.stat-icon  { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.green  { background: var(--green-light); }
.stat-icon.blue   { background: #EEF2FF; }
.stat-val   { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-lbl   { font-size: 13px; color: var(--muted); margin-top: 5px; }
.stat-sub   { font-size: 12px; color: var(--green); margin-top: 4px; font-weight: 500; }

/* Chart card */
.chart-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.chart-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 20px; }
.chart-area { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-bottom: 32px; position: relative; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; position: relative; }
.chart-bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--green); transition: height 0.6s cubic-bezier(.4,0,.2,1); min-height: 4px; position: relative; }
.chart-bar:hover { background: var(--green-dark); }
.chart-bar .bar-tip { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.chart-bar:hover .bar-tip { opacity: 1; }
.chart-label { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; position: absolute; bottom: -22px; white-space: nowrap; }
.chart-y-lines { position: absolute; inset: 0 0 32px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-y-line { border-top: 1px dashed #f0f0f0; width: 100%; }

/* Refresh bar */
.refresh-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.refresh-ts  { font-size: 13px; color: var(--muted); }
.refresh-ts strong { color: var(--green); }
.auto-badge  { font-size: 11px; background: var(--green-light); color: var(--green); padding: 3px 10px; border-radius: 20px; font-weight: 600; }

/* ════════ NEW SURVEY FORM ════════ */
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; max-width: 600px; }

/* ════════ REQUIREMENT PANEL ════════ */
.req-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 32px; overflow: hidden; }
.req-panel-hdr { background: #F8FAF9; border-bottom: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.req-panel-hdr h4 { font-size: 13px; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
.req-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.req-tag.tech { background: var(--green-light); color: var(--green); }
.req-tag.us   { background: #EEF2FF; color: #4F46E5; }
.req-body { padding: 20px; }
.req-section { margin-bottom: 18px; }
.req-section:last-child { margin-bottom: 0; }
.req-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1.5px solid #F0F0F0; }
.req-list { list-style: none; padding: 0; }
.req-list li { font-size: 13px; color: #374151; padding: 4px 0 4px 14px; position: relative; line-height: 1.6; border-bottom: 0.5px solid #F9FAFB; }
.req-list li:last-child { border-bottom: none; }
.req-list li::before { content: "▸"; position: absolute; left: 0; color: var(--green); font-size: 10px; top: 6px; }
.req-list li strong { color: var(--green-dark); }
.us-card { background: #F8FAF9; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-top: 10px; }
.us-card p { font-size: 13px; color: #374151; line-height: 1.7; }
.us-card p strong { color: var(--green-dark); }

/* ════════ LEARNING SECTION ════════ */
.learning-section { background: var(--green); border-radius: var(--radius); padding: 32px; margin-top: 32px; }
.learning-section h3 { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.learning-section .sub { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 24px; }
.learning-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.learning-card { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; padding: 16px; }
.learning-card h5 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.learning-card p  { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.6; }
@media(max-width:900px){ .learning-grid{grid-template-columns:1fr 1fr;} .stat-cards{grid-template-columns:1fr 1fr;} }
@media(max-width:600px){ .learning-grid{grid-template-columns:1fr;} .stat-cards{grid-template-columns:1fr;} }

/* ════════ FOOTER ════════ */
.site-footer { background: var(--white); border-top: 1px solid var(--border); margin-top: 48px; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand-logo { width: 28px; height: 28px; background: var(--green); border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; }
.footer-brand span { font-size: 13px; color: var(--muted); }
.footer-brand a { color: var(--green); font-weight: 600; }
.footer-right { font-size: 12px; color: #ccc; }

/* db table inside req */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.mini-table th { background: #F8FAF9; padding: 7px 12px; text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; border: 1px solid var(--border); }
.mini-table td { padding: 7px 12px; border: 1px solid var(--border); color: #374151; }
.mini-table tr:nth-child(even) td { background: #FAFBFA; }
.pk { display: inline-block; background: #FEF9EC; color: #854F0B; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-right: 3px; }

/* mono code */
.mono { font-family: monospace; font-size: 12px; background: #F0F4F0; padding: 2px 6px; border-radius: 4px; color: var(--green-dark); }
