/* ===== REKLAMATIONS-VORSCHLAEGE CSS ===== */
@import url('/shared/fonts/inter.css');
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: linear-gradient(145deg, #eef2f7 0%, #e4ecf4 25%, #dfe8f0 50%, #e8eef5 75%, #f0f4f8 100%);
  --nav-bg: rgba(255,255,255,0.55);
  --nav-border: rgba(255,255,255,0.5);
  --card-bg: rgba(255,255,255,0.45);
  --card-border: rgba(255,255,255,0.6);
  --card-hover-bg: rgba(255,255,255,0.65);
  --card-shadow: 0 2px 16px rgba(0,0,0,0.04);
  --card-hover-shadow: 0 12px 44px rgba(0,0,0,0.08);
  --text-primary: #1c1c1e;
  --text-secondary: #636366;
  --text-tertiary: #8e8e93;
  --badge-bg: rgba(4,179,214,0.1);
  --badge-color: #04b3d6;
  --toggle-bg: rgba(0,0,0,0.06);
  --toggle-knob: #fff;
  --input-bg: rgba(255,255,255,0.7);
  --modal-bg: rgba(255,255,255,0.92);
}

[data-theme="dark"] {
  --bg: linear-gradient(145deg, #0a0a1a 0%, #0f1528 20%, #151022 40%, #1a0f1e 60%, #12111a 80%, #0d1318 100%);
  --nav-bg: rgba(255,255,255,0.05);
  --nav-border: rgba(255,255,255,0.09);
  --card-bg: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.1);
  --card-hover-bg: rgba(255,255,255,0.1);
  --card-shadow: 0 2px 16px rgba(0,0,0,0.2);
  --card-hover-shadow: 0 12px 44px rgba(0,0,0,0.3);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #636366;
  --badge-bg: rgba(4,179,214,0.15);
  --badge-color: #2cc5e4;
  --toggle-bg: rgba(255,255,255,0.1);
  --toggle-knob: #1c1c1e;
  --input-bg: rgba(255,255,255,0.07);
  --modal-bg: rgba(20,20,30,0.97);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  min-height: 100vh;
  background: var(--bg);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
}
@keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; overflow: hidden; }
.nav-logo { height: 28px; width: auto; }
[data-theme="dark"] .nav-logo { filter: brightness(2.2) contrast(0.85); }
.nav-brand { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.4px; }
.nav-divider { width: 1px; height: 18px; background: var(--nav-border); margin: 0 2px; }
.nav-subtitle { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-back { font-size: 13px; font-weight: 500; color: var(--badge-color); text-decoration: none; padding: 5px 10px; border-radius: 8px; transition: all 0.2s; }
.nav-back:hover { background: var(--badge-bg); }
.theme-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toggle-icon { font-size: 14px; line-height: 1; }
.toggle-track { width: 44px; height: 26px; border-radius: 13px; background: var(--toggle-bg); border: 1px solid var(--card-border); position: relative; transition: all 0.3s; }
.toggle-knob { width: 20px; height: 20px; border-radius: 10px; background: var(--toggle-knob); position: absolute; top: 2px; left: 3px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
[data-theme="dark"] .toggle-knob { left: 21px; background: #f5f5f7; }

.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 16px 18px;
  box-shadow: var(--card-shadow);
  position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%; background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 100%); border-radius: 16px 16px 0 0; pointer-events: none; }
[data-theme="dark"] .stat-card::before { background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-primary); letter-spacing: -1px; line-height: 1; }
.stat-value.red { color: #ff453a; }
.stat-value.blue { color: var(--badge-color); }
.stat-value.small { font-size: 13px; font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.stat-hint { font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px; }
.stat-link { color: var(--badge-color); text-decoration: none; font-size: 11.5px; }
.stat-link:hover { text-decoration: underline; }

/* TABS */
.tab-bar { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); width: fit-content; }
.tab-btn { padding: 7px 18px; border-radius: 10px; border: none; background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.2s; -webkit-tap-highlight-color: transparent; white-space: nowrap; min-height: 36px; display: flex; align-items: center; gap: 6px; }
.tab-btn:hover { background: var(--card-hover-bg); color: var(--text-primary); }
.tab-btn.active { background: linear-gradient(135deg, #04b3d6, #0090b0); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(4,179,214,0.3); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; font-size: 10px; font-weight: 700; padding: 0 5px; }
.tab-badge-red { background: rgba(255,69,58,0.2); color: #ff453a; }
.tab-btn.active .tab-badge-red { background: rgba(255,255,255,0.25); color: #fff; }

/* FILTER */
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-input { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.2s; min-height: 38px; }
.filter-input:focus { border-color: var(--badge-color); }
.filter-input::placeholder { color: var(--text-tertiary); }
.search-wrap { flex: 1; min-width: 180px; position: relative; }
.search-wrap .filter-input { width: 100%; padding-left: 34px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 14px; pointer-events: none; }
select.filter-input { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238e8e93'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* TABELLE */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; width: 100%; max-width: 100%; }
.rek-table { width: auto; min-width: 800px; border-collapse: collapse; background: var(--card-bg); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; box-shadow: var(--card-shadow); }
.rek-table thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--card-bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
[data-theme="dark"] .rek-table thead th { background: rgba(20,20,30,0.97); }
.rek-table tbody tr { border-bottom: 1px solid var(--card-border); transition: background 0.15s; }
.rek-table tbody tr:last-child { border-bottom: none; }
.rek-table tbody tr:hover { background: var(--card-hover-bg); }
.rek-table td { padding: 12px 14px; font-size: 13px; color: var(--text-primary); vertical-align: middle; }
.rek-table .col-datum { font-weight: 500; color: var(--text-secondary); white-space: nowrap; min-width: 88px; }
.rek-table .col-lieferant { font-weight: 600; min-width: 130px; }
.rek-table .col-artikel { min-width: 140px; }
.rek-table .col-beschreibung { max-width: 240px; color: var(--text-secondary); font-size: 12.5px; }
.rek-table .col-konfidenz { white-space: nowrap; min-width: 90px; }
.rek-table .col-gutschrift { white-space: nowrap; min-width: 90px; font-weight: 600; }
.rek-table .col-aktionen { white-space: nowrap; min-width: 120px; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-rot { background: rgba(255,69,58,0.12); color: #ff453a; }
.badge-gelb { background: rgba(255,159,10,0.12); color: #ff9f0a; }
.badge-gruen { background: rgba(48,209,88,0.12); color: #30d158; }
.badge-blau { background: rgba(4,179,214,0.12); color: var(--badge-color); }
.badge-grau { background: rgba(142,142,147,0.12); color: #8e8e93; }
.badge-ki { background: rgba(94,92,230,0.12); color: #5e5ce6; }

.konfidenz-bar { display: flex; align-items: center; gap: 6px; }
.konfidenz-track { width: 48px; height: 5px; border-radius: 3px; background: var(--card-border); overflow: hidden; }
.konfidenz-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #ff453a, #ff9f0a, #30d158); }

/* BUTTONS */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: none; background: linear-gradient(135deg, #04b3d6, #0090b0); color: #fff; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; min-height: 40px; -webkit-tap-highlight-color: transparent; }
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-secondary); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.2s; min-height: 40px; -webkit-tap-highlight-color: transparent; }
.btn-secondary:hover { background: var(--card-hover-bg); color: var(--text-primary); }
.btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: 1px solid rgba(255,69,58,0.3); background: rgba(255,69,58,0.08); color: #ff453a; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; min-height: 40px; -webkit-tap-highlight-color: transparent; }
.btn-danger:hover { background: rgba(255,69,58,0.16); }
.btn-pruefen { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(4,179,214,0.3); background: rgba(4,179,214,0.07); color: var(--badge-color); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.2s; min-height: 36px; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn-pruefen:hover { background: rgba(4,179,214,0.16); }

/* STATUS PILLS */
.status-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-vorgeschlagen { background: rgba(94,92,230,0.12); color: #5e5ce6; }
.status-freigegeben { background: rgba(48,209,88,0.12); color: #30d158; }
.status-abgelehnt { background: rgba(142,142,147,0.12); color: #8e8e93; }
.status-manuell { background: rgba(255,159,10,0.12); color: #ff9f0a; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 500; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--modal-bg); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border: 1px solid var(--card-border); border-radius: 22px; width: 100%; display: flex; flex-direction: column; box-shadow: 0 32px 80px rgba(0,0,0,0.22); overflow: hidden; }
.modal-large { max-width: 720px; max-height: 92vh; }
.modal-small { max-width: 480px; max-height: 80vh; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--card-border); flex-shrink: 0; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.modal-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--card-border); background: var(--toggle-bg); color: var(--text-tertiary); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; -webkit-tap-highlight-color: transparent; flex-shrink: 0; }
.modal-close:hover { background: var(--card-hover-bg); color: var(--text-primary); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }
.modal-footer { padding: 14px 24px 18px; border-top: 1px solid var(--card-border); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.footer-right { display: flex; gap: 8px; }

/* MODAL CONTENT */
.detail-section { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 14px 18px; }
.detail-section-title { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.detail-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.detail-info-item { display: flex; flex-direction: column; gap: 2px; }
.detail-info-label { font-size: 10.5px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; }
.detail-info-value { font-size: 13.5px; color: var(--text-primary); font-weight: 500; }

.soll-ist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.soll-ist-table th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--card-border); }
.soll-ist-table td { padding: 8px 10px; border-bottom: 1px solid var(--card-border); color: var(--text-primary); }
.soll-ist-table tr:last-child td { border-bottom: none; }
.diff-neg { color: #ff453a; font-weight: 600; }
.diff-pos { color: #30d158; font-weight: 600; }

.vision-text { font-size: 13.5px; color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }
.vision-hint { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; font-style: italic; }
.vision-img-wrap { margin-top: 12px; }
.vision-img { max-width: 200px; max-height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--card-border); cursor: pointer; transition: transform 0.15s; }
.vision-img:hover { transform: scale(1.03); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.form-label .required { color: #ff453a; margin-left: 2px; }
.form-input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--input-bg); color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.2s; min-height: 40px; }
.form-input:focus { border-color: var(--badge-color); }
textarea.form-input { min-height: 90px; resize: vertical; line-height: 1.5; }

.schatten-hinweis { padding: 10px 14px; background: rgba(255,159,10,0.08); border: 1px solid rgba(255,159,10,0.2); border-radius: 10px; font-size: 12.5px; color: #ff9f0a; display: flex; align-items: flex-start; gap: 8px; }
.btn-primary.schatten { background: linear-gradient(135deg, #636366, #48484a); }

/* EMPTY + LOADING */
.empty-state { display: none; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; gap: 14px; }
.empty-state.show { display: flex; }
.empty-icon { font-size: 48px; opacity: 0.4; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); }
.empty-sub { font-size: 14px; color: var(--text-tertiary); }
.loading-state { display: flex; align-items: center; justify-content: center; padding: 60px; gap: 10px; color: var(--text-secondary); font-size: 14px; }
.loading-state.hidden { display: none; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--card-border); border-top-color: var(--badge-color); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 18px; border-radius: 12px; background: #1c1c1e; color: #f5f5f7; font-size: 13.5px; font-weight: 500; box-shadow: 0 8px 32px rgba(0,0,0,0.25); max-width: 300px; animation: slideIn 0.25s ease; border: 1px solid rgba(255,255,255,0.1); }
.toast.success { background: #1a3a24; color: #30d158; border-color: rgba(48,209,88,0.25); }
.toast.error { background: #3a1a1a; color: #ff453a; border-color: rgba(255,69,58,0.25); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 900; align-items: center; justify-content: center; cursor: pointer; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: 12px; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* hidden */
.hidden { display: none !important; }

/* MOBILE */
@media (max-width: 600px) {
  .container { padding: 16px 12px 80px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tab-bar { flex-wrap: wrap; width: 100%; }
  .tab-btn { flex: 1; justify-content: center; min-width: 0; padding: 7px 10px; font-size: 12px; }
  .modal-large { max-height: 96vh; border-radius: 18px 18px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; }
  .modal-footer { flex-direction: column; }
  .footer-right { width: 100%; }
  .btn-primary, .btn-danger, .btn-secondary { min-height: 44px; }
  .detail-info-grid { grid-template-columns: 1fr; }
}
