:root{
  --bg: #0b0d12;
  --panel: #101521;
  --panel2:#0f1320;
  --text: #e9eefc;
  --muted:#a9b4d0;
  --muted2:#7f8aa6;
  --border:#26304a;
  --accent:#8ab4ff;
  --good:#44d19d;
  --warn:#f7c66a;
  --bad:#ff6b6b;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --radius2: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(138,180,255,.18), transparent 60%),
    radial-gradient(900px 700px at 110% 0%, rgba(68,209,157,.12), transparent 55%),
    radial-gradient(900px 700px at 20% 110%, rgba(255,107,107,.10), transparent 55%),
    var(--bg);
}

a{ color:inherit; text-decoration:none; }

.app{
  max-width:1200px;
  margin:0 auto;
  padding:24px 18px 40px;
}

header{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:18px;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.logo{
  width:44px; height:44px;
  border-radius:12px;
  background: linear-gradient(135deg, rgba(138,180,255,.95), rgba(68,209,157,.85));
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}
.logo:after{
  content:"";
  position:absolute;
  inset:-30%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.7), transparent 45%);
  transform: rotate(18deg);
  opacity:.35;
}

.brand h1{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
}
.brand p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  background: rgba(16,21,33,.75);
  border:1px solid var(--border);
  border-radius:999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}

.btn{
  cursor:pointer;
  border:none;
  color:var(--text);
  background: rgba(16,21,33,.75);
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:999px;
  font-weight:600;
  font-size:13px;
  transition: transform .06s ease, border-color .2s ease, background .2s ease;
  display:inline-flex;
  align-items:center;
  gap:8px;
  user-select:none;
}
.btn:hover{ border-color: rgba(138,180,255,.55); background: rgba(16,21,33,.9); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(138,180,255,.22), rgba(68,209,157,.18));
  border-color: rgba(138,180,255,.35);
}
.btn.ghost{
  background: transparent;
}

.input{
  width:320px;
  max-width: 62vw;
  padding:10px 12px;
  border-radius:999px;
  background: rgba(16,21,33,.65);
  border:1px solid var(--border);
  color:var(--text);
  outline:none;
}
.input::placeholder{ color: rgba(169,180,208,.65); }

.grid{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
  margin-top:14px;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .input{ width:100%; max-width:100%; }
  header{ flex-direction:column; align-items:stretch; }
  .top-actions{ justify-content:space-between; }
}

.panel{
  background: rgba(16,21,33,.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  backdrop-filter: blur(10px);
}

.panel-header{
  padding:14px 14px 12px;
  border-bottom:1px solid rgba(38,48,74,.7);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.panel-header h2{
  margin:0;
  font-size:14px;
  letter-spacing:.2px;
  color: var(--text);
}
.panel-header .sub{
  color:var(--muted2);
  font-size:12px;
  margin-top:4px;
}

.filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding:12px 14px;
  border-bottom: 1px solid rgba(38,48,74,.55);
  background: rgba(15,19,32,.7);
}

.tag{
  cursor:pointer;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(16,21,33,.55);
  color:var(--muted);
  font-size:12px;
  user-select:none;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .06s ease;
}
.tag:hover{ border-color: rgba(138,180,255,.55); color: var(--text); }
.tag:active{ transform: translateY(1px); }
.tag.active{
  color: var(--text);
  border-color: rgba(138,180,255,.55);
  background: linear-gradient(135deg, rgba(138,180,255,.16), rgba(68,209,157,.10));
}

.list{
  max-height: 68vh;
  overflow:auto;
}

.item{
  padding:12px 14px;
  border-bottom:1px solid rgba(38,48,74,.5);
  display:flex;
  gap:12px;
  cursor:pointer;
  transition: background .15s ease;
}
.item:hover{ background: rgba(138,180,255,.06); }
.item.active{ background: rgba(138,180,255,.10); }

.badge{
  min-width:58px;
  height:58px;
  border-radius: 14px;
  background: rgba(138,180,255,.10);
  border:1px solid rgba(138,180,255,.22);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  font-family:var(--mono);
  line-height:1.1;
}
.badge .wk{ font-size:12px; color: var(--muted); }
.badge .num{ font-size:16px; font-weight:800; color: var(--text); }

.meta{
  flex:1;
  min-width:0;
}
.meta .title{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.meta h3{
  margin:0;
  font-size:13px;
  font-weight:750;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.meta .date{
  font-size:12px;
  color: var(--muted2);
  white-space:nowrap;
}
.meta .desc{
  margin:6px 0 0;
  font-size:12px;
  color: var(--muted);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.chips{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:8px;
}
.chip{
  font-size:11px;
  color: rgba(233,238,252,.9);
  border:1px solid rgba(38,48,74,.9);
  background: rgba(15,19,32,.55);
  padding:4px 8px;
  border-radius:999px;
}

.detail{
  padding:14px;
}

.hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.hero h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}
.hero .small{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}
@media (max-width: 980px){
  .kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .kpis{ grid-template-columns: 1fr; }
}

.kpi{
  border:1px solid rgba(38,48,74,.8);
  background: rgba(15,19,32,.55);
  border-radius: var(--radius2);
  padding:12px 12px 10px;
  min-height: 78px;
}
.kpi .label{
  color: var(--muted2);
  font-size:11px;
  letter-spacing:.2px;
}
.kpi .value{
  margin-top:6px;
  font-size:18px;
  font-weight:850;
  letter-spacing:.2px;
}
.kpi .delta{
  margin-top:6px;
  font-size:11px;
  color: var(--muted);
  display:flex;
  gap:6px;
  align-items:center;
}
.dot{
  width:8px; height:8px;
  border-radius:999px;
  background: var(--muted2);
  display:inline-block;
}
.dot.good{ background: var(--good); }
.dot.warn{ background: var(--warn); }
.dot.bad{ background: var(--bad); }

.section{
  margin-top:12px;
  border-top:1px solid rgba(38,48,74,.55);
  padding-top:12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 980px){
  .section{ grid-template-columns: 1fr; }
}

.card{
  border:1px solid rgba(38,48,74,.8);
  background: rgba(15,19,32,.55);
  border-radius: var(--radius2);
  padding:12px;
}
.card h4{
  margin:0 0 10px;
  font-size:13px;
  letter-spacing:.2px;
}

.ul{
  margin:0;
  padding-left:18px;
  color: var(--muted);
  font-size:12px;
  line-height:1.7;
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 10px;
}
.table th, .table td{
  border-bottom: 1px solid rgba(38,48,74,.55);
  padding:10px 8px;
  font-size:12px;
  text-align:left;
  vertical-align:top;
}
.table th{
  color: var(--muted2);
  font-weight:700;
  background: rgba(16,21,33,.55);
}
.table td{
  color: var(--text);
}
.table tr:last-child td{ border-bottom: none; }
.mono{ font-family:var(--mono); }

.empty{
  padding:22px 14px;
  color: var(--muted);
  font-size:13px;
  line-height:1.6;
}

/* Print (PDF) */
@media print{
  body{ background:#fff; color:#111; }
  .app{ max-width: 980px; }
  header, .panel-header .right, .filters, #listPanel{ display:none !important; }
  .grid{ grid-template-columns: 1fr; }
  .panel{ border:1px solid #ddd; box-shadow:none; background:#fff; }
  .kpi, .card{ border:1px solid #ddd; background:#fff; }
  .table th{ background:#f6f6f6; }
  a{ color:#111; }
}
