/* ── Variablen & Reset ─────────────────────────────────────────── */
/* Inter – lokal eingebunden (DSGVO-konform, kein Google CDN) */
/* Diese Deklarationen an den ANFANG von static/style.css einfügen */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/inter-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --primary:     #317359;
  --primary-dk:  #245a43;
  --primary-lt:  #e8f4ef;
  --accent:      #f5c842;
  --danger:      #dc3545;
  --text:        #1a1a1a;
  --muted:       #6c757d;
  --border:      #d0ddd8;
  --bg:          #f4f7f5;
  --card-bg:     #ffffff;
  --radius:      10px;
  --shadow:      0 2px 12px rgba(49,115,89,.12);
  --shadow-lg:   0 6px 28px rgba(49,115,89,.16);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  min-height:  100vh;
  line-height: 1.6;
}

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
  background: var(--primary);
  padding:    0 1.5rem;
  height:     64px;
  display:    flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  position:   sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display:     flex;
  align-items: center;
  gap:         .75rem;
  color:       #fff;
  text-decoration: none;
  font-weight: 700;
  font-size:   1.1rem;
}
.navbar-brand img { height: 40px; width: auto; border-radius: 4px; }
.navbar-links { display: flex; gap: .5rem; align-items: center; }
.navbar-links a, .navbar-links button {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: .4rem .85rem;
  border-radius: 6px;
  font-size: .9rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.navbar-links a:hover, .navbar-links button:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.navbar-links a.active { background: rgba(255,255,255,.2); color: #fff; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: .5rem;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .2s;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--primary-dk);
  padding: .75rem 1rem;
}
.mobile-menu a, .mobile-menu button {
  color: #fff;
  text-decoration: none;
  padding: .6rem .5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-menu.open { display: flex; }

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin:    0 auto;
  padding:   2rem 1.25rem;
}
.container-wide {
  max-width: 1100px;
  margin:    0 auto;
  padding:   2rem 1.25rem;
}

/* ── Hero (Antragsseite) ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  color: #fff;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}
.hero-logo { height: 90px; width: auto; margin-bottom: 1.25rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: .5rem; }
.hero p  { font-size: 1.05rem; opacity: .88; max-width: 540px; margin: 0 auto; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background:    var(--card-bg);
  border-radius: var(--radius);
  box-shadow:    var(--shadow);
  border:        1px solid var(--border);
  overflow:      hidden;
}
.card-header {
  background:  var(--primary);
  color:       #fff;
  padding:     1rem 1.5rem;
  font-weight: 700;
  font-size:   1.05rem;
  display:     flex;
  align-items: center;
  gap:         .6rem;
}
.card-header .icon { font-size: 1.25rem; }
.card-body { padding: 1.5rem; }

/* ── Formulare ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display:       block;
  font-weight:   600;
  font-size:     .9rem;
  margin-bottom: .4rem;
  color:         var(--primary-dk);
}
.form-group label .required { color: var(--danger); margin-left: 3px; }
.form-control {
  width:         100%;
  padding:       .65rem .9rem;
  border:        1.5px solid var(--border);
  border-radius: 7px;
  font-size:     1rem;
  font-family:   var(--font);
  background:    #fff;
  color:         var(--text);
  transition:    border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline:      none;
  border-color: var(--primary);
  box-shadow:   0 0 0 3px rgba(49,115,89,.15);
}
.form-hint {
  font-size:   .8rem;
  color:       var(--muted);
  margin-top:  .3rem;
}

/* File Upload */
.file-upload-wrapper {
  border:        2px dashed var(--border);
  border-radius: 8px;
  padding:       1.5rem;
  text-align:    center;
  cursor:        pointer;
  transition:    border-color .2s, background .2s;
  position:      relative;
}
.file-upload-wrapper:hover,
.file-upload-wrapper.drag-over {
  border-color: var(--primary);
  background:   var(--primary-lt);
}
.file-upload-wrapper input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.file-upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.file-upload-label { font-weight: 600; color: var(--primary); display: block; }
.file-upload-sub { font-size: .82rem; color: var(--muted); }
.file-preview { margin-top: .75rem; display: none; }
.file-preview img { max-height: 180px; border-radius: 6px; border: 1px solid var(--border); }
.file-preview .file-name { font-size: .85rem; color: var(--primary-dk); margin-top: .4rem; font-weight: 600; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display:       inline-flex;
  align-items:   center;
  gap:           .4rem;
  padding:       .65rem 1.4rem;
  border:        none;
  border-radius: 7px;
  font-size:     .95rem;
  font-weight:   600;
  cursor:        pointer;
  font-family:   var(--font);
  text-decoration: none;
  transition:    background .15s, transform .1s, box-shadow .15s;
  white-space:   nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(49,115,89,.35);
}
.btn-primary:hover { background: var(--primary-dk); }
.btn-success {
  background: #198754;
  color: #fff;
}
.btn-success:hover { background: #157347; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #b02a37; }
.btn-outline {
  background:  transparent;
  color:       var(--primary);
  border:      1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-lt); }
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Alerts / Badges ───────────────────────────────────────────── */
.alert {
  padding:       .85rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size:     .93rem;
  display:       flex;
  align-items:   flex-start;
  gap:           .5rem;
}
.alert-danger  { background: #fde8e8; color: #842029; border: 1px solid #f5c6cb; }
.alert-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.alert-info    { background: var(--primary-lt); color: var(--primary-dk); border: 1px solid #b7d9ca; }
.alert ul { margin: .3rem 0 0 1.1rem; }

.badge {
  display:       inline-block;
  padding:       .25em .6em;
  border-radius: 20px;
  font-size:     .78rem;
  font-weight:   700;
  white-space:   nowrap;
}
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-approved { background: #d1e7dd; color: #0f5132; }
.badge-rejected { background: #f8d7da; color: #842029; }

/* ── Tabellen ──────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table {
  width:           100%;
  border-collapse: collapse;
  font-size:       .92rem;
}
thead th {
  background:  var(--primary);
  color:       #fff;
  padding:     .8rem 1rem;
  text-align:  left;
  font-weight: 600;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--primary-lt); }
tbody td { padding: .75rem 1rem; vertical-align: middle; }

/* ── Detail-Grid ───────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-item label {
  display:     block;
  font-size:   .8rem;
  font-weight: 700;
  color:       var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .2rem;
}
.detail-item .value {
  font-size:   1rem;
  font-weight: 600;
  color:       var(--text);
}
.control-number {
  font-size:   1.6rem;
  font-weight: 800;
  color:       var(--primary);
}

/* ── Fangbericht Tabelle ───────────────────────────────────────── */
.catch-row-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr auto;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
}
.catch-row-inputs .form-control { margin-bottom: 0; }

/* ── Stats Karten (Dashboard) ──────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background:    var(--card-bg);
  border-radius: var(--radius);
  padding:       1.25rem 1.5rem;
  box-shadow:    var(--shadow);
  border:        1px solid var(--border);
  text-align:    center;
}
.stat-card .stat-num {
  font-size:   2rem;
  font-weight: 800;
  color:       var(--primary);
  display:     block;
}
.stat-card .stat-label {
  font-size: .85rem;
  color:     var(--muted);
  margin-top: .2rem;
}

/* ── Section Title ─────────────────────────────────────────────── */
.section-title {
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--primary-dk);
  margin-bottom: 1rem;
  display:     flex;
  align-items: center;
  gap:         .5rem;
}
.section-title::after {
  content:    '';
  flex:       1;
  height:     2px;
  background: var(--border);
  margin-left:.5rem;
}

/* ── Success Page ──────────────────────────────────────────────── */
.success-icon {
  width:  80px; height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* ── Login ─────────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display:    flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  padding:    1.5rem;
}
.login-card {
  background:    #fff;
  border-radius: 14px;
  box-shadow:    var(--shadow-lg);
  padding:       2.5rem 2rem;
  width:         100%;
  max-width:     420px;
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo img { height: 80px; }
.login-title { text-align: center; font-size: 1.4rem; font-weight: 800; color: var(--primary-dk); margin-bottom: .25rem; }
.login-sub   { text-align: center; font-size: .9rem; color: var(--muted); margin-bottom: 2rem; }

/* ── Image Lightbox ────────────────────────────────────────────── */
.license-thumb {
  max-height: 140px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s;
  display: block;
  margin-bottom: .5rem;
}
.license-thumb:hover { transform: scale(1.03); }
.lightbox-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.8); z-index: 9999;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem;
  color: #fff; font-size: 2rem; cursor: pointer;
  background: none; border: none;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-links { display: none; }
  .hamburger    { display: flex; }
  .container, .container-wide { padding: 1.25rem .9rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .card-body { padding: 1.1rem; }
  .catch-row-inputs {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .catch-row-inputs .remove-btn { grid-column: 2; justify-self: end; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .btn-lg { width: 100%; justify-content: center; }
  thead { display: none; }
  tbody tr { display: block; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .75rem; }
  tbody td { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
  tbody td:last-child { border-bottom: none; }
  tbody td::before { content: attr(data-label); font-weight: 700; font-size: .82rem; color: var(--muted); }
}

/* ── Utilities ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-1 { margin-top: .5rem;  }
.mt-2 { margin-top: 1rem;   }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem;   }
.mb-1 { margin-bottom: .5rem;  }
.mb-2 { margin-bottom: 1rem;   }
.mb-3 { margin-bottom: 1.5rem; }
.gap-2 { gap: 1rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
