/* wi3 Mitgliederverwaltung */
:root {
  --navy-900: #0e2440;
  --navy-800: #14325a;
  --navy-700: #1c416f;
  --navy-50:  #eef2f7;

  --gray-950: #111418;
  --gray-900: #1a1e24;
  --gray-700: #3d4450;
  --gray-600: #555d6b;
  --gray-500: #6e7685;
  --gray-400: #9aa1ad;
  --gray-300: #cfd4db;
  --gray-200: #e2e5ea;
  --gray-100: #eff1f4;
  --gray-50:  #f7f8fa;
  --white:    #ffffff;

  --green:  #1f8a4c;
  --blue:   #4a5fc1;
  --amber:  #b7791f;
  --red:    #c2372c;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --sidebar: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-900); }
h1, h2 { margin: 0; color: var(--gray-950); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h2 { font-size: 14px; font-weight: 600; }
.icon { flex: none; display: block; }
.text-muted { color: var(--gray-500); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.strong { font-weight: 600; color: var(--gray-950); }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column;
  background: var(--navy-900); color: #c9d3e0;
  padding: 20px 12px 12px;
}
.main { min-height: 100vh; }
/* Dunkler Streifen hinter der Sidebar, auch bei sehr langen Seiten */
body.app { background: linear-gradient(to right, var(--navy-900) var(--sidebar), var(--gray-50) var(--sidebar)); }
body.app .main { margin-left: var(--sidebar); }
.container { max-width: 1120px; margin: 0 auto; padding: 32px 40px 64px; }

.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; color: var(--white); }
.logo:hover { color: var(--white); }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px;
  background: var(--white); color: var(--navy-900); font-weight: 700; font-size: 13px; letter-spacing: -.02em;
}
.logo-text { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; line-height: 1.2; }
.logo-text small { font-weight: 400; font-size: 12px; color: #93a3b8; }
.logo-dark { color: var(--gray-950); padding: 0 0 24px; }
.logo-dark .logo-mark { background: var(--navy-800); color: var(--white); }
.logo-dark .logo-text small { color: var(--gray-500); }

.nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: #b4c0d0; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.06); color: var(--white); }
.nav a.active { background: rgba(255,255,255,.1); color: var(--white); }

.account {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.08);
}
.account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.account-text strong { color: var(--white); font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text span { font-size: 12px; color: #93a3b8; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); color: #93a3b8; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--white); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.sub { margin: 4px 0 0; color: var(--gray-500); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--gray-500); font-weight: 500; font-size: 13px; }
.back:hover { color: var(--gray-900); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--gray-300); background: var(--white); color: var(--gray-900);
  font: 500 14px/1 var(--font); cursor: pointer; box-shadow: var(--shadow); white-space: nowrap;
}
.btn:hover { background: var(--gray-50); color: var(--gray-950); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 1px; }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: var(--white); }
.btn-primary:hover { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.btn-ms { width: 100%; height: 42px; margin-top: 8px; }

input[type=text], input[type=search], input:not([type]), select {
  height: 36px; padding: 0 10px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  background: var(--white); color: var(--gray-900); font: 14px var(--font); box-shadow: var(--shadow);
}
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-800); flex: none; }

/* ---------- Tabs & toolbar ---------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--gray-200); margin-bottom: 16px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; margin-bottom: -1px;
  color: var(--gray-500); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--gray-900); }
.tab.active { color: var(--gray-950); border-bottom-color: var(--navy-800); }
.count { padding: 0 7px; border-radius: 10px; background: var(--gray-100); color: var(--gray-600); font-size: 12px; line-height: 20px; }
.tab.active .count { background: var(--navy-50); color: var(--navy-800); }

.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; display: flex; }
.search .icon { position: absolute; left: 10px; top: 10px; color: var(--gray-400); }
.search input { width: 100%; padding-left: 34px; }
.toolbar select { min-width: 180px; }

/* ---------- Panels ---------- */
.panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.panel-head p { margin: 2px 0 0; color: var(--gray-500); font-size: 13px; }
.panel-body { padding: 16px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 0 0 8px 8px; font-size: 13px; }
.panel-actions { display: flex; justify-content: flex-end; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.narrow { max-width: 640px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table col.c-name { width: 36%; }
.table col.c-status { width: 17%; }
.table col.c-teams { width: 26%; }
.table col.c-lic { width: 21%; }
.table col.c-chev { width: 44px; }
.table th {
  text-align: left; padding: 10px 16px; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); color: var(--gray-500);
  font-size: 12px; font-weight: 500;
}
.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child { border-radius: 0 8px 0 0; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--gray-50); }
.table tr.empty td { padding: 40px 16px; text-align: center; color: var(--gray-500); }
.table-compact td { padding: 9px 16px; }
.col-chev { width: 36px; color: var(--gray-400); }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.person-name { color: var(--gray-950); font-weight: 500; }
.person-name:hover { color: var(--navy-700); }
.person-name, .person-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-mail { color: var(--gray-500); font-size: 13px; }
.cell-hint { margin-top: 2px; color: var(--gray-500); font-size: 12px; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-50); color: var(--navy-800);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; background: rgba(255,255,255,.12); color: var(--white); }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }

.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: var(--gray-700); white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); }
.status-aktiv .dot { background: var(--green); }
.status-alumni .dot { background: var(--blue); }
.status-extern .dot { background: var(--amber); }
.status-inaktiv .dot { background: var(--red); }
.status-inaktiv { color: var(--red); }

/* ---------- Member page ---------- */
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-text { flex: 1; min-width: 0; }
.profile .status { padding: 5px 12px; border: 1px solid var(--gray-200); border-radius: 999px; background: var(--white); }

.options { display: flex; flex-direction: column; }
.option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--gray-100); cursor: pointer;
}
.option:last-child { border-bottom: 0; }
.option:hover { background: var(--gray-50); }
.option-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.4; }
.option-text strong { font-weight: 500; color: var(--gray-950); }
.option-text span { color: var(--gray-500); font-size: 13px; }
.option-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--gray-500); font-size: 12px; white-space: nowrap; }
.option.is-locked { cursor: default; }
.option.is-locked:hover { background: transparent; }
.option.is-locked .option-text strong { color: var(--gray-500); }
.option:has(input[type=radio]:checked) { background: var(--navy-50); }

dl { margin: 0; padding: 4px 20px 8px; }
dl > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
dl > div:last-child { border-bottom: 0; }
dt { color: var(--gray-500); font-size: 12px; }
dd { margin: 0; color: var(--gray-900); word-break: break-word; }
.creds dd { font-size: 15px; }
.creds dd.strong { font-size: 17px; letter-spacing: .04em; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-weight: 500; font-size: 13px; color: var(--gray-700); }
.field input { width: 100%; }
.summary { position: sticky; top: 24px; }

/* ---------- Notices ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius);
  border: 1px solid; font-size: 13px; line-height: 1.5;
}
.notice .icon { margin-top: 1px; }
.stack > .notice { margin-bottom: 0; }
.notice-success { background: #f0f8f3; border-color: #c6e5d1; color: #17603a; }
.notice-error   { background: #fdf3f2; border-color: #f2cdc9; color: #9b2b22; }
.notice-warning { background: #fdf8ee; border-color: #efdcb3; color: #7a5212; }

/* ---------- Sign-in ---------- */
body.bare { background: var(--gray-100); }
.auth { min-height: calc(100vh - 96px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.auth-card {
  width: 100%; max-width: 400px; padding: 32px;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .06);
}
.auth-card .sub { margin-bottom: 20px; }
.auth-card .actions-row { margin-top: 4px; }
.auth-foot { margin-top: 20px; color: var(--gray-500); font-size: 12px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hide-md, col.hide-md { display: none; }
  .table col.c-name { width: 45%; }
  .table col.c-status { width: 22%; }
  .table col.c-teams { width: auto; }
  .split { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 860px) {
  body.app .main { margin-left: 0; }
  body.app { background: var(--gray-50); }
  .table col.c-name { width: auto; }
  .table col.c-status { width: 132px; }
  .table col.c-chev { width: 32px; }
  .table td, .table th { padding-left: 12px; padding-right: 8px; }
  .person { gap: 10px; }
  .status-inaktiv { white-space: normal; }
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 16px; }
  .logo { padding: 0; }
  .logo-text { display: none; }
  .nav { flex-direction: row; border: 0; padding: 0; overflow-x: auto; }
  .nav a span { display: none; }
  .account { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account-text { display: none; }
  .container { padding: 24px 16px 48px; }
  .hide-sm, col.hide-sm { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
}
