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

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #076125;
  --muted: #666;
  --line: #e5e5e5;
  --primary: #111;
  --danger: #991b1b;
  --danger-bg: #fef2f2;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #076125;
  letter-spacing: 0.3px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand-text {
  color: #076125;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: #076125;
  margin-bottom: 18px;
}

.login-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.login-logo-text {
  font-size: 28px;
  font-weight: 700;
  color: #076125;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
}

.nav a:hover {
  background: #f3f3f3;
}

.content {
  padding: 30px;
}

h1 {
  font-size: 24px;
  margin-bottom: 20px;
}

h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

p.muted,
.muted {
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.grid {
  display: grid;
  gap: 20px;
}

.cards-4 {
  grid-template-columns: repeat(4, 1fr);
}

.cards-2 {
  grid-template-columns: repeat(2, 1fr);
}

.zone-summary-grid {
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat span {
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  font-size: 22px;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

th {
  background: #fafafa;
  font-weight: 500;
  color: var(--muted);
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-form .card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input, select, button, .btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

button,
.btn {
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:hover,
.btn:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.btn-sm {
  padding: 7px 10px;
  font-size: 13px;
}

.page-head,
.actions-row,
.actions-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head {
  margin-bottom: 20px;
}

.actions-inline form {
  display: inline-flex;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.actions-card {
  justify-content: space-between;
}

.is-disabled {
  opacity: 0.45;
}

.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-card {
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}

.flash-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.flash.success {
  border-color: #a7f3d0;
}

.flash.error {
  border-color: #fecaca;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .cards-4,
  .cards-2,
  .form-grid,
  .zone-summary-grid {
    grid-template-columns: 1fr;
  }

  .page-head,
  .actions-row,
  .actions-inline {
    flex-direction: column;
    align-items: stretch;
  }
}

.field-error {
  border-color: #dc2626 !important;
  background: #fef2f2;
}

.validation-banner {
  display: none;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.validation-banner.is-visible {
  display: block;
}
