/* Ludus — style.css */

:root {
  --black:   #1d1d1d;
  --yellow:  #a6864d;
  --bg:      #f5f3ef;
  --surface: #ffffff;
  --border:  #d6d0c8;
  --muted:   #7a7468;
  --ok:      #3a7d44;
  --err:     #b83232;
  --radius:  3px;
  --nav-h:   3rem;
  --max-w:   56rem;
  --gap:     1.5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TYPOGRAPHY ---- */

h1 { font-size: 1.6rem; font-weight: normal; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; font-weight: normal; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: bold; }

p  { line-height: 1.65; }
a  { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

small { font-size: .8rem; color: var(--muted); }

/* ---- NAV ---- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--black);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 100;
}

.nav-logo {
  font-size: 1.1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--yellow);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links button {
  font: inherit;
  font-size: .85rem;
  color: #ccc;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem .6rem;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links button:hover { color: #fff; background: rgba(255,255,255,.08); }

.nav-logout { display: contents; }

/* ---- MAIN ---- */

main {
  flex: 1;
  margin-top: var(--nav-h);
  padding: var(--gap) 1.25rem 3rem;
  max-width: var(--max-w);
  width: 100%;
  align-self: center;
}

/* ---- FOOTER ---- */

footer {
  text-align: center;
  padding: 1rem;
  font-size: .75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ---- FLASH ---- */

.flash {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: var(--gap);
  font-size: .9rem;
  border-left: 3px solid;
}
.flash-ok  { background: #edf7ef; color: var(--ok);  border-color: var(--ok); }
.flash-err { background: #fdf0f0; color: var(--err); border-color: var(--err); }
.flash-info{ background: #fdf8ef; color: var(--yellow); border-color: var(--yellow); }

/* ---- FORMS ---- */

.field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: 1rem;
}

label {
  font-size: .8rem;
  font-weight: bold;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  font: inherit;
  font-size: .95rem;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--black);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 1px;
  border-color: var(--yellow);
}

textarea { resize: vertical; min-height: 6rem; }

select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7468'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }

/* multi-select */
select[multiple] { background-image: none; padding-right: .7rem; height: auto; min-height: 6rem; }

/* ---- BUTTONS ---- */

.btn {
  display: inline-block;
  font: inherit;
  font-size: .9rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.btn-primary   { background: var(--yellow); color: #fff; border-color: var(--yellow); }
.btn-primary:hover { background: #8f7040; border-color: #8f7040; text-decoration: none; }

.btn-outline   { background: transparent; color: var(--black); border-color: var(--border); }
.btn-outline:hover { border-color: var(--black); text-decoration: none; }

.btn-danger    { background: transparent; color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; text-decoration: none; }

.btn-sm { font-size: .8rem; padding: .3rem .7rem; }

/* ---- PAGE HEADER ---- */

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: var(--gap);
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 { margin: 0; }

/* ---- CARDS ---- */

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

.card + .card { margin-top: .75rem; }

.card-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: .3rem;
}

.card-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .5rem;
}

/* ---- TABLES ---- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th {
  text-align: left;
  font-size: .75rem;
  font-weight: bold;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--border);
}

td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf9f6; }

/* ---- ATTENDANCE BUTTONS ---- */

.attend-group {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

.attend-btn {
  font: inherit;
  font-size: .85rem;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--black);
}

.attend-btn:hover { border-color: var(--yellow); }

.attend-btn[data-val="YES"].active   { background: var(--ok);  color: #fff; border-color: var(--ok); }
.attend-btn[data-val="NO"].active    { background: var(--err); color: #fff; border-color: var(--err); }
.attend-btn[data-val="MAYBE"].active { background: var(--yellow); color: #fff; border-color: var(--yellow); }

/* ---- SUMMARY PILLS ---- */

.pill-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .5rem 0;
}

.pill {
  font-size: .78rem;
  font-weight: bold;
  padding: .2rem .65rem;
  border-radius: 2rem;
  border: 1px solid;
}

.pill-yes   { color: var(--ok);     border-color: var(--ok);     background: #edf7ef; }
.pill-no    { color: var(--err);    border-color: var(--err);    background: #fdf0f0; }
.pill-maybe { color: var(--yellow); border-color: var(--yellow); background: #fdf8ef; }
.pill-none  { color: var(--muted);  border-color: var(--border); background: var(--bg); }

/* ---- STATUS BADGES ---- */

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: bold;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: var(--radius);
}

.badge-active    { background: #edf7ef; color: var(--ok); }
.badge-cancelled { background: #fdf0f0; color: var(--err); }
.badge-deleted   { background: var(--bg); color: var(--muted); }
.badge-admin     { background: #fdf8ef; color: var(--yellow); }

/* ---- SECTION DIVIDER ---- */

.section { margin-top: 2rem; }
.section-title {
  font-size: .75rem;
  font-weight: bold;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* ---- AUTH PAGE ---- */

.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 4rem;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 22rem;
}

.auth-box h1 {
  text-align: center;
  color: var(--yellow);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

/* ---- MISC UTILITIES ---- */

.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.row > * { flex: 1 1 12rem; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }

.text-muted  { color: var(--muted); font-size: .85rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

.cancelled-row td { color: var(--muted); text-decoration: line-through; }

/* ---- RESPONSIVE ---- */

@media (max-width: 540px) {
  .nav-links a,
  .nav-links button { font-size: .78rem; padding: .2rem .4rem; }

  main { padding: var(--gap) .9rem 3rem; }

  .row > * { flex: 1 1 100%; }

  .page-header { flex-direction: column; align-items: flex-start; }
}
