:root {
  --navy: #1E537C;
  --navy-dark: #153d5c;
  --navy-light: #2a6a9e;
  --gold: #F9B233;
  --gold-dark: #e09a1a;
  --gold-light: #fcc566;
  --bg: #f4f6f8;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --text: #2c3e50;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

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

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

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-light); }

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.login-box {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.login-logo span { color: var(--gold); }

.login-subtitle {
  color: var(--gray-600);
  margin-bottom: 30px;
  font-size: 13px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--navy);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  color: white;
}

.sidebar-logo span { color: var(--gold); }

.sidebar-nav { padding: 10px 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-nav a.active { border-left: 3px solid var(--gold); }

.sidebar-nav .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 0;
}

.topbar {
  background: var(--white);
  padding: 15px 30px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 600; color: var(--navy); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topbar-user { color: var(--gray-600); font-size: 13px; }

.content { padding: 25px 30px; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
}

.card-body { padding: 20px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 5px;
}

.stat-a .stat-number { color: var(--success); }
.stat-b .stat-number { color: var(--info); }
.stat-c .stat-number { color: var(--warning); }
.stat-x .stat-number { color: var(--danger); }
.stat-total .stat-number { color: var(--navy); }

/* Forms */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 83, 124, 0.1);
}

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-inline {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-dark); color: white; }

.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-dark); color: var(--navy-dark); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219a52; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; color: white; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-100); color: var(--gray-700); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tables */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

th {
  background: var(--gray-100);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  position: sticky;
  top: 0;
}

th a {
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

th a:hover { color: var(--navy); }

tr:hover td { background: var(--gray-100); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-a { background: #d4edda; color: #155724; }
.badge-b { background: #d1ecf1; color: #0c5460; }
.badge-c { background: #fff3cd; color: #856404; }
.badge-x { background: #f8d7da; color: #721c24; }

.badge-offen { background: var(--gray-200); color: var(--gray-700); }
.badge-antwort { background: #d1ecf1; color: #0c5460; }
.badge-termin { background: #d4edda; color: #155724; }
.badge-angebot { background: #fff3cd; color: #856404; }
.badge-absage { background: #f8d7da; color: #721c24; }
.badge-kunde { background: var(--success); color: white; }

/* Potenzial Select (inline) */
.potenzial-select {
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}

.potenzial-select:hover { border-color: var(--gray-300); }

.potenzial-select.pot-A { color: #155724; }
.potenzial-select.pot-B { color: #0c5460; }
.potenzial-select.pot-C { color: #856404; }
.potenzial-select.pot-X { color: #721c24; }

/* Pagination */
.pagination {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.pagination a { background: var(--white); border: 1px solid var(--gray-300); color: var(--gray-700); }
.pagination a:hover { background: var(--gray-100); }
.pagination .current { background: var(--navy); color: white; font-weight: 600; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-300);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--gray-100);
  border-radius: var(--radius);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--white);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--gray-600);
}

.timeline-title { font-weight: 600; color: var(--text); }

/* Detail sections */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.detail-field {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 2px;
}

.detail-value { font-size: 14px; font-weight: 500; }

/* Import Preview */
.preview-table {
  font-size: 12px;
  overflow-x: auto;
}

.preview-table th { font-size: 10px; }
.preview-table td { font-size: 12px; padding: 6px 8px; }

/* Import Result */
.import-result {
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.import-result.success { background: #d4edda; border: 1px solid #c3e6cb; }
.import-result.error { background: #f8d7da; border: 1px solid #f5c6cb; }

.import-stat {
  display: inline-block;
  margin: 5px 15px 5px 0;
  font-size: 14px;
}

.import-stat strong { font-size: 20px; color: var(--navy); }

/* Charts (simple CSS bars) */
.bar-chart { padding: 10px 0; }

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.bar-label {
  width: 120px;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  min-width: fit-content;
  transition: width 0.5s;
}

.bar-fill.navy { background: var(--navy); }
.bar-fill.gold { background: var(--gold); color: var(--navy-dark); }
.bar-fill.success { background: var(--success); }
.bar-fill.danger { background: var(--danger); }
.bar-fill.info { background: var(--info); }

/* Quick Filters */
.quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.quick-filter {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.quick-filter:hover, .quick-filter.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 15px;
  font-size: 13px;
}

.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Activity list */
.activity-list { list-style: none; }

.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
}

.activity-time {
  color: var(--gray-500);
  font-size: 11px;
  white-space: nowrap;
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--navy);
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: block; }
  .main-content { margin-left: 0; }
  .content { padding: 15px; }
  .topbar { padding: 10px 15px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  th, td { padding: 8px 6px; font-size: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
}

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.gap-10 { gap: 10px; }
