/* verein-app.css v2 — central layout, sidebar, i18n, responsive */
:root {
  --css-version: 4;
  --bg: #f4f1ea;
  --card: #fffdf8;
  --ink: #1c1916;
  --muted: #5c564e;
  --line: #e4ddd2;
  --accent: #1f4d3a;
  --accent-soft: #2a6550;
  --accent-2: #c45c26;
  --danger: #9b2335;
  --ok: #1f4d3a;
  --warn: #8a5a12;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(28, 25, 22, 0.06);
  --font: "Segoe UI", system-ui, sans-serif;
  --sidebar-w: 15.5rem;
  --topbar-h: 3.4rem;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--accent); }
img { max-width: 100%; }

/* —— Public / simple header (marketing, portal login, install) —— */
.top {
  background: var(--accent);
  color: #fff;
}
.top a { color: #fff; text-decoration: none; }
.top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: .02em; display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark {
  width: 1.85rem;
  height: 2rem;
  object-fit: contain;
  display: block;
  flex: none;
}
.nav { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .92rem; align-items: center; }
.nav a { opacity: .9; }
.nav a:hover, .nav a.active, .nav a.is-active { opacity: 1; text-decoration: underline; }
.spacer { flex: 1; }

/* Public site header: light, so the entry page can carry the colour itself. */
.top-light {
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-light a { color: var(--ink); }
.top-light .top-inner { gap: .75rem; }
.top-light .brand { color: var(--ink); font-size: 1.05rem; }
.top-light .nav-lang {
  gap: .1rem;
  font-size: .8rem;
  letter-spacing: .03em;
}
.top-light .nav-lang a {
  color: var(--muted);
  padding: .2rem .4rem;
  border-radius: 6px;
}
.top-light .nav-lang a:hover { background: var(--bg); text-decoration: none; }
.top-light .nav-lang a.is-active {
  color: var(--accent);
  font-weight: 700;
  background: var(--bg);
  text-decoration: none;
}
.top-light .nav-actions { gap: .5rem; align-items: center; }
.top-light .nav-plain { color: var(--muted); font-size: .9rem; }
.top-light .nav-plain:hover { color: var(--accent); }
.user { font-size: .85rem; opacity: .9; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }

/* —— App / Superadmin shell with sidebar —— */
body.has-sidebar {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}
.sidebar a { color: #fff; text-decoration: none; }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 1.1rem 1.15rem .85rem;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .65rem 0 1rem;
  gap: .1rem;
}
.sidebar-nav a,
.sidebar-nav .nav-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .48rem 1.15rem;
  font-size: .92rem;
  opacity: .88;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.sidebar-nav a.is-active {
  opacity: 1;
  background: rgba(255,255,255,.12);
  border-left-color: #f4e4c8;
  font-weight: 600;
}
.sidebar-nav .nav-sub {
  padding-left: 1.7rem;
  font-size: .86rem;
  opacity: .78;
}
.sidebar-nav .nav-lock { opacity: .55; cursor: default; }
.sidebar-nav .pill-mini {
  font-size: .65rem;
  padding: .1rem .35rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.sidebar-foot {
  margin-top: auto;
  padding: .85rem 1.15rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.sidebar-foot .user { display: block; }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-content {
  padding: 1.25rem 1.4rem 2.5rem;
  max-width: 1100px;
  width: 100%;
}
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem .6rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.sidebar-backdrop {
  display: none;
}

/* Language switcher */
.lang-switch {
  display: inline-flex;
  gap: .15rem;
  align-items: center;
}
.lang-switch button {
  background: transparent;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: .2rem .4rem;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  opacity: .7;
}
.lang-switch button:hover { opacity: 1; }
.lang-switch button.is-active {
  opacity: 1;
  border-color: currentColor;
}
.top .lang-switch button,
.sidebar .lang-switch button { color: #fff; }
.app-topbar .lang-switch button { color: var(--ink); }

.flash {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 1rem;
}
.flash-success { background: #e7f3ec; color: var(--ok); }
.flash-error { background: #fdecee; color: var(--danger); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat { font-size: 1.8rem; font-weight: 700; }
label { display: block; font-size: .85rem; margin: .55rem 0 .2rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}
.page-head h1 { margin-bottom: 0; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  border: 0;
  padding: .55rem .9rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}
.btn-outline {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid var(--line);
}
.btn-outline:hover { border-color: var(--accent); }
.btn-lg { padding: .72rem 1.25rem; font-size: 1.02rem; }
.btn-danger { background: var(--danger); }
.btn-warn { background: var(--accent-2); }
.btn[disabled], .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill {
  display: inline-block;
  font-size: .75rem;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: #eee8dc;
}
.pill-ok { background: #dcefe4; }
.pill-warn { background: #f7e6c8; }
.pill-bad { background: #f8d7dc; }
.hero { padding: 2.5rem 1.25rem 1rem; max-width: 720px; margin: 0 auto; }
.footer {
  max-width: 1100px;
  margin: 2rem auto 1rem;
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  font-size: .85rem;
}
.footer a { color: var(--muted); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.filters input, .filters select { width: auto; min-width: 10rem; }
.notice {
  background: #fff4e5;
  border: 1px solid #efd4a8;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}
.billing-plans {
  border: 0;
  padding: 0;
  margin: 1rem 0;
}
.billing-plans legend { font-weight: 700; margin-bottom: .6rem; }
.billing-plan {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .8rem;
  margin-bottom: .55rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.billing-plan:has(input:checked) {
  border-color: var(--accent);
  background: #edf6f0;
  box-shadow: 0 0 0 2px rgba(31, 77, 58, .08);
}
.billing-plan input { margin-top: .25rem; }
.billing-plan span span, .billing-plan small { display: block; color: var(--muted); }
.request-list { display: grid; gap: .8rem; }
.request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  gap: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.request-item p { margin-bottom: 0; }
.request-actions { display: flex; gap: .5rem; align-items: flex-end; }
.request-actions form:first-child { flex: 1; }
.request-actions form:last-child { padding-bottom: .05rem; }
.request-actions label { margin-top: 0; }
.request-actions input { min-width: 0; }
.inline { display: inline; width: auto; }
form.inline-form { display: inline; }
/* Receipt upload sits inside a journal cell, so it must not stretch the row. */
td form.inline-form input[type="file"] {
  display: inline-block;
  width: auto;
  max-width: 11rem;
  margin: 0 .35rem .25rem 0;
  padding: .2rem;
  font-size: .78rem;
}
.help { font-size: .8rem; color: var(--muted); font-weight: 400; margin: 0 0 .35rem; }
.shortcut-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.shortcut-card:hover { border-color: var(--accent); }
.shortcut-card h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.iban-input { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.pw-wrap { position: relative; }
.pw-wrap .pw-input { padding-right: 2.7rem; }
.pw-toggle {
  position: absolute;
  right: .3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
}
.pw-toggle:hover, .pw-toggle:focus-visible {
  color: var(--ink);
  background: rgba(28, 25, 22, .06);
}
.pw-toggle .pw-icon { display: flex; }
.pw-toggle .pw-icon-hide { display: none; }
.pw-toggle.is-on .pw-icon-show { display: none; }
.pw-toggle.is-on .pw-icon-hide { display: flex; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.amount-in { color: var(--ok); }
.amount-out { color: var(--danger); }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  body.has-sidebar { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: none;
    max-height: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(28, 25, 22, .25);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 22, .4);
    z-index: 30;
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .app-content { padding: 1rem; }
}

@media (max-width: 700px) {
  .row-2 { grid-template-columns: 1fr; }
  table { font-size: .85rem; }
  .filters input, .filters select { width: 100%; min-width: 0; }
  .hero { padding: 1.5rem 1rem 0; }
  h1 { font-size: 1.35rem; }
  .request-item { grid-template-columns: 1fr; }
  .request-actions { align-items: stretch; flex-direction: column; }
}
