:root{
  --bg:#0f1720; /* dark slate */
  --panel:#131c26;
  --panel-2:#0e1620;
  --text:#e6edf3;
  --muted:#93a4b3;
  --primary:#22d3a6; /* teal */
  --border:#1e2a36;
  --warn:#f59e0b;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial, "Noto Sans",sans-serif;
  background:var(--bg); color:var(--text);
}
.container{max-width:1400px; margin:24px auto; padding:0 16px}

.grid{display:grid; grid-template-columns: 1fr 1fr; gap:24px; align-items:stretch}
.card{background:var(--panel); padding:24px; border-radius:12px; border:1px solid var(--border); height: 100%; display: flex; flex-direction: column;}
.column-gap { display: flex; flex-direction: column; gap: 24px; }
.column-gap .card { flex: 1; }

.step-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--panel-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.step-name { font-weight: 500; }
.step-status { font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
.step-status.passed { color: var(--primary); }
.step-status.failed { color: #ef4444; }
.span-2{grid-column: span 2}

.main-header { margin-bottom: 24px; }
.main-header h1 { margin: 0; font-size: 1.8rem; font-weight: 700; color: #fff; }
.main-header p { margin: 4px 0 0; font-size: 1rem; }

.tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.tab-btn { 
    background: #1a2633; color: var(--muted); border: 1px solid var(--border); 
    border-radius: 8px; padding: 10px 18px; cursor: pointer; font-weight: 600;
}
.tab-btn.active { background: #22d3a620; color: var(--primary); border-color: var(--primary); }

.row{display:flex; gap:16px; margin-top:12px}
.btn{
  background:#1e2a36; color:var(--text); border:1px solid var(--border);
  padding:10px 20px; border-radius:8px; cursor:pointer; font-weight:600;
  transition: all 0.2s;
}
.btn:hover:not(:disabled){background:#2a3a4a; border-color:var(--muted)}
.btn.primary{background:var(--primary); color:#000; border:none}
.btn.primary:hover:not(:disabled){background:#2de8b7}
.btn.small{padding:6px 12px; font-size:0.85rem}
.btn:disabled{opacity:0.4; cursor:not-allowed}

.input{
  background:var(--panel-2); color:var(--text); border:1px solid var(--border);
  padding:10px 12px; border-radius:8px; outline:none; font-family:inherit;
}
.input:focus{border-color:var(--primary)}
.input.input-required{
  border-color:var(--warn);
  box-shadow:0 0 0 2px rgba(245,158,11,0.2);
  animation:pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border{
  0%,100%{box-shadow:0 0 0 2px rgba(245,158,11,0.2)}
  50%{box-shadow:0 0 0 4px rgba(245,158,11,0.3)}
}
.input-hint{
  display:none;
  color:var(--warn);
  font-size:0.85rem;
  margin-top:4px;
  font-weight:500;
}

.status{font-weight:700; font-size:1.2rem; margin-top:4px}
.status.ok{color:var(--primary)}
.mark{display:inline-block; width:10px; height:10px; border-radius:50%; background:#1e2a36}
.mark.ok{background:var(--primary)}

.terminal{
  background:#05080a; padding:16px; border-radius:8px; height:360px;
  overflow-y:auto; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:13px; line-height:1.6; border:1px solid var(--border);
}
.terminal div{margin-bottom:2px; white-space:pre-wrap; word-break:break-all}

.log-i{color:var(--primary)}
.log-w{color:var(--warn)}
.log-e{color:#ef4444}
.log-d{color:#8b5cf6}
.log-v{color:#94a3b8}

.list{margin-top:16px; display:flex; flex-direction:column; gap:8px}
.list-item{background:var(--panel-2); padding:12px 16px; border-radius:8px; border:1px solid var(--border)}

.meas-input-group { display: flex; flex-direction: column; gap: 4px; }
.meas-row { display: flex; align-items: center; gap: 8px; }
.meas-row .input { width: 100%; }

.history-controls { 
    display: flex; align-items: center; gap: 16px; margin-bottom: 16px; 
    background: var(--panel); padding: 16px; border-radius: 10px; border: 1px solid var(--border);
}
.search-box, .filter-box { position: relative; display: flex; align-items: center; }
.search-box .icon, .filter-box .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input, .filter-box select { 
    background: var(--panel-2); color: var(--text); border: 1px solid var(--border); 
    border-radius: 8px; padding: 10px 12px 10px 36px; outline: none;
}
.filter-box select { appearance: none; padding-right: 36px; min-width: 150px; }
.stats { margin-left: auto; display: flex; gap: 16px; font-size: 0.9rem; color: var(--muted); }
.stats strong { color: var(--text); }

.history-table-container { 
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; 
}
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9rem; }
.history-table th { background: #1a2633; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.history-table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover { background: #ffffff05; }

.status-badge { 
    padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.status-badge.passed { background: #22d3a620; color: #22d3a6; }
.status-badge.failed { background: #ef444420; color: #ef4444; }

.meas-val { font-family: ui-monospace, monospace; }
.meas-val.ok { color: #22d3a6; }
.meas-val.warn { color: #f59e0b; }
.meas-val.err { color: #ef4444; }

.download-btn { 
    background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px;
}
.download-btn:hover { background: #ffffff10; color: var(--text); }

.result-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.expand-btn:hover {
    background: #ffffff10;
    color: var(--text);
}

.expand-btn.expanded {
    transform: rotate(180deg);
}

.detail-row {
    background: #00000020;
}

.detail-content {
    padding: 8px 24px 24px 24px;
}

.detail-content h4 {
    margin: 0 0 12px 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.step-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--panel-2);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.step-detail-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.step-detail-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.step-detail-status.passed { color: var(--primary); }
.step-detail-status.failed { color: #ef4444; }

.autotest-icon { width: 18px; height: 18px; color: #22d3a6; }

@media (max-width: 800px){
  .grid{grid-template-columns: 1fr}
  .span-2{grid-column:auto}
}
