/* Projekt10M Dashboard — editorial dark with green accent (Lindens-coherent) */
:root {
  --bg: #0b1220;
  --bg-2: #0f1729;
  --panel: #131c33;
  --panel-2: #182241;
  --border: #1f2a48;
  --border-soft: #1a2440;
  --text: #e7ecf5;
  --text-soft: #b0bbd1;
  --muted: #7e8aa6;
  --accent: #10b981;          /* Lindens green */
  --accent-soft: rgba(16,185,129,0.14);
  --blue: #3b82f6;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --radius: 14px;
  --radius-sm: 10px;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-grid {
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(16,185,129,0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(59,130,246,0.08), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* ============ Header ============ */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border-radius: 12px;
  display: grid; place-items: center;
  color: #0b1220; font-weight: 800; font-size: 16px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 18px rgba(16,185,129,0.25);
}
.top h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.top .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(16,185,129,0.25);
  font-family: var(--font-mono);
}
.muted { color: var(--muted); font-size: 13px; }

/* ============ KPIs ============ */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 22px 28px 8px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.kpi::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  opacity: .9;
}
.kpi[data-key="deals_closed"]::before { background: var(--blue); }
.kpi[data-key="sites_in_build"]::before { background: var(--amber); }
.kpi[data-key="live_sites"]::before { background: var(--violet); }
.kpi:hover { transform: translateY(-2px); border-color: #2a3760; }
.kpi-label { color: var(--text-soft); font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.kpi-value { font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 6px; letter-spacing: -0.02em; }
.kpi-foot { color: var(--muted); font-size: 12.5px; margin-top: 6px; min-height: 16px; }

/* ============ Grid ============ */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 16px 28px 32px;
}
.main-col, .side-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ============ Card ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 12px;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.head-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.head-tools input, .head-tools select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  min-width: 140px;
  outline: none;
  transition: border-color .15s ease;
}
.head-tools input:focus, .head-tools select:focus {
  border-color: var(--accent);
}
.head-tools input::placeholder { color: var(--muted); }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; max-height: 520px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}
thead th {
  position: sticky; top: 0;
  background: var(--panel-2);
  color: var(--text-soft);
  text-align: left;
  font-weight: 600;
  padding: 11px 16px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  z-index: 1;
  white-space: nowrap;
}
tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
.firma { font-weight: 600; color: var(--text); }
.firma small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-new       { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-contacted { background: rgba(139,92,246,0.15); color: #c4b5fd; }
.badge-qualified { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-build_queue,
.badge-proposal_ready { background: rgba(245,158,11,0.18); color: #fcd34d; }
.badge-review    { background: rgba(139,92,246,0.18); color: #c4b5fd; }
.badge-closed    { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.badge-deployed  { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.badge-checked   { background: rgba(176,187,209,0.14); color: #b0bbd1; }
.badge-no_site   { background: rgba(244,63,94,0.15); color: #fda4af; }
.badge-skipped   { background: rgba(126,138,166,0.18); color: var(--muted); }
.badge-phantom   { background: rgba(59,130,246,0.12); color: #93c5fd; }
.badge-email_pending { background: rgba(245,158,11,0.18); color: #fcd34d; }

.score {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  min-width: 36px;
  text-align: center;
}
.score-hi  { border-color: var(--accent); color: var(--accent); }
.score-mid { border-color: var(--amber); color: var(--amber); }

.url-cell { font-family: var(--font-mono); font-size: 12px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--accent); }

.table-foot { padding: 10px 20px; margin: 0; font-size: 12px; }

/* ============ Feed ============ */
.feed { list-style: none; margin: 0; padding: 8px 0; max-height: 480px; overflow-y: auto; }
.feed li {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; gap: 12px; align-items: flex-start;
}
.feed li:last-child { border-bottom: none; }
.feed-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.feed-dot.dot-fail { background: var(--rose); }
.feed-dot.dot-deploy { background: var(--accent); }
.feed-content { min-width: 0; flex: 1; }
.feed-label { font-weight: 500; font-size: 13px; }
.feed-meta { color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); margin-top: 3px; word-break: break-all; }
.feed-time { color: var(--muted); font-size: 11.5px; }

/* ============ Bars ============ */
.bars { list-style: none; margin: 0; padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.bar-row .bar-key { color: var(--text-soft); }
.bar-row .bar-val { color: var(--muted); font-family: var(--font-mono); }
.bar-track {
  width: 100%; height: 4px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 4px;
}

/* ============ Footer ============ */
.foot {
  padding: 20px 28px 32px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.foot p { margin: 4px 0; }
code {
  font-family: var(--font-mono);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border-soft);
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .side-col { order: 2; }
}
@media (max-width: 720px) {
  .top { padding: 16px 18px; }
  .top h1 { font-size: 18px; }
  .kpis { grid-template-columns: repeat(2, 1fr); padding: 16px 18px 4px; gap: 12px; }
  .kpi-value { font-size: 28px; }
  .grid { padding: 12px 18px 24px; gap: 16px; }
  .card-head { padding: 14px 16px; }
  .head-tools input, .head-tools select { min-width: 0; flex: 1; }
  thead th, tbody td { padding: 10px 12px; font-size: 12.5px; }
  .table-foot { padding: 10px 16px; }
  .feed li { padding: 10px 16px; }
  .bars { padding: 10px 16px 14px; }
  .foot { padding: 18px 18px 24px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; }
}
