* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f7f4;
  color: #1d1d29;
  font-family: Tahoma, Arial, sans-serif;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel,
.topbar,
.sidebar {
  background: #fff;
  border: 1px solid #dce7df;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(20, 60, 35, 0.06);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
}

.login-card h1,
.login-card p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 6px 4px 22px;
  display: grid;
  gap: 4px;
}

.brand span,
label {
  color: #6d7482;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button,
button {
  border: 1px solid #dde1e7;
  border-radius: 7px;
  padding: 11px 14px;
  background: #fff;
  color: #222936;
  font: inherit;
  cursor: pointer;
}

.nav-button {
  text-align: right;
}

.nav-button.active,
button.primary,
button:not(.secondary):not(.ghost):not(.danger) {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

button.secondary {
  background: #edf8f0;
  border-color: #b7dfc3;
  color: #15803d;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #15803d;
  outline-offset: 2px;
}

input,
select {
  accent-color: #15803d;
}

button.danger {
  background: #fff1f0;
  border-color: #ffccc7;
  color: #cf1322;
}

button.ghost {
  margin-top: auto;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 66px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.topbar h1 {
  font-size: 20px;
  margin: 0;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 7px;
  padding: 16px;
}

.metric span {
  color: #6d7482;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

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

.wide-field {
  grid-column: span 4;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 7px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid #eceff3;
  padding: 12px;
  text-align: right;
  vertical-align: middle;
}

th {
  background: #edf3ef;
  font-weight: 700;
}

tr:nth-child(even) td {
  background: #fafafa;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf8f0;
  color: #15803d;
  font-size: 12px;
}

.banner-settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.banner-settings p { flex-basis: 100%; margin-bottom: 0; color: #6d7482; line-height: 1.8; }
.banner-preview { max-width: 800px; }
.banner-preview img { width: 100%; aspect-ratio: 4 / 1; object-fit: cover; display: block; border-radius: 16px; }
.banner-message { margin: 0; color: #15803d; }
.banner-message.error { color: #cf1322; }
.banner-admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #dce7df; }
.banner-admin-row > img { width: min(280px, 100%); aspect-ratio: 4 / 1; object-fit: cover; border-radius: 12px; }
.banner-admin-row > div { min-width: 0; overflow-wrap: anywhere; }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.status.ok {
  background: #f0f9eb;
  color: #237804;
}

.status.danger-status {
  background: #fff1f0;
  color: #cf1322;
}

@media (max-width: 900px) {
  .app-shell,
  .metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .wide-field {
    grid-column: auto;
  }
}
