:root{
  --bg:#0b1220;
  --card:#121b2f;
  --card2:#0f1830;
  --text:#e6ecff;
  --muted:#9bb0d6;
  --line:rgba(255,255,255,.08);
  --ok:#22c55e;
  --fail:#ef4444;
  --warn:#f59e0b;
  --btn:#2b6cff;
  --btn2:#243556;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:linear-gradient(180deg, #071025, #070b13);
  color:var(--text);
}
a{color:inherit}
.small{font-size:.85rem}
.muted{color:var(--muted)}

.topbar{
  display:flex;
  gap:14px;
  justify-content:space-between;
  align-items:center;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  background:rgba(7,11,19,.86);
  backdrop-filter: blur(10px);
  z-index:10;
}
.brand{font-weight:700; font-size:1.05rem}
.sub{color:var(--muted); font-size:.9rem; margin-top:2px}
.topbar__left{display:flex; flex-direction:column}
.topbar__right{display:flex; gap:10px; flex-wrap:wrap}

.container{
  max-width:1200px;
  margin:0 auto;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.panel{
  background:rgba(18,27,47,.7);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.panel__header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
h2{margin:0; font-size:1.05rem}

.grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (max-width: 640px){
  .grid{grid-template-columns:1fr;}
}

.card{
  background:rgba(15,24,48,.65);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.card__title{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.title{
  font-weight:700;
  line-height:1.2;
}
.badge{
  padding:4px 8px;
  border-radius:999px;
  font-size:.8rem;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
}
.badge.ok{border-color:rgba(34,197,94,.45); color:#b6ffd1}
.badge.fail{border-color:rgba(239,68,68,.45); color:#ffd0d0}
.badge.running{border-color:rgba(245,158,11,.5); color:#ffe7b1}
.card__meta{color:var(--muted); font-size:.9rem}
.card__actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.toggle{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:.9rem;
  margin-top:4px;
}

.btn{
  border:1px solid var(--line);
  border-radius:10px;
  padding:9px 12px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{filter:brightness(1.08)}
.btn-primary{
  background:rgba(43,108,255,.22);
  border-color:rgba(43,108,255,.45);
}
.btn-secondary{
  background:rgba(36,53,86,.35);
  border-color:rgba(36,53,86,.7);
}
.btn-danger{
  background:rgba(239,68,68,.18);
  border-color:rgba(239,68,68,.5);
}

.actions{display:flex; gap:10px; flex-wrap:wrap}

.tablewrap{overflow:auto; border-radius:12px; border:1px solid var(--line)}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}
.table th, .table td{
  padding:10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:.92rem;
}
.table thead th{
  position:sticky;
  top:0;
  background:rgba(7,11,19,.85);
  backdrop-filter: blur(8px);
  text-align:left;
}
.table td { white-space: normal; word-break: break-word; }

.status-ok{color:#b6ffd1}
.status-fail{color:#ffd0d0}
.status-running{color:#ffe7b1}

.shots{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 980px){ .shots{grid-template-columns:repeat(3,1fr);} }
@media (max-width: 720px){ .shots{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 420px){ .shots{grid-template-columns:1fr;} }

.shot{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:rgba(15,24,48,.55);
}
.shot img{width:100%; height:auto; display:block}
.shot .cap{
  padding:8px;
  color:var(--muted);
  font-size:.82rem;
  word-break:break-all;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(0,0,0,.55);
  z-index:50;
}
.hidden{display:none}

.modal__card{
  width:min(560px, 100%);
  background:rgba(18,27,47,.95);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
.modal__card--wide{
  width:min(900px, 100%);
}
.modal__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
}
.modal__body{padding:14px; display:flex; flex-direction:column; gap:12px}
.modal__foot{
  padding:12px 14px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.iconbtn{
  width:36px; height:36px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-size:20px;
  line-height:0;
}

.field{display:flex; flex-direction:column; gap:6px}
.field label{color:var(--muted); font-size:.9rem}
.field input{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.field input:focus{border-color:rgba(43,108,255,.55)}

.row{flex-direction:row; align-items:center}
.chk{display:flex; align-items:center; gap:10px; color:var(--muted)}
.chk input{width:18px; height:18px}

.dangerzone{
  margin-top:6px;
  padding:10px;
  border-radius:14px;
  border:1px dashed rgba(239,68,68,.55);
  background:rgba(239,68,68,.08);
}
.dangerzone__title{font-weight:700; margin-bottom:8px}
.dangerzone__row{display:flex; gap:12px; align-items:center; flex-wrap:wrap}
