/* ═══════════════════════════════════════════════
   IT-Art Monitor — CSS mit Dark Mode Support
   ═══════════════════════════════════════════════ */

:root {
  --brand: #0056b3;
  --brand-dark: #003d80;
  --brand-light: #e8f0fb;
  --green: #28a745;
  --yellow: #d68910;
  --red: #dc3545;
  --orange: #e67e22;
  --gray: #6c757d;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #dee2e6;
  --text: #212529;
  --text-muted: #6c757d;
  --nav-bg: #0a1628;
  --nav-text: rgba(255,255,255,0.85);
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 7px;
}

[data-theme="dark"] {
  --brand: #4a9eff;
  --brand-dark: #2276d6;
  --brand-light: #1a2a3a;
  --green: #2ecc71;
  --yellow: #f39c12;
  --red: #e74c3c;
  --orange: #e67e22;
  --gray: #95a5a6;
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --nav-bg: #010409;
  --nav-text: rgba(255,255,255,0.85);
  --shadow: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  transition: background .2s, color .2s;
}

/* ── Navbar ─────────────────────────────────── */
.navbar {
  background: var(--nav-bg);
  padding: 0 20px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  margin-right: 8px;
}
.nav-logo { font-size: 18px; color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background .15s;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.nav-add {
  background: var(--brand) !important;
  color: #fff !important;
  margin-left: 8px;
}
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 5px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.nav-logout { color: rgba(255,255,255,0.5); font-size: 12px; text-decoration: none; }
.nav-logout:hover { color: #fff; }

/* ── Container ──────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 22px 18px; }

/* ── Page header ────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Stats grid ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--border);
  text-align: center;
}
.stat-card.stat-green { border-top-color: var(--green); }
.stat-card.stat-yellow { border-top-color: var(--yellow); }
.stat-card.stat-blue { border-top-color: var(--brand); }
.stat-card.stat-red { border-top-color: var(--red); }
.stat-card.stat-orange { border-top-color: var(--orange); }
.stat-num { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.stat-inline { font-size: 13px; color: var(--text-muted); }
.stat-inline strong { color: var(--text); }

/* ── Alert boxes ────────────────────────────── */
.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.alert-orange { background: #fef3e2; border: 1px solid #f0ad4e; color: #7d4600; }
.alert-yellow { background: #fffbea; border: 1px solid var(--yellow); color: #5a4000; }
.alert-green { background: #edfaf1; border: 1px solid var(--green); color: #155724; }
.alert-red { background: #fdecea; border: 1px solid var(--red); color: #7d1a1a; }
[data-theme="dark"] .alert-orange { background: #2a1a00; color: #ffc06a; }
[data-theme="dark"] .alert-yellow { background: #201800; color: #ffe08a; }
[data-theme="dark"] .alert-green { background: #0a200f; color: #74d98a; }
[data-theme="dark"] .alert-red { background: #200a0a; color: #f1938a; }

/* ── Table ──────────────────────────────────── */
.table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.table-header h2 { font-size: 16px; font-weight: 600; }
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 20px; }
.mb-3 { margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-2); }
th {
  padding: 9px 12px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.site-link { font-weight: 600; color: var(--brand); text-decoration: none; }
.site-link:hover { text-decoration: underline; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 12px; font-weight: 600; padding: 1px 8px;
}

/* ── Badges ─────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.badge-lead { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-demo { background: #d1ecf1; color: #0c5460; }
.badge-active { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-yellow { background: #fff3cd; color: #7d5a00; }
.badge-red { background: #f8d7da; color: #721c24; }
.badge-green { background: #d4edda; color: #155724; }
.badge-orange { background: #ffe5cc; color: #7d3500; }
.badge-gray { background: var(--surface-2); color: var(--text-muted); }
[data-theme="dark"] .badge-demo { background: #0c3040; color: #6bc8e0; }
[data-theme="dark"] .badge-active { background: #0a2510; color: #60d080; }
[data-theme="dark"] .badge-inactive { background: #2a0a0a; color: #e08080; }
[data-theme="dark"] .badge-yellow { background: #2a1e00; color: #e0b040; }

.score-pill {
  display: inline-block; padding: 2px 7px; border-radius: 12px;
  font-size: 11px; font-weight: 800; color: #fff; margin: 1px;
}
.score-green { background: var(--green); }
.score-yellow { background: var(--yellow); }
.score-red { background: var(--red); }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; padding: 6px 13px;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; line-height: 1.4;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 8px; font-size: 12px; cursor: pointer;
}

/* ── Cards ──────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
}
.card-header {
  padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px;
  color: var(--text);
}
.card-danger .card-header { background: rgba(220,53,69,.08); }

/* ── Detail grids ───────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.detail-grid-3 { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.col-main {}
.col-side {}
@media (max-width: 900px) {
  .detail-grid, .detail-grid-3 { grid-template-columns: 1fr; }
}

/* ── Score display ──────────────────────────── */
.score-block { display: flex; align-items: center; gap: 14px; padding: 14px; }
.score-circle {
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.score-circle.score-green { background: var(--green); }
.score-circle.score-yellow { background: var(--yellow); }
.score-circle.score-red { background: var(--red); }
.score-meta { flex: 1; }
.score-label { font-weight: 700; }

/* ── Tabs ───────────────────────────────────── */
.tab-bar {
  display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); overflow-x: auto;
}
.tab-btn {
  padding: 8px 14px; background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-muted);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--brand); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-content { min-height: 80px; }
.hidden { display: none !important; }

/* ── Check table ────────────────────────────── */
.check-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.check-table th {
  background: var(--surface-2); padding: 7px 10px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.check-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.check-table tr:last-child td { border-bottom: none; }
.check-table td:last-child { text-align: right; color: var(--text-muted); }

/* ── Dots ───────────────────────────────────── */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }

/* ── Issues ─────────────────────────────────── */
.issue-item { padding: 8px 10px; border-left: 3px solid var(--border); margin-bottom: 6px; border-radius: 0 4px 4px 0; }
.issue-critical, .issue-red { border-left-color: var(--red); background: rgba(220,53,69,.06); }
.issue-high { border-left-color: #e74c3c; background: rgba(231,76,60,.06); }
.issue-medium, .issue-yellow { border-left-color: var(--yellow); background: rgba(214,137,16,.06); }
.issue-low, .issue-info { border-left-color: var(--gray); background: var(--surface-2); }
.issue-green { border-left-color: var(--green); background: rgba(40,167,69,.06); }
.issue-title { font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.issue-detail { font-size: 11.5px; color: var(--text-muted); margin-bottom: 2px; }
.issue-action { font-size: 11.5px; color: var(--brand); font-weight: 500; }

/* ── Forms ──────────────────────────────────── */
.form-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.form-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group-btn { justify-content: flex-end; }
.form-group label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,86,179,.15);
}
.form-group small { font-size: 11px; color: var(--text-muted); }
.form-actions { margin-top: 18px; }

/* ── Lead search ────────────────────────────── */
.search-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.search-form {}
.search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.search-row .form-group { flex: 1; min-width: 140px; }
.lead-stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.lead-row-accepted td { background: rgba(40,167,69,.04); }
.lead-row-converted td { background: rgba(0,86,179,.04); }

/* ── Login ──────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 40px; width: 100%; max-width: 370px;
}
.login-logo { font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 4px; text-align: center; }
.login-sub { color: var(--text-muted); font-size: 13px; text-align: center; margin-bottom: 22px; }

/* ── Modal ──────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; min-width: 340px; max-width: 500px; box-shadow: var(--shadow-md); }
.modal-box h3 { margin-bottom: 16px; }

/* ── Empty states ───────────────────────────── */
.empty-state { background: var(--surface); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--text-muted); }
.empty-state p { margin-bottom: 14px; }
.empty-state-sm { padding: 14px; color: var(--text-muted); font-size: 13px; }

/* ── Utilities ──────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }
.small { font-size: 12px; }
details summary { color: var(--text-muted); }
