:root {
  --mdp-ink: #0f1c13;
  --mdp-bg: #f6f7f4;
  --mdp-line: #d9dcd3;
  --mdp-line-strong: #2d3b2f;
  --mdp-panel: #ffffff;
  --mdp-deep: #1a2d20;
  --mdp-green: #16a34a;
  --mdp-lime: #22c55e;
  --mdp-muted: #6b7366;
  --mdp-danger: #b91c1c;
  --mdp-warn: #c2410c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--mdp-bg); color: var(--mdp-ink); font-family: 'Outfit', Arial, Helvetica, sans-serif; min-height: 100vh; overflow-x: hidden; font-size: 15px; }
.bg-tech-grid {
  background-image: linear-gradient(90deg, rgba(26,45,32,.04) 1px, transparent 1px), linear-gradient(rgba(26,45,32,.04) 1px, transparent 1px);
  background-position: -1px -1px; background-size: 32px 32px;
}
a { color: var(--mdp-deep); }
.mono, .label, .nav-item, .btn, .chip, th { font-family: monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--mdp-muted); }
.error { color: var(--mdp-danger); margin-top: 8px; }

.top-navbar { background: var(--mdp-panel); box-shadow: 0 0 0 1px var(--mdp-line); padding: 12px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100; flex-wrap: wrap; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo-img { height: 44px; width: auto; }
.brand-title { font-weight: 700; font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-item { color: var(--mdp-muted); text-decoration: none; padding: 8px 10px; border-radius: 4px; background: none; border: 0; cursor: pointer; }
.nav-item:hover { color: var(--mdp-ink); background: var(--mdp-bg); }
.nav-item.active { color: #fff; background: var(--mdp-deep); }

.container { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; }
h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.card { background: var(--mdp-panel); box-shadow: 0 0 0 1px var(--mdp-line); border-radius: 4px; padding: 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.stat { font-size: 32px; font-weight: 700; line-height: 1.1; margin-top: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 4px; border: 0; cursor: pointer; background: var(--mdp-panel); color: var(--mdp-ink); box-shadow: 0 0 0 1px var(--mdp-line-strong); text-decoration: none; }
.btn:hover { background: var(--mdp-bg); }
.btn-primary { background: var(--mdp-deep); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--mdp-line-strong); }
.btn-danger { box-shadow: 0 0 0 1px var(--mdp-danger); color: var(--mdp-danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, textarea { font-family: inherit; font-size: 14px; padding: 9px 10px; border-radius: 4px; border: 0; box-shadow: 0 0 0 1px var(--mdp-line); background: #fff; color: var(--mdp-ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mdp-green); }
textarea { min-height: 120px; font-family: monospace; font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.check input { width: auto; }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 8px 12px; border-radius: 4px; background: var(--mdp-panel); box-shadow: 0 0 0 1px var(--mdp-line); cursor: pointer; border: 0; font-family: monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.tab.active { background: var(--mdp-deep); color: #fff; box-shadow: none; }
.tab .count { opacity: .7; margin-left: 4px; }

.chip { display: inline-block; padding: 3px 7px; border-radius: 4px; background: var(--mdp-bg); box-shadow: 0 0 0 1px var(--mdp-line); margin: 2px 4px 2px 0; }
.chip-green { color: var(--mdp-green); box-shadow: 0 0 0 1px var(--mdp-green); }
.chip-warn { color: var(--mdp-warn); box-shadow: 0 0 0 1px var(--mdp-warn); }
.chip-danger { color: var(--mdp-danger); box-shadow: 0 0 0 1px var(--mdp-danger); }

.meter { height: 8px; background: var(--mdp-bg); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--mdp-line); margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--mdp-green); transition: width .4s ease; }
.meter.warn > span { background: var(--mdp-warn); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--mdp-line); vertical-align: top; }
th { color: var(--mdp-muted); font-weight: 400; }
td { font-size: 14px; }

.company { cursor: pointer; }
.company-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.company-name { font-weight: 600; font-size: 16px; }
.score { font-family: monospace; font-size: 20px; font-weight: 700; }
.company-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--mdp-line); cursor: default; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin-bottom: 12px; font-size: 14px; }
.kv dt { color: var(--mdp-muted); }
.reasons li { margin-left: 18px; margin-bottom: 3px; }
.site-text { white-space: pre-wrap; max-height: 220px; overflow: auto; font-size: 12px; background: var(--mdp-bg); padding: 10px; border-radius: 4px; margin-top: 10px; }

.log { font-family: monospace; font-size: 12px; max-height: 260px; overflow: auto; background: var(--mdp-deep); color: #e8efe6; padding: 12px; border-radius: 4px; white-space: pre-wrap; }
.doc h1 { margin: 18px 0 8px; } .doc h2 { margin: 18px 0 8px; } .doc h3 { margin: 14px 0 6px; font-size: 16px; }
.doc p { margin-bottom: 10px; line-height: 1.55; } .doc ul, .doc ol { margin: 0 0 12px 22px; line-height: 1.55; }
.doc code { background: var(--mdp-bg); padding: 1px 4px; border-radius: 3px; font-size: 13px; }
.doc pre { background: var(--mdp-bg); padding: 12px; border-radius: 4px; overflow-x: auto; margin-bottom: 12px; }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--mdp-deep); color: #fff; padding: 12px 16px; border-radius: 4px; max-width: 420px; z-index: 200; box-shadow: 0 8px 24px rgba(15,28,19,.18); }
.toast.error { background: var(--mdp-danger); }

.login-body { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { margin-top: 12px; }
.login-card form { margin-top: 20px; text-align: left; display: flex; flex-direction: column; gap: 10px; }

.fade { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.fade.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .fade { transition: none; opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .container { padding: 20px 16px 48px; }
  .top-navbar { padding: 10px 16px; }
  .filters { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* Mapa firm (Leaflet) */
.map-pin span, .map-legend .flag {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); box-sizing: border-box;
  background-color: #adb5bd; background-size: cover; background-position: center;
  font: 700 8px/18px system-ui, sans-serif; color: #fff; text-align: center; overflow: hidden;
}
.map-pin span.check, .map-legend .flag.check { border: 3px solid #e03131; line-height: 16px; }
.map-legend > div { display: flex; align-items: center; white-space: nowrap; }
.map-legend b { margin-left: 4px; }
.map-legend .flag { display: inline-block; flex: none; width: 18px; height: 18px; margin-right: 7px; line-height: 14px; }
.map-legend .flag.check { line-height: 12px; }
.map-legend hr { border: 0; border-top: 1px solid #e9ecef; margin: 6px 0; }
.map-legend {
  background: #fff; padding: 10px 12px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); line-height: 1.9;
}
.map-legend .dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: 7px; vertical-align: -1px;
}
.leaflet-popup-content { font-size: 13px; line-height: 1.5; }
