/* YouXperience Buchhaltung — Design System */
:root {
  --brand-primary: #6C3FC5;    /* YouXperience Lila */
  --brand-dark: #4A2A8A;
  --brand-light: #EDE7F6;
  --accent-green: #2E7D32;
  --accent-red: #C62828;
  --accent-orange: #E65100;
  --bg: #F8F6FF;
  --surface: #FFFFFF;
  --border: #E0D7F5;
  --text: #1A1035;
  --text-muted: #6B6080;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(108,63,197,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--brand-primary);
  color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 100;
}
.sidebar-logo { padding: 24px 20px 16px; font-size: 17px; font-weight: 700;
  letter-spacing: -0.3px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.sidebar-logo span { opacity: 0.65; font-weight: 400; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,0.85);
  text-decoration: none; font-size: 13.5px; border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.15); color: #fff;
}
.sidebar-nav .nav-section {
  padding: 16px 20px 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; opacity: 0.5;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.15); }
.sidebar-footer a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 12px; }

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.content { padding: 24px 28px; flex: 1; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 6px; }
.card-value { font-size: 28px; font-weight: 700; color: var(--brand-primary); }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alert-error { background: #FFEBEE; border: 1px solid #FFCDD2; color: var(--accent-red); }
.alert-success { background: #E8F5E9; border: 1px solid #C8E6C9; color: var(--accent-green); }
.alert-warning { background: #FFF3E0; border: 1px solid #FFE0B2; color: var(--accent-orange); }
.alert-info { background: var(--brand-light); border: 1px solid var(--border); color: var(--brand-dark); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 8px; border: none; cursor: pointer; font-size: 13px;
  font-weight: 500; text-decoration: none; transition: all 0.15s; }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--brand-light); color: var(--brand-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #FFEBEE; color: var(--accent-red); border: 1px solid #FFCDD2; }
.btn-danger:hover { background: #FFCDD2; }
.btn-success { background: #E8F5E9; color: var(--accent-green); border: 1px solid #C8E6C9; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--text);
  transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(108,63,197,0.1); }
select.form-control { cursor: pointer; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted);
  border-bottom: 2px solid var(--border); background: var(--bg); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-green { background: #E8F5E9; color: var(--accent-green); }
.badge-red { background: #FFEBEE; color: var(--accent-red); }
.badge-orange { background: #FFF3E0; color: var(--accent-orange); }
.badge-purple { background: var(--brand-light); color: var(--brand-primary); }
.badge-grey { background: #EEEEEE; color: #666; }

/* ── MwSt Progress Bar ── */
.progress-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 5px; transition: width 0.3s;
  background: var(--brand-primary); }
.progress-fill.warn { background: var(--accent-orange); }
.progress-fill.danger { background: var(--accent-red); }

/* ── Section headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; }
.section-header h2 { font-size: 16px; font-weight: 600; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg); }
.login-box { background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 360px; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h2 { font-size: 22px; color: var(--brand-primary); font-weight: 700; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Utilities ── */
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-purple { color: var(--brand-primary); }
.font-bold { font-weight: 600; }
.w-full { width: 100%; }
