/* Theme adapted from hancegc.com — Jost + Roboto, green-and-white legal/corporate. */
:root {
  --bg: #f6f8f5;            /* page background (light green tint) */
  --card: #ffffff;          /* surfaces */
  --text: #585858;          /* body text */
  --heading: #2c541d;       /* dark green headings */
  --strong: #1a1a1a;
  --muted: #8a938a;         /* muted green-gray */
  --primary: #74a84a;       /* brand green */
  --primary-dark: #2c541d;  /* dark green (hover / bar) */
  --olive: #526840;
  --border: #eaeaea;
  --danger-bg: #fdecea;
  --danger-text: #b71c1c;
  --info-bg: #eef3ea;
  --info-text: #526840;
  --success-bg: #e8f2df;
  --success-text: #2c541d;
}

* { box-sizing: border-box; }

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

h1, h2, h3 {
  font-family: "Jost", "Roboto", sans-serif;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.25;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; margin-top: 2rem; }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

/* Top bar — dark green, on brand */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.75rem;
  background: var(--primary-dark);
  border-bottom: 3px solid var(--primary);
}
.topbar .brand {
  font-family: "Jost", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: #ffffff;
}
.topbar .brand:hover { color: #ffffff; text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 1.25rem; }
.topbar-right a { color: #eef3ea; font-size: 0.92rem; font-weight: 500; }
.topbar-right a:hover { color: #ffffff; text-decoration: none; }
.topbar .user { color: #cfe0c2; font-size: 0.85rem; }
.role-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* Content */
.content { max-width: 760px; margin: 2.5rem auto; padding: 0 1.75rem; }
.content > p { max-width: 60ch; }
.actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Flash messages */
.flashes { max-width: 760px; margin: 1.25rem auto 0; padding: 0 1.75rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
}
.flash-error, .flash-danger { background: var(--danger-bg); color: var(--danger-text); border-left-color: var(--danger-text); }
.flash-info, .flash-message { background: var(--info-bg); color: var(--info-text); border-left-color: var(--olive); }
.flash-success { background: var(--success-bg); color: var(--success-text); border-left-color: var(--primary); }

/* Buttons */
.btn, button[type="submit"] {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover, button[type="submit"]:hover {
  background: var(--primary-dark);
  color: #ffffff;
  text-decoration: none;
}

/* Forms */
form { max-width: 440px; }
label { display: block; margin: 0.9rem 0 0.3rem; font-weight: 500; font-size: 0.9rem; color: var(--heading); }
label.checkbox { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "Roboto", sans-serif;
  font-size: 0.95rem;
  color: var(--strong);
  background: #ffffff;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(116, 168, 74, 0.15);
}
.field-error { color: var(--danger-text); font-size: 0.82rem; margin-top: 0.25rem; }

/* Tables */
.muted { color: var(--muted); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.data-table th {
  background: var(--bg);
  color: var(--olive);
  font-family: "Jost", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
}
.data-table tr:last-child td { border-bottom: none; }

/* Row actions in tables */
.row-actions { display: flex; gap: 0.85rem; align-items: center; }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  color: var(--primary-dark);
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; background: none; color: var(--primary); }
.link-button.danger { color: var(--danger-text); }
.link-button.danger:hover { color: var(--danger-text); }

/* Definition-style detail table (profile view) */
.detail-table th { width: 38%; text-transform: none; letter-spacing: normal; }

/* Report filter row */
.report-filter { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; max-width: none; margin-bottom: 1rem; }
.report-filter label { margin: 0 0 0.25rem; }
.report-filter input[type="date"] { width: auto; }

/* Profile key/value editor (two columns: field name | value) */
.kv-form { max-width: 720px; }
.kv-row { display: flex; gap: 0.6rem; margin-bottom: 0.5rem; }
.kv-row input { margin: 0; }
.kv-row input:first-child { flex: 0 0 34%; }
.kv-row input:last-child { flex: 1; }
.kv-head { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kv-head span:first-child { flex: 0 0 34%; }
.kv-head span:last-child { flex: 1; }

/* Repeatable group rows */
.group-rows { margin-bottom: 0.5rem; }
.group-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.group-row input { flex: 1; }

/* Auth card */
.auth-card {
  max-width: 400px;
  margin: 4rem auto;
  background: var(--card);
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(44, 84, 29, 0.08);
}
.auth-card h1 { margin-top: 0; }
.auth-card .btn { width: 100%; margin-top: 1.5rem; }
