/* assets/css/site.css
 *
 * Shared site styles. Edit the CSS variables at the top to re-skin the whole
 * site. See CUSTOMIZING.md for guidance.
 */

:root {
  --bg: #f7f7f5;
  --fg: #1a1a18;
  --muted: #5f5e5a;
  --border: rgba(0, 0, 0, 0.12);
  --primary: #185fa5;
  --primary-fg: #ffffff;
  --primary-soft: #e8f0f8;
  --danger: #a32d2d;
  --danger-bg: #fcebeb;
  --success: #0f6e56;
  --success-bg: #e6f4ef;
  --info: #1f4d7a;
  --info-bg: #e8f0f8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a18;
    --fg: #f1efe8;
    --muted: #b4b2a9;
    --border: rgba(255, 255, 255, 0.12);
    --primary: #378add;
    --primary-fg: #042c53;
    --primary-soft: #1f3855;
    --danger: #f09595;
    --danger-bg: #501313;
    --success: #5fc1a5;
    --success-bg: #143027;
    --info: #6cb0e8;
    --info-bg: #1a2c40;
  }
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

main.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  min-height: 60vh;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: .92rem;
}
.site-nav a { color: var(--fg); }
.nav-user { color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: .9rem;
}

/* Card */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card-narrow {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 1.6rem; font-weight: 500; }
h2 { font-size: 1.3rem; font-weight: 500; }
h3 { font-size: 1.05rem; font-weight: 600; }
p.muted { color: var(--muted); }

/* Forms */
.form-row {
  display: flex; flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}
.form-row > label {
  font-size: .85rem; color: var(--muted);
}
.form-row > input, .form-row > select, .form-row > textarea {
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  font-size: 1rem;
}
.form-row > input:focus, .form-row > select:focus, .form-row > textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.form-actions {
  display: flex; gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

button.btn, .btn {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-fg);
  border: 0;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .95rem;
  text-decoration: none;
}
button.btn:hover, .btn:hover { filter: brightness(1.05); text-decoration: none; }
button.btn:disabled { opacity: .55; cursor: not-allowed; }

button.btn-secondary, .btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
button.btn-danger, .btn-danger {
  background: var(--danger);
  color: #fff;
}
button.btn-link, .btn-link {
  background: none; border: 0; padding: 0;
  color: var(--primary);
  text-decoration: underline;
  font-size: inherit;
}

/* Alerts */
.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 1rem;
  font-size: .95rem;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info); }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-weight: 600;
  font-size: .85rem;
  color: var(--muted);
  background: rgba(0,0,0,.02);
}

/* Badges */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  background: var(--border);
  color: var(--fg);
}
.badge-admin       { background: #d3e8ff; color: #1f4d7a; }
.badge-coordinator { background: #ffe5cc; color: #8a4515; }
.badge-user        { background: #e0e0e0; color: #333; }
.badge-viewer      { background: #f0f0f0; color: #555; }

@media (prefers-color-scheme: dark) {
  .badge-admin       { background: #1f3855; color: #c8defc; }
  .badge-coordinator { background: #4a2e16; color: #f4cea4; }
  .badge-user        { background: #333; color: #e0e0e0; }
  .badge-viewer      { background: #2a2a28; color: #aaa; }
}
