/* GymManager Web — single stylesheet (mobile-first, no framework, plan §9). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2733;
  --muted: #64748b;
  --line: #dde3ea;
  --accent: #2f6fed;
  --accent-dark: #2456c4;
  --danger: #c23b3b;
  --ok: #2f7d4f;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  max-width: 1200px; margin: 0 auto; padding: .6rem 1rem;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.nav a { color: var(--muted); padding: .25rem .35rem; border-radius: var(--radius); }
.nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.account { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.account-user { color: var(--muted); font-size: .9rem; }

.env-warning {
  max-width: 1200px; margin: .5rem auto 0; padding: .4rem 1rem;
  background: #fff4e0; border: 1px solid #f0c987; border-radius: var(--radius);
  font-size: .9rem;
}

.container { max-width: 1200px; margin: 1rem auto 2rem; padding: 0 1rem; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
}

.card ul { margin: .5rem 0 0; padding-left: 1.2rem; }

table.list {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.list th, table.list td {
  text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line);
}
table.list th { background: var(--bg); font-size: .85rem; color: var(--muted); }
table.list tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  background: #e8eefc; color: var(--accent-dark); font-size: .8rem;
}

.btn {
  display: inline-block; padding: .45rem .9rem; border: none; cursor: pointer;
  background: var(--accent); color: #fff; border-radius: var(--radius);
  font-size: .95rem; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a02f2f; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.inline-form { display: inline; }

.flash {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .6rem .9rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: #e9f6ee; border: 1px solid #bfe3cd; color: var(--ok);
}
.flash-error { background: #fbeaea; border-color: #efc2c2; color: var(--danger); }
.flash-dismiss {
  background: none; border: none; font-size: 1.1rem; cursor: pointer; color: inherit;
}

.stat-grid {
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.stat { background: var(--bg); border-radius: var(--radius); padding: .6rem .75rem; }
.stat .stat-value { font-size: 1.2rem; font-weight: 700; }
.stat .stat-label { font-size: .8rem; color: var(--muted); }

form.login {
  max-width: 360px; margin: 4rem auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem;
}
form.login label, .field label {
  display: block; font-size: .9rem; color: var(--muted); margin: .75rem 0 .25rem;
}
form.login input, .field input, .field select, .field textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 1rem; background: #fff;
}
form.login button { width: 100%; margin-top: 1rem; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: .25rem; }

.muted { color: var(--muted); font-size: .9rem; }
.mt { margin-top: 1rem; }

.footer {
  max-width: 1200px; margin: 0 auto; padding: 1rem;
  color: var(--muted); font-size: .85rem; display: flex; gap: .5rem;
}

@media (max-width: 600px) {
  .account { margin-left: 0; }
  table.list { display: block; overflow-x: auto; }
}
