:root{
  --bg:#0b0b0b;
  --card:#141414;
  --text:#f2f2f2;
  --muted:#a8a8a8;
  --line:#2a2a2a;
  --brand:#ffd100;
  --danger:#ff4d4d;
  --ok:#2ecc71;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:#0f0f0f;
  color:var(--text);
}
a{color:inherit}
.link{color:var(--brand); text-decoration:none}
.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
}
.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:#0c0c0c;
  border-bottom:1px solid var(--line);
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{font-weight:800; letter-spacing:.3px}
.actions{display:flex; gap:8px; flex-wrap:wrap}
h1{margin:12px 0 8px}
h2{margin:18px 0 10px}
.muted{color:var(--muted)}
.small{font-size:12px}
.strong{font-weight:700}
.strike{text-decoration:line-through}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  margin:10px 0;
}
.row{
  display:flex;
  gap:10px;
  align-items:flex-end;
  flex-wrap:wrap;
}
.stack{display:flex; flex-direction:column; gap:10px}
.grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:10px;
}
.grid3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
}
@media (max-width: 820px){
  .grid2,.grid3{grid-template-columns:1fr}
}
label{display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--muted)}
input,select,textarea{
  width:100%;
  padding:10px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#101010;
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#101010;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
}
.btn.primary{background:var(--brand); color:#111; border-color:#e6be00}
.btn.danger{background:transparent; border-color: #5a1d1d; color:var(--danger)}
.btn:hover{filter:brightness(1.05)}

.list{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.list.compact .item{padding:10px}
.item{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  text-decoration:none;
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
}
.title{font-weight:800}
.meta{display:flex; gap:10px; color:var(--muted); font-size:12px; margin-top:4px}
.right{margin-left:auto; text-align:right}

.tablewrap{
  overflow:auto;
  border-radius:14px;
  border:1px solid var(--line);
}
.tbl{
  width:100%;
  border-collapse:collapse;
  min-width:680px;
  background:var(--card);
}
.tbl th,.tbl td{
  padding:10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
}
.tbl th{color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.7px}
.center{text-align:center}
.right{text-align:right}

.pill{
  display:inline-block;
  min-width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid var(--line);
}
.pill.ok{background:rgba(46,204,113,.2); border-color:rgba(46,204,113,.4); color:var(--ok); font-weight:900; line-height:22px}

.kpi .k{color:var(--muted); font-size:12px}
.kpi .v{font-size:22px; font-weight:900; margin-top:4px}
.v.neg{color:#ff7a7a}
.v.pos{color:#7dffb2}

.flashwrap{margin-top:10px; display:flex; flex-direction:column; gap:8px}
.flash{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:#111;
}
.flash.ok{border-color:rgba(46,204,113,.35)}
.flash.error{border-color:rgba(255,77,77,.35)}
