:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #5b677a;
  --brand: #1b6f5e;
  --brand-2: #0e4d40;
  --line: #dde3ec;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top right, #d8efe8 0, var(--bg) 45%);
  color: var(--ink);
  line-height: 1.5;
}

.container { width: min(1100px, 92%); margin: 0 auto; }
.topbar {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  margin-bottom: 24px;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; position: relative; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 0.2px; }
.nav-toggle {
  display: none;
  width: auto;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-weight: 600;
}
.main-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 0;
  padding: 7px 10px;
  border-radius: 8px;
  font-weight: 600;
}
nav a:hover { background: rgba(255, 255, 255, 0.14); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(10, 16, 32, 0.05);
}
.card h1, .card h2 { margin-top: 0; line-height: 1.3; }
.lead { max-width: 78ch; color: #1e293b; }

.grid { display: grid; gap: 10px; }
input, select, textarea, button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccd6e3;
  font: inherit;
  font-size: 16px;
}
button { cursor: pointer; }
.btn {
  display: inline-block;
  width: auto;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 9px 14px;
  border-radius: 10px;
}
.btn.alt { background: #eaf2f9; color: #17324d; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { text-align: center; }

.flash {
  margin: 10px 0;
  border-radius: 12px;
  padding: 10px 12px;
}
.flash.error { background: #ffe9e9; color: #8f1010; }
.flash.success { background: #e6f7ed; color: #0e6b3c; }
.flash.info { background: #e8f1ff; color: #1d4f8f; }

.table-wrap { margin-top: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: 0; min-width: 760px; }
th, td { border: 1px solid var(--line); padding: 8px; text-align: left; }
th { background: #f4f7fb; }
td { word-break: break-word; }

.msg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}
.meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hint { margin: 0 0 10px; color: var(--muted); }
.inline { display: flex; flex-wrap: wrap; gap: 6px; }
.inline button { width: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.admin-actions { display: grid; gap: 10px; margin: 14px 0; }

@media (max-width: 992px) {
  .container { width: 94%; }
  .card { padding: 16px; }
  table { min-width: 680px; }
}

@media (max-width: 768px) {
  .container { width: 95%; }
  .topbar-inner { align-items: center; justify-content: space-between; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
  }
  .main-nav.open { display: grid; }
  .main-nav a { display: block; width: 100%; }
  .card { padding: 14px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; text-align: center; }
  .inline { flex-direction: column; }
  .inline button { width: 100%; }
  table { min-width: 620px; }
}

@media (max-width: 576px) {
  .container { width: 96%; }
  .brand { font-size: 15px; }
  .card { padding: 12px; border-radius: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .lead { font-size: 0.96rem; }
  table { min-width: 560px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .btn { padding: 10px 12px; }
  input, select, textarea, button { padding: 10px 11px; }
  table { min-width: 520px; }
}
