* {
  box-sizing: border-box;
}

:root {
  --av-green: #04733b;
  --av-green-dark: #075f35;
  --av-green-soft: #eaf6ef;
  --av-border: #dfe7e2;
  --av-text: #0f172a;
  --av-muted: #475569;
  --av-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f8faf9;
  color: var(--av-text);
}

.topbar {
  background: var(--av-green);
  color: white;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-mark {
  font-size: 24px;
}

.brand {
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.subtitle {
  font-size: 13px;
  opacity: 0.85;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  background: white;
  color: var(--av-green);
  font-weight: bold;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.nav {
  background: var(--av-green);
  border-bottom: 1px solid #086c3a;
  padding: 0 18px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  padding: 13px 12px;
  border-radius: 10px 10px 0 0;
}

.nav a:hover,
.nav a.active {
  background: rgba(255,255,255,0.18);
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px;
}

.dashboard-head h1 {
  margin: 0 0 6px;
  font-size: 34px;
}

.welcome {
  margin: 0 0 18px;
  font-size: 18px;
}

.welcome strong {
  color: var(--av-green);
}

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

.dashboard-stat {
  min-height: 96px;
  background: white;
  border: 1px solid var(--av-border);
  border-radius: 12px;
  box-shadow: var(--av-shadow);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: inherit;
}

.dashboard-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--av-green-soft);
  color: var(--av-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.dashboard-stat-number {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--av-green);
}

.dashboard-stat-label {
  display: block;
  color: #111827;
  font-size: 15px;
}

.panel {
  background: white;
  border: 1px solid var(--av-border);
  border-radius: 12px;
  box-shadow: var(--av-shadow);
  padding: 22px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.page-head h2 {
  margin: 0 0 6px;
  color: #111827;
}

.page-head p {
  margin: 0;
  color: var(--av-muted);
}

.button-link {
  display: inline-block;
  background: var(--av-green);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
}

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

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e1e8e3;
  text-align: left;
}

th {
  color: #334155;
  font-size: 14px;
}

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #edf5ef 0%, #dcebe1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-card {
  background: white;
  border: 1px solid #dce5df;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo {
  font-size: 44px;
  margin-bottom: 10px;
}

.login-brand h1 {
  font-size: 24px;
  color: var(--av-green);
  margin: 0;
}

.login-brand p {
  color: var(--av-muted);
  margin-top: 8px;
}

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

input,
select,
textarea,
button {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #cfd8d2;
  font-size: 16px;
}

button {
  background: var(--av-green);
  color: white;
  border: 0;
  cursor: pointer;
  font-weight: bold;
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
}

.message.error {
  background: #fde8e8;
  color: #8a1f1f;
  border: 1px solid #f5c2c2;
}

@media (max-width: 900px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .page-head {
    display: block;
  }

  .button-link {
    margin-top: 12px;
    width: 100%;
    text-align: center;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .nav {
    display: block;
    padding: 8px;
  }

  .nav a {
    display: block;
    border-radius: 10px;
  }
}

.message.success {
  background: #e7f6ec;
  color: #1f5f3b;
  border: 1px solid #b7d3c0;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge-success {
  background: #e7f6ec;
  color: #1f5f3b;
}

.badge-muted {
  background: #eef2f7;
  color: #475569;
}

.small-link {
  color: var(--av-green-dark);
  font-weight: 700;
  text-decoration: none;
}

.small-link:hover {
  text-decoration: underline;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.button-link.secondary {
  background: #64748b;
}

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

.panel + .panel {
  margin-top: 22px;
}

.panel h2 {
  margin-top: 0;
  color: #111827;
}

.checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkrow input {
  width: auto;
  min-height: auto;
}

.credential-box {
  background: #f8faf9;
  border: 1px solid var(--av-border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.credential-box code {
  background: #0f172a;
  color: white;
  padding: 4px 7px;
  border-radius: 6px;
}

.danger-zone {
  border-color: #f3b5b5;
}

.danger-button {
  background: #9b1c1c;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  margin-top: 10px;
}

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

  .inline-actions {
    display: block;
  }

  .inline-actions .button-link {
    display: block;
    margin-top: 10px;
  }
}

.tariff-create-panel {
  margin-bottom: 22px;
}

.tariff-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: end;
}

.tariff-create-form label {
  font-weight: 700;
  font-size: 14px;
}

.tariff-wide {
  grid-column: span 2;
}

.tariff-active-check {
  align-self: center;
  margin-top: 24px;
}

.tariff-submit-wrap {
  align-self: end;
}

.tariff-submit-wrap button {
  width: 100%;
}

.tariff-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.tariff-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tariff-card h2 {
  margin: 0;
}

.tariff-card-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tariff-card label {
  font-weight: 700;
  font-size: 14px;
}

.tariff-card input,
.tariff-card textarea {
  width: 100%;
}

.tariff-code {
  margin: 8px 0 12px;
}

.tariff-card button {
  margin-top: auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .tariff-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tariff-wide {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .tariff-create-form {
    grid-template-columns: 1fr;
  }

  .tariff-wide {
    grid-column: span 1;
  }
}

.tariff-create-panel {
  margin-bottom: 22px;
}

.tariff-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: end;
}

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

.form-field label,
.tariff-card label,
.tariff-create-form label {
  font-weight: 700;
  font-size: 14px;
}

.tariff-description {
  grid-column: span 2;
}

.tariff-active-check {
  min-height: 44px;
  align-items: center;
  margin: 0;
}

.tariff-submit-wrap {
  display: flex;
  align-items: end;
}

.tariff-submit-wrap button {
  width: 100%;
}

.tariff-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.tariff-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.tariff-card-head {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tariff-card-head h2 {
  margin: 0;
}

.tariff-code {
  margin: 0 0 8px;
}

.tariff-price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tariff-card input,
.tariff-card textarea,
.tariff-create-form input,
.tariff-create-form textarea {
  width: 100%;
}

.tariff-card button {
  margin-top: auto;
  width: 100%;
}

@media (max-width: 1300px) {
  .tariff-card-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
  }
}

@media (max-width: 1000px) {
  .tariff-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tariff-card-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .tariff-description {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .tariff-create-form,
  .tariff-card-grid,
  .tariff-price-row {
    grid-template-columns: 1fr;
  }

  .tariff-description {
    grid-column: span 1;
  }
}

