:root {
  --bg: #f6f4ee;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --text: #1e2321;
  --muted: #66706b;
  --line: #dfe5dd;
  --primary: #14785f;
  --primary-dark: #0f5d4a;
  --accent: #d89b28;
  --good: #14785f;
  --bad: #b63d32;
  --shadow: 0 18px 45px rgba(30, 35, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2ef;
}

.admin-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 18px;
}

.login-panel,
.admin-header,
.panel,
.stats-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(520px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
}

.admin-header,
.panel {
  padding: 22px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.admin-header h1,
.login-panel h1,
.panel h2 {
  margin: 8px 0 10px;
  line-height: 1.08;
}

.admin-header h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.panel h2 {
  font-size: 1.25rem;
}

.admin-header p,
.login-panel p,
.hint,
.table-head p {
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  background: #e9f4ef;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-header-actions,
.tabs,
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  gap: 14px;
}

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

.stats-grid article {
  padding: 18px;
}

.stats-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.stats-grid strong {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  overflow-wrap: anywhere;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
button,
.button-link,
.tabs a {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 3px solid rgba(20, 120, 95, 0.18);
  border-color: var(--primary);
}

button,
.button-link,
.tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover,
.tabs a:hover,
.tabs a.active {
  background: var(--primary-dark);
}

.secondary-button,
.tabs a {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.tabs a.active {
  color: #fff;
  border-color: var(--primary-dark);
}

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

.form-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 6px;
  font-weight: 800;
}

.form-message.success {
  background: #e8f5ee;
  color: var(--good);
}

.form-message.error {
  background: #f9e8e6;
  color: var(--bad);
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: var(--panel-soft);
  color: #39423e;
  font-size: 0.9rem;
}

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

tbody tr:hover {
  background: #fbfcf9;
}

.good {
  color: var(--good);
  font-weight: 800;
}

.bad {
  color: var(--bad);
  font-weight: 800;
}

@media (max-width: 980px) {
  .admin-header,
  .table-head {
    flex-direction: column;
  }

  .stats-grid-five,
  .workspace-grid,
  .filters,
  .two-col {
    grid-template-columns: 1fr;
  }

  .admin-header-actions,
  .tabs {
    width: 100%;
  }

  .button-link,
  .tabs a {
    flex: 1;
  }
}
