/* ============================================================
   Kanzlei Stoll & Partner – Portal CSS
   Farben: Dunkelblau #1D3557, Gold #B87B2A, Weiß #F8F9FA
   ============================================================ */

:root {
  --navy:       #1D3557;
  --navy-dark:  #14263E;
  --navy-light: #2A4A70;
  --gold:       #B87B2A;
  --gold-light: #D4952F;
  --gold-pale:  #FAF0DC;
  --white:      #FFFFFF;
  --bg:         #F4F6F9;
  --bg-card:    #FFFFFF;
  --text:       #212529;
  --text-muted: #6C757D;
  --border:     #DEE2E6;
  --sidebar-w:  240px;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ---- Sidebar ------------------------------------------ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex; flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-name {
  color: var(--white); font-weight: 700; font-size: 14px; line-height: 1.2;
}
.sidebar-sub {
  color: rgba(255,255,255,.5); font-size: 10px; letter-spacing: .05em;
  text-transform: uppercase;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--white);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name  { color: var(--white); font-size: 13px; font-weight: 600; }
.user-role  { color: rgba(255,255,255,.5); font-size: 11px; }

.nav-list { list-style: none; padding: 10px 0; flex: 1; }
.nav-separator { border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active {
  background: rgba(184,123,42,.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.nav-item.logout { color: rgba(255,255,255,.5); }
.nav-item.logout:hover { color: #FF8080; background: rgba(255,0,0,.1); }

.sidebar-footer { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.08); }

/* ---- Main Wrapper ------------------------------------- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.menu-toggle {
  display: none; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--text);
}
.page-title {
  font-size: 17px; font-weight: 600; color: var(--navy);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content { padding: 24px; flex: 1; }

/* ---- Cards -------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 15px; font-weight: 600; color: var(--navy); }
.card-body { padding: 20px; }

/* ---- Stat Cards --------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; fill: var(--white); }
.stat-icon.navy  { background: var(--navy); }
.stat-icon.gold  { background: var(--gold); }
.stat-icon.green { background: #28A745; }
.stat-icon.red   { background: #DC3545; }
.stat-icon.blue  { background: #007BFF; }
.stat-num   { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Tabellen ----------------------------------------- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #F8F9FA;
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: #F8F9FB; }
tbody tr:last-child td { border-bottom: none; }

/* ---- Formulare ---------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(29,53,87,.1);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-full { grid-column: 1/-1; }

/* ---- Buttons ------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

.btn-primary   { background: var(--navy);  color: var(--white); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-gold      { background: var(--gold);  color: var(--white); }
.btn-gold:hover { background: var(--gold-light); }
.btn-success   { background: #28A745; color: var(--white); }
.btn-danger    { background: #DC3545; color: var(--white); }
.btn-secondary { background: #6C757D; color: var(--white); }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; background: transparent; }
.btn-icon:hover { background: var(--bg); }

/* ---- Badges ------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-info      { background: #D1ECF1; color: #0C5460; }
.badge-success   { background: #D4EDDA; color: #155724; }
.badge-warning   { background: #FFF3CD; color: #856404; }
.badge-danger    { background: #F8D7DA; color: #721C24; }
.badge-secondary { background: #E2E3E5; color: #383D41; }
.badge-dark      { background: #D6D8D9; color: #1B1E21; }

/* ---- Flash Messages ----------------------------------- */
.flash {
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
}
.flash-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.flash-error   { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.flash-info    { background: #D1ECF1; color: #0C5460; border: 1px solid #BEE5EB; }

/* ---- Pagination --------------------------------------- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 16px 0; }
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: var(--radius);
  font-size: 13px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border);
}
.pagination a:hover { background: var(--bg); }
.pagination .active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ---- Modals ------------------------------------------- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 2000;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius);
  width: min(600px, 95vw); max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--navy); }
.modal-body   { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Login Page --------------------------------------- */
.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}
.login-box {
  background: var(--white); border-radius: 12px;
  padding: 40px; width: min(400px, 95vw);
  box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo svg { width: 52px; height: 52px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--navy); margin-top: 10px; }
.login-logo p  { font-size: 12px; color: var(--text-muted); letter-spacing: .05em; }

/* ---- Utility ------------------------------------------ */
.page-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 14px; }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Search Bar --------------------------------------- */
.search-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.search-bar input { flex: 1; max-width: 320px; }

/* ---- Tabs --------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 8px 16px; background: none; border: none;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Versicherungs-Pakete ----------------------------- */
.paket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.paket-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
  text-align: center;
}
.paket-card:hover  { border-color: var(--navy); transform: translateY(-2px); }
.paket-card.selected { border-color: var(--gold); background: var(--gold-pale); }
.paket-card.gold   { border-color: var(--gold); }
.paket-name  { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.paket-preis { font-size: 22px; font-weight: 700; color: var(--gold); }
.paket-preis span { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.paket-features { list-style: none; margin-top: 12px; text-align: left; }
.paket-features li { padding: 3px 0; font-size: 12px; }
.paket-features li::before { content: "✓ "; color: #28A745; font-weight: 700; }

/* ---- Kalender ----------------------------------------- */
.kalender-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 10px;
}
.kal-tag-header {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 6px 0;
  text-transform: uppercase;
}
.kal-tag {
  min-height: 70px; border: 1px solid var(--border);
  border-radius: 4px; padding: 4px;
  font-size: 12px; cursor: pointer;
  transition: background .1s;
}
.kal-tag:hover { background: var(--bg); }
.kal-tag.heute { border-color: var(--navy); background: rgba(29,53,87,.05); }
.kal-tag.anderer-monat { opacity: .4; }
.kal-nr { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.kal-nr.heute { color: var(--navy); }
.kal-event { background: var(--navy); color: var(--white); padding: 1px 4px; border-radius: 3px; font-size: 10px; margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-event.gold { background: var(--gold); }

/* ---- Responsive --------------------------------------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .form-grid   { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
  .grid-2 { grid-template-columns: 1fr; }
}
