:root{
  --navy: #0B2E59;
  --navy-deep: #071F3D;
  --blue: #2563EB;
  --blue-light: #E8F0FE;
  --sky: #EFF5FF;
  --white: #FFFFFF;
  --ink: #10233F;
  --muted: #5B7089;
  --border: #E1E9F3;
  --ok: #16A085;
  --warn: #D9822B;
  --danger: #E04E4E;
  --radius: 14px;
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family: var(--font-body);
  background: var(--sky);
  color: var(--ink);
  display:flex;
  min-height:100vh;
}
a{color:inherit;}

/* ---------- SIDEBAR ---------- */
.sidebar{
  width:260px; min-width:260px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  display:flex; flex-direction:column;
  padding:24px 18px;
  position:sticky; top:0; height:100vh;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding:0 8px 24px 8px;
  border-bottom:1px solid rgba(255,255,255,0.12);
  margin-bottom:20px;
}
.brand-mark{
  width:34px; height:34px; border-radius:9px;
  background: linear-gradient(135deg, #4F8FFF, #1D4ED8);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-display); font-weight:800; font-size:16px;
  flex-shrink:0;
}
.brand-text{ font-family: var(--font-display); font-weight:700; font-size:16px; letter-spacing:0.2px; }
.brand-text span{ display:block; font-family: var(--font-body); font-weight:400; font-size:11px; color: rgba(255,255,255,0.55); margin-top:1px; }

nav{flex:1; overflow-y:auto;}
.nav-group{margin-bottom:22px;}
.nav-label{
  font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
  color: rgba(255,255,255,0.4); padding:0 10px 8px 10px; font-weight:600;
}
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:10px;
  color: rgba(255,255,255,0.78); text-decoration:none;
  font-size:14.5px; font-weight:500; margin-bottom:2px; position:relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover{ background: rgba(255,255,255,0.07); color: var(--white); }
.nav-item.active{ background: rgba(255,255,255,0.1); color: var(--white); }
.nav-item.active::before{
  content:""; position:absolute; left:-18px; top:8px; bottom:8px; width:4px;
  border-radius:0 4px 4px 0; background: linear-gradient(180deg, #6EA8FF, #2563EB);
}
.nav-icon{ width:18px; height:18px; flex-shrink:0; opacity:0.9; }
.nav-badge{ margin-left:auto; background: #2563EB; color:white; font-size:11px; font-weight:700; padding:1px 7px; border-radius:20px; }

.sidebar-footer{
  border-top:1px solid rgba(255,255,255,0.12); padding-top:16px;
  display:flex; align-items:center; gap:10px;
}
.avatar{
  width:36px; height:36px; border-radius:50%;
  background: linear-gradient(135deg, #FFB86B, #FF7676);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:13px; color:white; flex-shrink:0;
}
.user-meta{font-size:13px; line-height:1.3;}
.user-meta strong{display:block; font-weight:600;}
.user-meta span{color: rgba(255,255,255,0.5); font-size:12px;}

.mobile-toggle{
  display:none; position:fixed; top:14px; left:14px; z-index:200;
  width:40px; height:40px; border-radius:10px; border:1px solid var(--border);
  background:white; color:var(--navy); align-items:center; justify-content:center; cursor:pointer;
}

/* ---------- MAIN ---------- */
.main{ flex:1; display:flex; flex-direction:column; min-width:0; }
.topbar{
  background: var(--white); border-bottom:1px solid var(--border);
  padding:16px 32px; display:flex; align-items:center; gap:20px;
  position:sticky; top:0; z-index:10;
}
.topbar-actions{ margin-left:auto; display:flex; align-items:center; gap:16px; }
.content{ padding:32px; max-width:1180px; width:100%; }

.page-header{ display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:26px; flex-wrap:wrap; gap:14px; }
.eyebrow{ font-size:12.5px; color: var(--blue); font-weight:600; text-transform:uppercase; letter-spacing:0.06em; margin-bottom:6px; }
h1{ font-family: var(--font-display); font-size:28px; font-weight:800; color: var(--navy-deep); }
h2{ font-family: var(--font-display); font-size:18px; font-weight:700; color: var(--navy-deep); }
.page-header p{color: var(--muted); font-size:14.5px; margin-top:6px;}

/* ---------- BUTTONS ---------- */
.btn-primary, .btn-secondary, .btn-danger{
  border:none; padding:11px 20px; border-radius:10px; font-weight:600; font-size:14px;
  cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px;
}
.btn-primary{
  background: linear-gradient(135deg, #2563EB, #1849C4); color:white;
  box-shadow: 0 6px 16px rgba(37,99,235,0.25);
}
.btn-primary:hover{ filter:brightness(1.05); }
.btn-secondary{ background: var(--sky); border:1px solid var(--border); color:var(--ink); }
.btn-secondary:hover{ background: var(--blue-light); }
.btn-danger{ background: #FDEEEE; color:var(--danger); border:1px solid #F6D3D3; }
.btn-danger:hover{ background:#FBDCDC; }
.btn-sm{ padding:7px 12px; font-size:13px; border-radius:8px; }

/* ---------- STAT CARDS ---------- */
.stats-row{ display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom:28px; }
.stat-card{ background: var(--white); border:1px solid var(--border); border-radius: var(--radius); padding:18px 20px; text-decoration:none; color:inherit; display:block; transition:box-shadow .15s ease, transform .15s ease; }
.stat-card:hover{ box-shadow:0 8px 20px rgba(11,46,89,0.08); transform:translateY(-1px); }
.stat-card .label{font-size:13px; color: var(--muted); margin-bottom:8px;}
.stat-card .value{font-family: var(--font-display); font-size:24px; font-weight:800; color: var(--navy-deep);}
.stat-card .trend{font-size:12.5px; margin-top:6px; font-weight:600;}
.trend.up{color: var(--ok);}
.trend.warn{color: var(--warn);}
.trend.danger{color: var(--danger);}

/* ---------- LAYOUT GRID / CARDS ---------- */
.grid-2{ display:grid; grid-template-columns: 2fr 1fr; gap:20px; align-items:start; }
.card{ background: var(--white); border:1px solid var(--border); border-radius: var(--radius); padding:22px; margin-bottom:20px; }
.card-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:12px; flex-wrap:wrap; }
.card-header h2{ font-family: var(--font-display); font-size:16px; font-weight:700; color: var(--navy-deep); }
.card-header a{ font-size:13px; color: var(--blue); text-decoration:none; font-weight:600; }

/* ---------- ALERTS / FLASH ---------- */
.alert{ padding:12px 16px; border-radius:10px; margin-bottom:18px; font-size:14px; border:1px solid transparent; }
.alert-success{ background:#E7F7F1; color:#0F6B54; border-color:#BFEBDC; }
.alert-error{ background:#FDEEEE; color:#B91C1C; border-color:#F6D3D3; }
.alert-info{ background: var(--sky); color: var(--navy); border-color: var(--border); }

/* ---------- FORMS ---------- */
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-group{ margin-bottom:16px; display:flex; flex-direction:column; gap:6px; }
.form-group.full{ grid-column: 1 / -1; }
label{ font-size:13px; font-weight:600; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
select, textarea{
  padding:10px 12px; border:1px solid var(--border); border-radius:10px;
  font-family: var(--font-body); font-size:14px; color: var(--ink); background: var(--white);
  width:100%;
}
input:focus, select:focus, textarea:focus{ outline:none; border-color: var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,0.12); }
textarea{ resize:vertical; min-height:110px; }
.form-hint{ font-size:12px; color: var(--muted); }
.form-actions{ display:flex; gap:10px; margin-top:8px; }
.checkbox-row{ display:flex; align-items:center; gap:8px; }
.checkbox-row input{ width:auto; }

/* ---------- TABLES ---------- */
table{ width:100%; border-collapse:collapse; font-size:14px; }
thead th{
  text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:0.04em;
  color: var(--muted); font-weight:600; padding:10px 12px; border-bottom:1px solid var(--border);
}
tbody td{ padding:12px; border-bottom:1px solid var(--border); vertical-align:middle; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr:hover{ background: var(--sky); }
.table-wrap{ overflow-x:auto; }
.table-actions{ display:flex; gap:8px; }

/* ---------- BADGES ---------- */
.badge{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.badge-offen{ background:#FDF1E4; color:#B4620F; }
.badge-abgeschlossen{ background:#E7F7F1; color:#0F6B54; }
.badge-admin{ background:#EAE6FF; color:#5B3FE0; }
.badge-neutral{ background: var(--sky); color: var(--muted); }
.badge-dot{ width:7px; height:7px; border-radius:50%; display:inline-block; }

/* ---------- TABS / FILTERS ---------- */
.filter-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:20px; }
.filter-bar input, .filter-bar select{ width:auto; min-width:160px; }
.tabs{ display:flex; gap:6px; border-bottom:1px solid var(--border); margin-bottom:20px; }
.tab{ padding:10px 16px; font-size:14px; font-weight:600; color: var(--muted); text-decoration:none; border-bottom:2px solid transparent; }
.tab.active{ color: var(--blue); border-bottom-color: var(--blue); }

/* ---------- LOGIN ---------- */
.login-page{ min-height:100vh; width:100%; display:flex; align-items:center; justify-content:center; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); }
.login-card{ background:white; border-radius: var(--radius); padding:38px 36px; width:100%; max-width:380px; box-shadow:0 20px 60px rgba(0,0,0,0.25); }
.login-card .brand-mark{ margin:0 auto 16px auto; }
.login-card h1{ font-size:22px; text-align:center; margin-bottom:4px; }
.login-card p.sub{ text-align:center; color:var(--muted); font-size:13.5px; margin-bottom:24px; }

/* ---------- COMMENTS ---------- */
.comment{ padding:14px 0; border-bottom:1px solid var(--border); display:flex; gap:12px; }
.comment:last-child{ border-bottom:none; }
.comment-body{ flex:1; }
.comment-meta{ font-size:12px; color: var(--muted); margin-bottom:4px; }
.comment-meta strong{ color: var(--ink); }
.comment-text{ font-size:14px; line-height:1.5; }

.detail-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:14px 24px; margin-bottom:10px; }
.detail-item .label{ font-size:12px; color: var(--muted); margin-bottom:3px; text-transform:uppercase; letter-spacing:0.04em; }
.detail-item .value{ font-size:14.5px; font-weight:600; }

@media (max-width: 900px){
  .sidebar{ position:fixed; left:-260px; transition:left 0.2s ease; z-index:100; }
  .sidebar.open{ left:0; }
  .mobile-toggle{ display:flex; }
  .grid-2{ grid-template-columns:1fr; }
  .stats-row{ grid-template-columns:1fr 1fr; }
  .form-grid{ grid-template-columns:1fr; }
  .detail-grid{ grid-template-columns:1fr; }
  .content{ padding:20px; padding-top:70px; }
}
