:root {
  --bg: #f5f1ea;
  --panel: #fffdf9;
  --ink: #1f2a2a;
  --muted: #687274;
  --accent: #315f65;
  --line: #ded8ce;
  --danger: #9b3d3d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.hidden { display: none !important; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card, .panel, .modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(31,42,42,.07);
}
.login-card { width: min(430px, 100%); padding: 34px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1,h2,h3 { margin: 6px 0 8px; }
.muted { color: var(--muted); }
label { display: grid; gap: 7px; margin: 16px 0; font-size: 14px; }
input, select, button {
  font: inherit;
  border-radius: 10px;
}
input, select {
  border: 1px solid var(--line);
  padding: 12px;
  background: white;
}
button {
  border: 0;
  padding: 11px 15px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 650;
}
button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.error { color: var(--danger); margin-top: 12px; min-height: 18px; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,249,.92);
  position: sticky;
  top: 0;
}
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
main { padding: 28px 32px 60px; max-width: 1500px; margin: 0 auto; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 30px; font-weight: 760; margin-top: 5px; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th,td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td:not(:first-child), th:not(:first-child) { text-align: right; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: grid; place-items: center; padding: 20px;
}
.modal-card { width: min(900px, 100%); max-height: 88vh; overflow: auto; padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.create-user { display: grid; grid-template-columns: 1fr 1fr 130px auto; gap: 10px; margin: 18px 0; }
.user-row {
  display: grid; grid-template-columns: 1fr 100px 100px 120px;
  gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line);
}
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  header { align-items: flex-start; flex-direction: column; }
  .create-user, .user-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  main, header { padding-left: 18px; padding-right: 18px; }
}
