/* InseratCheck CRM */
:root {
  --ic-red: #dc2626; --ic-dark: #111827; --ic-muted: #6b7280;
  --ic-border: #e5e7eb; --ic-bg: #f9fafb; --ic-white: #ffffff;
  --ic-green: #16a34a; --ic-yellow: #d97706; --ic-blue: #2563eb;
  --radius: 10px; --shadow: 0 1px 4px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#icc-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ic-dark); background: var(--ic-bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.icc-loading { text-align: center; padding: 60px; color: var(--ic-muted); }

/* ── NAV ── */
.icc-nav {
  background: var(--ic-dark); display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100;
}
.icc-nav-brand { color: #fff; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.icc-nav-badge { background: var(--ic-red); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 4px; }
.icc-nav-right { display: flex; align-items: center; gap: 12px; }
.icc-nav-user { color: #aaa; font-size: 13px; }
.icc-nav-tabs { display: flex; gap: 4px; }
.icc-nav-tab {
  background: transparent; border: none; color: #aaa; padding: 8px 14px;
  border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s;
}
.icc-nav-tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.icc-nav-tab.active { color: #fff; background: var(--ic-red); }
.icc-nav-logout {
  background: transparent; border: 1px solid #444; color: #aaa;
  padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.icc-nav-logout:hover { border-color: #666; color: #fff; }

/* ── LOGIN ── */
#icc-login {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ic-bg);
}
.icc-login-card {
  background: #fff; border-radius: 16px; padding: 48px 40px; width: 100%; max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}
.icc-login-title { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.icc-login-sub { color: var(--ic-muted); font-size: 14px; margin-bottom: 28px; }

/* ── FORMS ── */
.icc-field { margin-bottom: 16px; }
.icc-field label { display: block; font-size: 12px; font-weight: 700; color: var(--ic-dark); margin-bottom: 5px; letter-spacing: .3px; text-transform: uppercase; }
.icc-field input, .icc-field select, .icc-field textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--ic-border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ic-dark); background: #fff;
  transition: border-color .15s; -webkit-appearance: none;
}
.icc-field input:focus, .icc-field select:focus, .icc-field textarea:focus {
  outline: none; border-color: var(--ic-red); box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.icc-field textarea { resize: vertical; min-height: 80px; }
.icc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.icc-span-2 { grid-column: 1 / -1; }

/* ── BUTTONS ── */
.icc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; border: none; transition: opacity .15s; white-space: nowrap;
}
.icc-btn:hover { opacity: .85; }
.icc-btn-primary { background: var(--ic-red); color: #fff; }
.icc-btn-secondary { background: #f3f4f6; color: var(--ic-dark); border: 1.5px solid var(--ic-border); }
.icc-btn-green { background: var(--ic-green); color: #fff; }
.icc-btn-sm { padding: 6px 12px; font-size: 12px; }
.icc-btn-full { width: 100%; }
.icc-btn-icon { background: none; border: none; cursor: pointer; color: var(--ic-muted); padding: 4px 6px; border-radius: 4px; }
.icc-btn-icon:hover { color: var(--ic-red); background: #fee2e2; }

/* ── ALERTS ── */
.icc-alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.icc-alert-error { background: #fef2f2; color: var(--ic-red); border: 1px solid #fecaca; }
.icc-alert-success { background: #f0fdf4; color: var(--ic-green); border: 1px solid #bbf7d0; }
.icc-alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── MAIN LAYOUT ── */
.icc-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
.icc-page-title { font-size: 22px; font-weight: 900; margin-bottom: 20px; }

/* ── TOOLBAR ── */
.icc-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.icc-toolbar-right { margin-left: auto; display: flex; gap: 10px; }
.icc-search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.icc-search-wrap input { padding-left: 36px; }
.icc-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ic-muted); font-size: 16px; }
.icc-search-results {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  border: 1.5px solid var(--ic-border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 50; max-height: 280px; overflow-y: auto; margin-top: 4px;
}
.icc-search-item { padding: 10px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--ic-border); }
.icc-search-item:last-child { border-bottom: none; }
.icc-search-item:hover { background: #f9fafb; }
.icc-search-item strong { color: var(--ic-dark); }
.icc-search-item span { color: var(--ic-muted); font-size: 12px; }

/* ── TABLE ── */
.icc-table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.icc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.icc-table th { background: var(--ic-dark); color: #fff; text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.icc-table td { padding: 12px 14px; border-bottom: 1px solid var(--ic-border); vertical-align: middle; }
.icc-table tr:last-child td { border-bottom: none; }
.icc-table tr:hover td { background: #fafafa; }
.icc-table td a { color: var(--ic-blue); text-decoration: none; font-weight: 600; }
.icc-table td a:hover { text-decoration: underline; }

/* ── STATUS BADGES ── */
.icc-badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.icc-badge-neu        { background: #e0f2fe; color: #0369a1; }
.icc-badge-kontaktiert{ background: #f3e8ff; color: #7c3aed; }
.icc-badge-interesse  { background: #ecfdf5; color: #065f46; }
.icc-badge-rueckruf   { background: #fff7ed; color: #c2410c; }
.icc-badge-vertrag    { background: #fffbeb; color: #92400e; }
.icc-badge-abgeschlossen { background: #dcfce7; color: #15803d; }
.icc-badge-abgelehnt  { background: #fee2e2; color: #991b1b; }
.icc-badge-offen      { background: #fef9c3; color: #854d0e; }
.icc-badge-freigegeben{ background: #dbeafe; color: #1e40af; }
.icc-badge-abgerechnet{ background: #dcfce7; color: #15803d; }
.icc-badge-storniert  { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }

/* ── MODAL ── */
.icc-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.icc-modal {
  background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 640px;
  position: relative; box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.icc-modal-title { font-size: 18px; font-weight: 800; margin-bottom: 24px; }
.icc-modal-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--ic-muted); line-height: 1;
}
.icc-modal-close:hover { color: var(--ic-dark); }
.icc-modal-footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── DETAIL PAGE ── */
.icc-detail-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.icc-detail-title { font-size: 22px; font-weight: 900; }
.icc-detail-meta { font-size: 13px; color: var(--ic-muted); margin-top: 4px; }
.icc-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.icc-card-title { font-size: 15px; font-weight: 800; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--ic-red); }
.icc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.icc-info-row { font-size: 13px; }
.icc-info-label { font-weight: 700; color: var(--ic-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 2px; }
.icc-info-val { color: var(--ic-dark); }

/* ── KONTAKTVERLAUF ── */
.icc-kontakt-item { border: 1px solid var(--ic-border); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.icc-kontakt-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.icc-kontakt-date { font-weight: 700; font-size: 13px; }
.icc-kontakt-by { font-size: 12px; color: var(--ic-muted); }
.icc-kontakt-notiz { font-size: 13px; margin-bottom: 4px; }
.icc-kontakt-aufgabe { font-size: 12px; color: var(--ic-yellow); font-weight: 600; }
.icc-kontakt-aufgabe::before { content: '→ Aufgabe: '; }

/* ── PROVISION DASHBOARD ── */
.icc-prov-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.icc-stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.icc-stat-num { font-size: 28px; font-weight: 900; color: var(--ic-red); }
.icc-stat-label { font-size: 12px; color: var(--ic-muted); font-weight: 600; margin-top: 4px; }
.icc-prov-row-offen { background: #fffbeb; }
.icc-prov-row-freigegeben { background: #eff6ff; }
.icc-prov-row-abgerechnet { background: #f0fdf4; }
.icc-prov-row-storniert { background: #f9fafb; opacity: 0.6; }

/* ── VERTRIEBLER LIST ── */
.icc-vb-card { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--ic-border); border-radius: 8px; padding: 14px 18px; margin-bottom: 8px; }
.icc-vb-name { font-weight: 700; font-size: 14px; }
.icc-vb-email { font-size: 12px; color: var(--ic-muted); }
.icc-vb-badges { display: flex; gap: 6px; }

/* ── FILTER ROW ── */
.icc-filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.icc-filter-row select, .icc-filter-row input { padding: 8px 12px; border: 1.5px solid var(--ic-border); border-radius: 7px; font-size: 13px; font-family: inherit; background: #fff; }

/* ── DUPLICATE WARNING ── */
.icc-dupe-list { margin-top: 8px; }
.icc-dupe-item { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 4px; color: #9a3412; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .icc-nav { padding: 0 14px; }
  .icc-main { padding: 16px; }
  .icc-grid-2 { grid-template-columns: 1fr; }
  .icc-grid-2 .icc-span-2 { grid-column: 1; }
  .icc-info-grid { grid-template-columns: 1fr; }
  .icc-table { font-size: 12px; }
  .icc-table th, .icc-table td { padding: 8px 10px; }
  .icc-modal { padding: 20px; }
}
