/* -----------------------
   Brand tokens
   (Tweak these 4 to match exactly)
------------------------ */
:root {
  --brand: #245b3a;       /* primary green */
  --brand-dark: #173626;  /* dark header/footer green */
  --brand-accent: #7fbf3f;/* lighter turf accent */
  --bg: #f3f4f6;          /* page background */
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --surface: #ffffff;
}

/* -----------------------
   Base / layout
------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-main);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

/* -----------------------
   Header / nav / footer
------------------------ */
.site-header {
  background: var(--brand-dark);
  color: #f9fafb;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}

.site-header .logo {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.site-header .logo img {
  max-height: 38px;
}

.main-nav {
  background: #10241a;
  border-bottom: 3px solid var(--brand-accent);
}

.main-nav a {
  display: inline-block;
  padding: 0.65rem 1rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a:focus {
  background: var(--brand);
  color: #ffffff;
}

.site-footer {
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #0f1b14;
  border-top: 3px solid var(--brand-accent);
}

/* -----------------------
   Typography
------------------------ */
h1, h2, h3 {
  margin-top: 0;
  font-weight: 600;
  color: var(--text-main);
}

h1 { font-size: 1.45rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; }
h3 { font-size: 1rem; margin-top: 1rem; }

p { margin: 0.5rem 0; }

small { font-size: 0.8rem; color: var(--text-muted); }

a {
  color: var(--brand);
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* -----------------------
   Forms
------------------------ */
form {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

label > span {
  display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  margin-top: 0.25rem;
  border-radius: 0.4rem;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand-accent);
  outline-offset: 1px;
  border-color: var(--brand);
  background: #ffffff;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--brand);
  color: #ffffff;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

/* inline / compact forms */
.form-inline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* -----------------------
   Alerts
------------------------ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #ecfdf3;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

/* -----------------------
   Tables
------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--surface);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-size: 0.9rem;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

th {
  text-align: left;
  background: #f3f4f6;
  font-weight: 500;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

@media (max-width: 640px) {
  table {
    font-size: 0.85rem;
  }
}

/* -----------------------
   Dashboard cards
------------------------ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.card {
  display: block;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--brand-accent);
}

.card h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card:hover,
.card:focus {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

/* -----------------------
   Checklist form
------------------------ */
.check-item {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #f9fafb;
  border: 1px solid #d1d5db;
}

.check-item legend {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.check-item textarea {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

/* confirmation checkbox */
.confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.confirm input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
}

/* component list in machine edit */
.component-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.5rem;
}

.component-list li {
  margin-bottom: 0.25rem;
}

.component-list label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* filters in reports */
.filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* -----------------------
   Auth pages
------------------------ */
.auth {
  max-width: 420px;
  margin-top: 2rem;
}

.auth form {
  margin-top: 1rem;
}

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

/* -----------------------
   Larger screens
------------------------ */
@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
  }

  .form-inline {
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .form-inline label {
    flex: 1 1 220px;
  }
}


.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-pill.ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-pill.issue {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}


/* Table action links styled as buttons */
.action-btn {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--brand);
  color: #ffffff;
  white-space: nowrap;
}

.action-btn:hover,
.action-btn:focus {
  background: var(--brand-dark);
  color: #ffffff;
  text-decoration: none;
}

/* optional secondary style for less-important actions */
.action-btn--secondary {
  background: #ffffff;
  color: var(--brand);
  border-color: #d1d5db;
}

.action-btn--secondary:hover,
.action-btn--secondary:focus {
  background: #f3f4f6;
}
