/* ================================================================
   Vereinskasse - Hauptstylesheet (Voll Responsive)
   Design: Seriös, klar, barrierearme Bedienung
   ================================================================ */

@import url('./css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── CSS-Variablen ────────────────────────────────────────────── */
:root {
  --c-primary:     #1a4f8a;
  --c-primary-d:   #133c6b;
  --c-primary-l:   #e8f0fb;
  --c-accent:      #d4820a;
  --c-accent-l:    #fdf3e1;
  --c-success:     #1d7a44;
  --c-success-l:   #e6f5ed;
  --c-danger:      #b91c1c;
  --c-danger-l:    #fde8e8;
  --c-warning:     #b45309;
  --c-warning-l:   #fef3c7;
  --c-info:        #0369a1;
  --c-info-l:      #e0f2fe;
  --c-amber:       #d4820a;

  --c-bg:          #f4f6f9;
  --c-surface:     #ffffff;
  --c-border:      #d1d9e6;
  --c-border-l:    #e8edf5;

  --c-text:        #1a1f2e;
  --c-text-2:      #4b5568;
  --c-text-3:      #8896a8;
  --c-text-inv:    #ffffff;

  --sidebar-w:     250px;
  --header-h:      60px;
  --radius:        6px;
  --radius-lg:     10px;
  --shadow:        0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.05);
  --shadow-md:     0 4px 20px rgba(0,0,0,.10);
  --font:          'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', monospace;
  --trans:         .18s ease;
}

/* ── Dark Mode ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --c-primary:     #4d8fd4;
  --c-primary-d:   #3a7bc2;
  --c-primary-l:   #1a2d45;
  --c-accent:      #f0a030;
  --c-accent-l:    #2a1f08;
  --c-success:     #34c472;
  --c-success-l:   #0d2a1a;
  --c-danger:      #f87171;
  --c-danger-l:    #2a0d0d;
  --c-warning:     #fbbf24;
  --c-warning-l:   #2a1c04;
  --c-info:        #38bdf8;
  --c-info-l:      #082030;
  --c-amber:       #f0a030;

  --c-bg:          #0f1117;
  --c-surface:     #1a1d27;
  --c-border:      #2d3148;
  --c-border-l:    #232640;

  --c-text:        #e2e8f4;
  --c-text-2:      #94a3c0;
  --c-text-3:      #5a6888;
  --c-text-inv:    #0f1117;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────── */
.app-wrapper   { display: flex; min-height: 100vh; }
.sidebar       {
  width: var(--sidebar-w);
  background: var(--c-primary);
  color: var(--c-text-inv);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--trans);
  overflow-y: auto;
}
.main-content  { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar        {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.page-body     { padding: 1.75rem; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-brand-icon {
  width: 38px; height: 38px; background: rgba(255,255,255,.15);
  border-radius: var(--radius); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0;
}
.sidebar-brand-text { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.sidebar-brand-text small { font-weight: 400; font-size: .75rem; opacity: .7; display: block; }

.sidebar-nav  { flex: 1; padding: .75rem 0; }
.nav-section  { padding: .5rem 1rem .25rem; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.nav-item     { display: flex; align-items: center; gap: .65rem; padding: .55rem 1.25rem; color: rgba(255,255,255,.82); text-decoration: none; font-size: .88rem; font-weight: 500; transition: background var(--trans), color var(--trans); border-left: 3px solid transparent; }
.nav-item:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; border-left-color: var(--c-accent); }
.nav-item .icon  { font-size: 1rem; width: 20px; text-align: center; opacity: .85; }
.nav-item-sub { padding-left: 2.6rem; font-size: .82rem; opacity: .88; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; opacity: .7; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar-title   { font-size: 1.05rem; font-weight: 600; flex: 1; }
.topbar-user    { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--c-text-2); }
.topbar-user-avatar { width: 32px; height: 32px; background: var(--c-primary-l); color: var(--c-primary); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.btn-hamburger  { display: none; background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--c-text-2); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-l);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border-l);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card-title  { font-size: 1rem; font-weight: 600; }
.card-body   { padding: 1.25rem; }
.card-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--c-border-l); background: var(--c-bg); }

/* ── Stat-Karten ─────────────────────────────────────────────── */
.stat-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card   { background: var(--c-surface); border: 1px solid var(--c-border-l); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; align-items: flex-start; gap: 1rem; box-shadow: var(--shadow); }
.stat-icon   { width: 46px; height: 46px; border-radius: var(--radius); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.blue   { background: var(--c-primary-l); color: var(--c-primary); }
.stat-icon.green  { background: var(--c-success-l); color: var(--c-success); }
.stat-icon.red    { background: var(--c-danger-l);  color: var(--c-danger);  }
.stat-icon.amber  { background: var(--c-accent-l);  color: var(--c-accent);  }
.stat-icon.info   { background: var(--c-info-l);    color: var(--c-info);    }
.stat-value  { font-size: 1.55rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label  { font-size: .8rem; color: var(--c-text-2); margin-top: .2rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: var(--radius);
  font-family: var(--font); font-size: .88rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: all var(--trans); white-space: nowrap; line-height: 1.4;
}
.btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.btn-primary  { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-d); }
.btn-secondary{ background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); }
.btn-success  { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-danger   { background: var(--c-danger);  color: #fff; border-color: var(--c-danger); }
.btn-warning  { background: var(--c-accent);  color: #fff; border-color: var(--c-accent); }
.btn-ghost    { background: transparent; color: var(--c-text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--c-bg); }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg       { padding: .65rem 1.4rem; font-size: 1rem; }
.btn-icon     { padding: .4rem; width: 34px; height: 34px; }

/* ── Tabellen ────────────────────────────────────────────────── */
.table-wrap   { overflow-x: auto; }
table         { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr      { background: var(--c-bg); }
th            { padding: .65rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-2); border-bottom: 2px solid var(--c-border); white-space: nowrap; }
td            { padding: .65rem 1rem; border-bottom: 1px solid var(--c-border-l); vertical-align: middle; }
tbody tr:hover{ background: var(--c-bg); }
tbody tr:last-child td { border-bottom: none; }
.td-mono      { font-family: var(--font-mono); }
.td-amount    { font-family: var(--font-mono); font-weight: 600; }
.td-actions   { white-space: nowrap; text-align: right; }

/* ── Formulare ───────────────────────────────────────────────── */
.form-grid    { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-group   { display: flex; flex-direction: column; gap: .35rem; }
.form-group.full-width { grid-column: 1 / -1; }
label         { font-size: .85rem; font-weight: 500; color: var(--c-text); }
label .req    { color: var(--c-danger); margin-left: .15rem; }
input, select, textarea {
  width: 100%; padding: .5rem .75rem;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  font-family: var(--font); font-size: .88rem; color: var(--c-text);
  background: var(--c-surface); transition: border-color var(--trans), box-shadow var(--trans);
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26,79,138,.15);
}
input::placeholder, textarea::placeholder { color: var(--c-text-3); }
textarea { resize: vertical; min-height: 80px; }
.input-hint   { font-size: .78rem; color: var(--c-text-3); }
.input-group  { display: flex; }
.input-group input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input-addon { padding: .5rem .75rem; background: var(--c-bg); border: 1px solid var(--c-border); border-left: none; border-radius: 0 var(--radius) var(--radius) 0; font-size: .88rem; color: var(--c-text-2); display: flex; align-items: center; }
select { cursor: pointer; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 20px; font-size: .73rem; font-weight: 600; }
.badge-success { background: var(--c-success-l); color: var(--c-success); }
.badge-danger  { background: var(--c-danger-l);  color: var(--c-danger); }
.badge-warning { background: var(--c-warning-l); color: var(--c-warning); }
.badge-info    { background: var(--c-info-l);    color: var(--c-info); }
.badge-neutral { background: var(--c-bg);        color: var(--c-text-2); border: 1px solid var(--c-border); }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem; border-radius: var(--radius);
  border: 1px solid; margin-bottom: .85rem; font-size: .88rem;
}
.alert-success { background: var(--c-success-l); border-color: #a7d9b8; color: #14532d; }
.alert-error   { background: var(--c-danger-l);  border-color: #fca5a5; color: #7f1d1d; }
.alert-warning { background: var(--c-warning-l); border-color: #fcd34d; color: #78350f; }
.alert-info    { background: var(--c-info-l);    border-color: #7dd3fc; color: #0c4a6e; }
.alert-icon    { font-weight: 700; flex-shrink: 0; }
.alert-close   { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .5; flex-shrink: 0; padding: 0 .2rem; }
.alert-close:hover { opacity: 1; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.page-link  { padding: .35rem .7rem; border: 1px solid var(--c-border); border-radius: var(--radius); font-size: .85rem; color: var(--c-text-2); text-decoration: none; transition: all var(--trans); }
.page-link:hover  { background: var(--c-primary-l); border-color: var(--c-primary); color: var(--c-primary); }
.page-link.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ── Suchleiste / Toolbar ───────────────────────────────────── */
.search-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.search-bar input { max-width: 280px; }
.toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* ── Amount Colors ───────────────────────────────────────────── */
.amount-income  { color: var(--c-success); }
.amount-expense { color: var(--c-danger); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--c-border-l); margin: 1.25rem 0; }

/* ── Chart Container ─────────────────────────────────────────── */
.chart-container { position: relative; height: 260px; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--c-text-2); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ── Print-Seiten ────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: white; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); position: fixed; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .btn-hamburger { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar, .search-bar { flex-direction: column; align-items: stretch; }
  .toolbar-right { margin-left: 0; justify-content: flex-start; }
  .page-body { padding: 1rem; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--c-text-2); }
.text-small  { font-size: .82rem; }
.font-mono   { font-family: var(--font-mono); }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.gap-sm      { gap: .5rem; }
.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; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1       { gap: .5rem; }
.gap-2       { gap: 1rem; }
.w-full      { width: 100%; }
.d-none      { display: none; }