/* ========================================
   DKM Reisekosten – Stylesheet
   ======================================== */
:root {
  --primary: #1A3A5C;
  --primary-light: #2E6DA4;
  --accent: #E8950A;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --bg: #F4F7FB;
  --card-bg: #ffffff;
  --text: #2d3748;
  --muted: #718096;
  --border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar { background: var(--primary); padding: 0 2rem; display: flex;
  align-items: center; gap: 2rem; height: 60px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.nav-brand { color: white; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.nav-logo { font-size: 1.4rem; }
.nav-links { display: flex; gap: 0.5rem; align-items: center; flex: 1; }
.nav-link { color: rgba(255,255,255,0.85); padding: 0.4rem 0.9rem; border-radius: 5px;
  font-size: 0.9rem; transition: background 0.15s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: white; text-decoration: none; }
.nav-btn { background: var(--accent); color: white !important; font-weight: 600; }
.nav-btn:hover { background: #d4850a; }
.nav-user { display: flex; align-items: center; gap: 0.8rem; margin-left: auto; }
.user-name { color: rgba(255,255,255,0.9); font-size: 0.85rem; }
.nav-link-small { color: rgba(255,255,255,0.65); font-size: 0.8rem; padding: 0.3rem 0.5rem;
  border-radius: 4px; }
.nav-link-small:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }

/* Main */
.main-content { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Flash */
.flash-container { margin-bottom: 1.5rem; }
.alert { padding: 0.85rem 1.2rem; border-radius: var(--radius); margin-bottom: 0.5rem; font-size: 0.92rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.6rem; color: var(--primary); }
.header-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; }
.card h3 { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.1rem;
  border-radius: 6px; border: none; cursor: pointer; font-size: 0.9rem; font-weight: 500;
  transition: opacity 0.15s, transform 0.1s; text-decoration: none !important; }
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; border-radius: 5px;
  background: #e2e8f0; color: var(--text); cursor: pointer; text-decoration: none; border: none; }
.btn-sm.btn-outline { background: transparent; border: 1px solid var(--primary-light); color: var(--primary-light); }
.btn-danger-sm { background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 1rem; padding: 0.1rem 0.4rem; }
.btn-danger-sm:hover { background: #ffeaea; border-radius: 4px; }

/* Forms */
.form-card { max-width: 820px; }
.form-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: 0.95rem; font-weight: 600; color: var(--primary-light);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 160px; }
.form-group.flex-2 { flex: 2; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.form-control { padding: 0.55rem 0.8rem; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 0.92rem; color: var(--text); transition: border-color 0.15s; background: white; }
.form-control:focus { outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,109,164,0.1); }
.form-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; }
.form-inline { align-items: flex-end; }
.form-group-btn { align-self: flex-end; flex: 0; min-width: auto; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 0.6rem 0.8rem; font-size: 0.8rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; border-bottom: 2px solid var(--border);
  white-space: nowrap; }
.table td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8fafd; }
.table-sm td, .table-sm th { padding: 0.5rem 0.7rem; }
.table-total td { background: #f0f5fb; font-weight: 600; }
.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { white-space: nowrap; display: flex; gap: 0.4rem; align-items: center; }

/* Badges */
.badge { display: inline-block; padding: 0.25em 0.65em; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; }
.badge-lg { font-size: 0.88rem; padding: 0.35em 0.9em; }
.badge-offen { background: #fff3cd; color: #856404; }
.badge-eingereicht { background: #cce5ff; color: #004085; }
.badge-abgeschlossen { background: #d4edda; color: #155724; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.2rem; text-align: center; border-top: 4px solid transparent; }
.stat-number { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; text-transform: uppercase; }
.stat-offen { border-top-color: var(--warning); }
.stat-eingereicht { border-top-color: var(--primary-light); }
.stat-abgeschlossen { border-top-color: var(--success); }
.stat-gesamt { border-top-color: var(--accent); }
.stat-gesamt .stat-number { font-size: 1.4rem; }

/* Detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; align-items: start; }
.detail-list dt { font-size: 0.85rem; color: var(--muted); font-weight: 500; padding-top: 0.1rem; white-space: nowrap; }
.detail-list dd { font-size: 0.95rem; color: var(--text); }
.total-label { font-weight: 700; color: var(--primary); font-size: 1rem !important; }
.total-amount { font-weight: 700; font-size: 1.15rem; color: var(--primary); }

/* Danger zone */
.danger-zone { border: 1px solid #f5c6cb; }
.danger-zone h3 { color: var(--danger); }

/* News */
.news-banner { margin-bottom: 1.5rem; }
.news-card { border-left: 4px solid var(--border); }
.news-card-highlight { border-left-color: var(--warning); }
.news-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.news-body { color: var(--text); line-height: 1.7; margin: 0.5rem 0; }
.news-sources { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

/* Login */
.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.login-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 2.5rem; width: 100%; max-width: 400px; }
.login-logo { font-size: 3rem; text-align: center; margin-bottom: 0.5rem; }
.login-title { text-align: center; color: var(--primary); font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* Helpers */
.muted { color: var(--muted); }
.link { color: var(--primary-light); font-weight: 500; }
.link-sm { font-size: 0.82rem; }

/* Responsive */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; gap: 1rem; }
  .form-row { flex-direction: column; }
}
