:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --ink:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --brand:#0ea5e9;
  --good:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --radius:14px;
  --shadow: 0 8px 24px rgba(17,24,39,.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font: 13px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
}

/* ===== HEADER like screenshot ===== */
header{
  background:#ffffff;
  border-bottom:1px solid var(--line);
  padding:8px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:sticky; top:0; z-index:2;
  box-shadow:0 2px 8px rgba(17,24,39,.05);
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.head-left{
  display:flex; align-items:center; gap:10px;
  min-width:0;
}
.brandbox{
  width:44px;height:44px;border-radius:10px;
  background:#0ea5e9;
  display:grid;place-items:center;
  color:#fff;font-weight:900;
  box-shadow: inset 0 0 0 3px #e2f3ff;
}
.brandbox:after{
  content:"E";
  font-size:20px;
  font-weight:1000;
  letter-spacing:.5px;
}
.head-title{display:flex; flex-direction:column;}
.head-title .top{font-size:15px; font-weight:900; letter-spacing:.2px;}
.head-title .sub{font-size:11px; color:var(--muted); font-weight:700;}
.head-chip{
  font-size:12px; font-weight:800; color:#111827;
  background:#f3f4f6;
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:10px;
  white-space:nowrap;
}

.container{
  max-width:1500px;
  margin:12px auto 10px;
  padding:0 12px;
  display:grid; gap:12px;
}

/* ===== Drag visuals ===== */
[draggable="true"]{ cursor:grab; }
.dragging{ opacity:.55; cursor:grabbing; }
.drop-indicator{
  height:10px;
  border:2px dashed var(--brand);
  border-radius:8px;
  margin:4px 0;
  background:rgba(14,165,233,.08);
}

/* Top KPIs */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:10px;
}
.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  border:1px solid #fff;
}
.kpi-wrap{ display:flex; flex-direction:column; }
.kpi{
  padding:12px 12px 10px;
  display:flex; flex-direction:column; gap:8px;
  min-height:132px;
}
.kpi .title{
  font-size:11px; color:var(--muted); font-weight:800;
  letter-spacing:.3px; text-transform:uppercase;
  display:flex; align-items:center; justify-content:space-between; gap:6px;
}
.kpi .value{font-size:20px; font-weight:900; letter-spacing:.2px;}
.kpi .spark{font-size:11px;color:var(--muted)}
.kpi .sub{
  margin-top:auto;
  background:#f9fafb;
  border:1px dashed var(--line);
  padding:7px 8px; border-radius:10px;
  display:grid; gap:5px; font-size:11px;
}
.delta{font-weight:800; display:flex; align-items:center; gap:6px;}
.up{color:var(--good)} .down{color:var(--bad)} .neutral{color:var(--muted)}
.pill{
  font-size:10px; font-weight:800;
  padding:2px 6px; border-radius:7px;
  background:#eef2ff; color:#3730a3; white-space:nowrap;
}

/* Notes block */
.notes{
  padding:10px 12px;
  border-top:1px solid var(--line);
  background:#fbfbfd;
  border-radius:0 0 var(--radius) var(--radius);
  font-size:11px; color:#374151;
  display:grid; gap:6px;
}
.notes .label{
  font-weight:900;color:#111827;font-size:11px;letter-spacing:.2px;text-transform:uppercase;
}
.notes ul{margin:0;padding-left:16px;display:grid;gap:4px}
.notes code{background:#1118270d; padding:1px 4px; border-radius:4px; font-weight:700;}

/* Layout groups */
.row{
  display:grid; gap:10px;
  grid-template-columns: 1.6fr 1fr;
  align-items:start;
}
.row.three{ grid-template-columns: 1fr 1fr 1fr; }
.panel{ padding:10px; }
.panel h3{
  margin:2px 0 8px; font-size:13px; font-weight:900;
  display:flex; align-items:center; gap:8px;
}
.panel h3 span{color:var(--muted); font-weight:600; font-size:11px;}
.muted{color:var(--muted)}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-size:11px;
}
thead th{
  background:#111827; color:#fff; text-align:left;
  padding:8px 7px; font-weight:800; white-space:nowrap;
  position:sticky; top:0;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
tbody td{
  padding:7px; border-top:1px solid var(--line);
  vertical-align:middle; white-space:nowrap;
}
tbody tr:hover{background:#fafafa}
.indent{padding-left:18px;color:#374151}
.group{font-weight:900;background:#f3f4f6;}

.badge{
  font-weight:900; font-size:10px; padding:2px 6px; border-radius:999px; display:inline-block;
  border:1px solid transparent; letter-spacing:.2px;
}
.b-auto{background:#ecfdf5;color:#065f46;border-color:#a7f3d0;}
.b-man{background:#fff7ed;color:#9a3412;border-color:#fed7aa;}
.b-sla{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
.b-apdex-good{background:#ecfdf5;color:#065f46;}
.b-apdex-mid{background:#fff7ed;color:#9a3412;}
.b-apdex-bad{background:#fef2f2;color:#991b1b;}

.chart-wrap{
  display:grid; grid-template-columns: 220px 1fr;
  gap:8px; align-items:center;
}
.legend{display:grid; gap:7px; font-size:11px;}
.legend .item{display:flex; align-items:center; gap:7px;}
.dot{width:9px;height:9px;border-radius:50%; background:var(--brand);}

footer{
  max-width:1500px;
  margin:0 auto 14px;
  padding:8px 12px;
  color:#374151;
  font-size:10.5px;
  display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
footer .box{
  background:#fff; border:1px solid var(--line); border-radius:10px;
  padding:6px 8px; display:flex; gap:10px; align-items:center;
}
footer .sep{opacity:.5}

/* ====== CONSTRUCTOR ADDONS (does not change look) ====== */

/* blocks grid = dashboardRoot->blocksGrid */
.blocks-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

/* each draggable section wrapper */
.block-wrap{
  position:relative;
}

/* resize handle bottom-right */
.resize-handle{
  position:absolute;
  right:6px; bottom:6px;
  width:14px; height:14px;
  border-radius:3px;
  background:rgba(17,24,39,.12);
  cursor:se-resize;
  border:1px solid rgba(17,24,39,.25);
}

/* mini buttons for CRUD */
.mini{
  font-size:10.5px; font-weight:800;
  padding:4px 6px; border-radius:6px;
  border:1px solid var(--line);
  background:#fff; cursor:pointer;
}
.mini.danger{ background:#fff1f2; border-color:#fecdd3; color:#9f1239; }

/* inline editing highlight */
.editable[contenteditable="true"],
[data-edit][contenteditable="true"]{
  outline:2px dashed transparent;
  border-radius:6px;
  padding:2px 4px;
}
.editable[contenteditable="true"]:focus,
[data-edit][contenteditable="true"]:focus{
  outline-color:#0ea5e9;
  background:#f8fbff;
}

/* PDF/PRINT */
@page { size: A4 landscape; margin: 9mm; }
@media print {
  body{ background:#fff; }
  header{ position:static; box-shadow:none; }
  .container{ max-width:none; margin:0; padding:0; gap:8px; }
  footer{ max-width:none; margin:0; padding:6px 0; }
  .card{ box-shadow:none; border:1px solid #d1d5db; }
  thead th{ position:static; }
  .card, table, .panel, section { break-inside: avoid; page-break-inside: avoid; }
  .drop-indicator, .mini, .resize-handle{ display:none !important; }
}

@media (max-width:1200px){
  .kpi-grid{grid-template-columns: repeat(3,1fr)}
  .row, .row.three{grid-template-columns:1fr}
}
