/* CampusFlow - shared base stylesheet.
   Pages link this first and keep only page-specific rules in their own <style>. */

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7c93;
  --accent: #1b7f79;
  --accent-dark: #13625e;
  --border: #e1e7ee;
  --border-strong: #dbe5ef;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
}

h1 { font-size: 20px; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 0 0 8px; }
h3 { font-size: 13.5px; margin: 0 0 8px; }

/* Layout */
.wrap {
  max-width: 1420px;
  margin: 24px auto;
  padding: 0 16px 40px;
}
.wrap--narrow { max-width: 900px; }
.wrap--mid { max-width: 1100px; }
.wrap--wide { max-width: 1520px; }

/* Topline: h1 left, badges, spacer, action buttons right.
   Button order convention: [page actions] [primary action] Dashboard, Abmelden. */
.topline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.topline h1 { font-size: 18px; margin: 0; }
.spacer { flex: 1 1 auto; }
.page-sub { margin: -6px 0 12px; color: var(--muted); font-size: 12.5px; }

.badge {
  display: inline-block;
  font-size: 11.5px;
  background: #e6f4f1;
  color: var(--accent-dark);
  border: 1px solid #c6e7e2;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
}
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #962d22; }

/* Panels & alerts */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .06);
}
.alert { padding: 9px 12px; border-radius: 8px; margin-top: 10px; font-size: 12.5px; border: 1px solid transparent; }
.ok, .alert-success { background: #e8f7ed; color: #17643d; border-color: #b8e7c6; }
.err, .alert-error, .alert-danger { background: #fdeaea; color: #922b2b; border-color: #f3c2c2; }

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: #415366; margin-bottom: 4px; }
input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
}
input[type="checkbox"], input[type="radio"] { width: auto; }

/* Tables (manage-page style; pages with special tables override locally) */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; padding: 7px 9px; border-bottom: 2px solid var(--border-strong); background: #f1f5f9; white-space: nowrap; }
td { padding: 6px 9px; border-bottom: 1px solid #edf2f7; vertical-align: top; }
tr.hidden-by-filter { display: none; }

.muted { color: var(--muted); }

/* Shared modal (module edit popups etc.) */
.cf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.cf-modal {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .3);
  padding: 16px;
  width: min(440px, 92vw);
  max-height: 88vh;
  overflow: auto;
}
.cf-modal h3 { margin: 0 0 10px; font-size: 14px; }
.cf-modal .cf-modal-field { margin-bottom: 8px; }
.cf-modal .cf-modal-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.cf-modal .cf-modal-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
