/* ============================================================
   Breckland Pest Control — staff app
   Light SaaS style modelled on the prized.domains admin
   (Inter, slate palette, white rounded cards, soft shadows,
   centered content) with Breckland's lime/black brand accent.
   ============================================================ */

:root {
  --bg: #0d0d0d;          /* page background */
  --surface: #1a1a1a;     /* cards */
  --ink: #f1f1f1;         /* primary text */
  --ink-muted: #a0a0a0;
  --ink-subtle: #6b6b6b;
  --border: #2a2a2a;
  --border-soft: #222222;
  --brand: #c8e847;       /* Breckland lime */
  --brand-dark: #b3d23a;
  --brand-tint: rgba(200, 232, 71, 0.12); /* dark lime wash for active/hover */
  --brand-deep: #c8e847;  /* lime text on dark */
  --black: #0a0a0a;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: var(--black);
  border: 1px solid var(--brand);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border-soft); color: var(--ink); }
.btn-danger {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.danger-zone {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ===== ALERTS ===== */
.alert {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert.show { display: block; }
.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.alert-ok { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }

/* ===== FORM FIELDS ===== */
.field { margin-bottom: 16px; text-align: left; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid #3d3d3d;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(200, 232, 71, 0.35);
}

/* ===== LOGIN ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card .logo {
  height: 96px;
  width: auto;
  border-radius: 14px;
  margin: 0 auto 20px;
}
.login-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-muted); font-size: 0.92rem; margin-bottom: 26px; }
.link-muted { color: var(--ink-subtle); font-size: 0.85rem; }
.link-muted:hover { color: var(--brand-deep); }

/* ===== APP LAYOUT (sidebar + main) ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.sidebar-logo img { height: 112px; width: auto; border-radius: 10px; margin: 0 auto; }

.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 11px 14px;
  border-radius: 0.6rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link:hover { background: var(--border-soft); color: var(--ink); }
.nav-link.active { background: var(--brand-tint); color: var(--brand); }

.main { flex: 1; min-width: 0; }

.menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  background: var(--brand);
  color: var(--black);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.3rem;
  cursor: pointer;
}

@media (max-width: 820px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .page { padding-top: 70px; }
}

/* ===== CENTERED PAGE ===== */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 70px;
}
.group-section + .group-section { margin-top: 56px; }
.page-head { text-align: center; margin-bottom: 34px; }
.page-head h1 { font-size: 2rem; font-weight: 800; }
.page-head .muted { color: var(--ink-muted); margin-top: 6px; }
.muted { color: var(--ink-muted); }
.dash-actions { margin-top: 16px; }

/* ===== MODAL / POPUP ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 70px 20px;
  overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 440px;
  padding: 28px;
}
.modal h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ===== CARD GRID (groups) ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.group-card {
  min-height: 96px;
  padding: 22px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.group-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
}

/* job cards (within a group) */
.job-card {
  padding: 18px 20px;
  text-align: left;
  border-left: 4px solid var(--brand);
}
.job-card .job-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.job-card .job-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  word-break: break-word;
}
.job-card .job-meta + .job-meta { margin-top: 2px; }
.job-card .job-meta a { color: var(--brand-deep); }
.job-card .job-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: right;
}
.job-delete, .job-edit {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.job-delete { color: #fca5a5; }
.job-delete:hover { color: var(--danger); text-decoration: underline; }
.job-edit { color: var(--brand-deep); margin-right: 10px; }
.job-edit:hover { text-decoration: underline; }

/* ===== GROUP PAGE ===== */
.back-row { text-align: center; margin-bottom: 14px; }
.back-link {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.back-link:hover { background: var(--border-soft); color: var(--ink); }
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 40px;
  text-align: center;
  color: var(--ink-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .page-head h1 { font-size: 1.6rem; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
