/* DSGVOPro — Haupt-Stylesheet */
/* Keine externen Schriftarten — System-Font-Stack */

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

:root {
  --navy:    #1e3a5f;
  --navy-d:  #152c4a;
  --navy-l:  #2d5b8e;
  --accent:  #3b82f6;
  --accent-l:#dbeafe;
  --green:   #16a34a;
  --green-l: #dcfce7;
  --red:     #dc2626;
  --red-l:   #fee2e2;
  --amber:   #d97706;
  --amber-l: #fef3c7;
  --gray-50: #f8fafc;
  --gray-100:#f1f5f9;
  --gray-200:#e2e8f0;
  --gray-300:#cbd5e1;
  --gray-400:#94a3b8;
  --gray-500:#64748b;
  --gray-600:#475569;
  --gray-700:#334155;
  --gray-800:#1e293b;
  --gray-900:#0f172a;
  --radius:  8px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── LAYOUT ──────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.topbar-logo .badge-eu {
  font-size: 0.65rem;
  background: rgba(255,255,255,.15);
  color: #93c5fd;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.topbar-spacer { flex: 1; }
.topbar-user {
  color: rgba(255,255,255,.75);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-user .avatar {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
}
.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all .15s;
}
.btn-logout:hover { border-color: rgba(255,255,255,.5); color: white; }

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 20px 0;
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}
.sidebar-section {
  margin-bottom: 8px;
}
.sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gray-400);
  font-weight: 600;
  padding: 0 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-link:hover { background: var(--gray-50); color: var(--navy); }
.sidebar-link.active {
  background: var(--accent-l);
  color: var(--navy);
  border-left-color: var(--navy);
  font-weight: 600;
}
.sidebar-link svg { flex-shrink: 0; opacity: .7; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-divider { height: 1px; background: var(--gray-100); margin: 8px 20px; }

/* Org-Selector in Sidebar */
.org-selector {
  margin: 0 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.org-selector label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--gray-400); font-weight: 600; display: block; margin-bottom: 5px; }
.org-selector select {
  width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

/* ── MAIN CONTENT ────────────────────────────── */
.main-content {
  padding: 28px;
  overflow-y: auto;
  max-width: 1100px;
}

/* ── PAGE HEADER ─────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}
.page-header p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-top: 4px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── STATS GRID ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 4px;
}
.stat-card.green { border-left: 3px solid var(--green); }
.stat-card.blue  { border-left: 3px solid var(--accent); }
.stat-card.amber { border-left: 3px solid var(--amber); }
.stat-card.red   { border-left: 3px solid var(--red); }

/* ── BUTTONS ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-d); }
.btn-secondary { background: white; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ───────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
label.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
}
label.form-label .required { color: var(--red); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--red); margin-top: 4px; }

/* Toggle / Checkbox */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 11px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
  box-shadow: var(--shadow);
}
.toggle input:checked + .toggle-slider { background: var(--navy); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── WIZARD ──────────────────────────────────── */
.wizard-container { max-width: 760px; }
.wizard-progress {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.wizard-step.done:not(:last-child)::after { background: var(--navy); }
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-400);
  position: relative;
  z-index: 1;
  transition: all .2s;
}
.wizard-step.active .step-circle {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}
.wizard-step.done .step-circle {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}
.step-label {
  font-size: 0.72rem;
  margin-top: 5px;
  color: var(--gray-400);
  text-align: center;
  font-weight: 500;
}
.wizard-step.active .step-label { color: var(--navy); font-weight: 600; }
.wizard-step.done .step-label  { color: var(--navy); }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

/* ── TABLE ───────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}
table { width: 100%; border-collapse: collapse; background: white; }
th {
  text-align: left;
  padding: 11px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  font-weight: 600;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
}
.table-empty svg { opacity: .3; margin-bottom: 8px; }

/* ── BADGES ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
}
.badge-blue   { background: var(--accent-l); color: #1d4ed8; }
.badge-green  { background: var(--green-l);  color: #15803d; }
.badge-amber  { background: var(--amber-l);  color: #92400e; }
.badge-red    { background: var(--red-l);    color: #991b1b; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ── TOMs ────────────────────────────────────── */
.toms-category-header {
  background: var(--navy);
  color: white;
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.toms-row {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.toms-row:last-child { border-bottom: none; }
.toms-row:hover { background: var(--gray-50); }
.toms-measure { flex: 1; font-size: 0.875rem; }
.toms-status-btns { display: flex; gap: 6px; }
.toms-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--gray-300);
  background: white;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.toms-btn:hover { border-color: var(--gray-400); }
.toms-btn.active-yes  { background: var(--green-l); border-color: var(--green); color: var(--green); }
.toms-btn.active-part { background: var(--amber-l); border-color: var(--amber); color: var(--amber); }
.toms-btn.active-no   { background: var(--red-l);   border-color: var(--red);   color: var(--red); }

/* ── PROGRESS BAR ────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .4s ease;
}

/* ── ALERTS ──────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.alert-info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warn  { background: var(--amber-l); border: 1px solid #fde68a; color: #92400e; }
.alert-error { background: var(--red-l); border: 1px solid #fca5a5; color: #991b1b; }
.alert-ok    { background: var(--green-l); border: 1px solid #bbf7d0; color: #15803d; }

/* ── MODAL ───────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 4px;
  transition: .15s;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--gray-50);
  border-radius: 0 0 12px 12px;
}

/* ── TOAST ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--gray-900);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── LOGIN PAGE ──────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-d) 0%, var(--navy) 60%, var(--navy-l) 100%);
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
}
.auth-logo p {
  font-size: 0.83rem;
  color: var(--gray-500);
  margin-top: 3px;
}
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: .15s;
}
.auth-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state svg { margin-bottom: 16px; opacity: .3; }
.empty-state h3 { font-size: 1rem; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 20px 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ── UTILS ───────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 0.85rem; }
.fw-600 { font-weight: 600; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
