:root {
  --bg: #f3f7f4;
  --surface: #ffffff;
  --surface-2: #f8fbf8;
  --text: #17211b;
  --muted: #647067;
  --primary: #2e7d32;
  --primary-2: #81c784;
  --danger: #d64545;
  --border: #dde7dd;
  --shadow: 0 18px 48px rgba(26, 45, 31, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #edf6ef 0%, var(--bg) 100%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view,
.dashboard-view {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card,
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(480px, 100%);
  padding: 32px;
  border-radius: 28px;
}

.login-card h1,
.topbar h1,
.panel h2,
.section-head h3 {
  margin: 0;
}

.login-card p,
.topbar p,
.panel-header p {
  color: var(--muted);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 125, 50, 0.1);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.stack-md {
  display: grid;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #39523e;
  margin-bottom: 8px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(129, 199, 132, 0.3);
  border-color: var(--primary-2);
}

button {
  border: 0;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

.btn-small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #3e9655 100%);
  color: #fff;
}

.btn-secondary {
  background: #eef5ef;
  color: #27462d;
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(214, 69, 69, 0.12);
  color: var(--danger);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-badge {
  min-width: 220px;
  background: var(--surface);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.admin-badge span,
.admin-badge small {
  display: block;
}

.admin-badge span {
  font-weight: 800;
}

.admin-badge small {
  margin-top: 4px;
  color: var(--muted);
}

.message {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  font-weight: 600;
}

.message.error {
  background: rgba(214, 69, 69, 0.12);
  color: #9c2f2f;
}

.message.success {
  background: rgba(46, 125, 50, 0.12);
  color: #1f6a37;
}

.message.info {
  background: rgba(47, 114, 204, 0.12);
  color: #25529a;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  border-radius: 20px;
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 34px;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  border-radius: var(--radius);
  padding: 22px;
}

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

.panel-header {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.charger-rows {
  display: grid;
  gap: 12px;
}

.charger-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 1fr 0.8fr 0.9fr auto;
  gap: 10px;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
}

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

thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 14px 10px;
  border-bottom: 1px solid #edf2ed;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  background: rgba(46, 125, 50, 0.12);
  color: #1d6a34;
}

.status-inactive {
  background: rgba(130, 143, 134, 0.14);
  color: #536159;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

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

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

  .charger-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .login-view,
  .dashboard-view {
    width: min(100% - 24px, 1400px);
    padding-top: 24px;
  }

  .topbar {
    flex-direction: column;
  }

  .stats-grid,
  .form-grid,
  .charger-row {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }
}
