/* AusdauerLab v4.3 – Dark & readable */
:root{
  --bg:#0b1020;
  --card:rgba(255,255,255,0.06);
  --line:rgba(255,255,255,0.14);
  --txt:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.70);
  --accent:#7aa7ff;
  --good:#3bd37b;
  --warn:#ffcc66;
  --bad:#ff6b6b;
  --shadow:0 18px 60px rgba(0,0,0,0.55);
  --r:18px;
  --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;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--txt);
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(122,167,255,0.22), transparent 55%),
    radial-gradient(900px 600px at 95% 8%, rgba(59,211,123,0.16), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(255,204,102,0.10), transparent 60%),
    var(--bg);
}
body.phase-done{
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(59,211,123,0.24), transparent 55%),
    radial-gradient(900px 600px at 95% 8%, rgba(122,167,255,0.10), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(59,211,123,0.12), transparent 60%),
    var(--bg);
}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; gap:12px; align-items:center;
  padding:12px 14px;
  background: rgba(8,10,18,0.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,0.10);
}
.brand{display:flex; align-items:center; gap:12px; min-width:240px;}
.brand-mark{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center;
  border-radius:14px;
  background: linear-gradient(135deg, rgba(122,167,255,0.28), rgba(59,211,123,0.20));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  font-size:22px;
}
.brand-title{font-weight:950}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}
.topbar-actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}

.wrap{max-width:1100px; margin:0 auto; padding:16px;}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color:var(--txt);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
  transition: transform .08s ease, border-color .2s ease, background .2s ease;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(122,167,255,0.55); background: rgba(255,255,255,0.08);}
.btn:active{transform: translateY(0px);}
.btn.primary{background: rgba(122,167,255,0.20); border-color: rgba(122,167,255,0.55);}
.btn.ghost{background: rgba(255,255,255,0.04);}
.btn.danger{background: rgba(255,107,107,0.18); border-color: rgba(255,107,107,0.55);}
.btn.small{padding:7px 10px; font-size:12px; border-radius:10px;}

.panel,.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding:14px;
}
.panel-title{font-weight:950; margin-bottom:8px;}
.muted{color:var(--muted);}
.tiny{font-size:12px;}

.hero{
  padding:18px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(122,167,255,0.16), rgba(59,211,123,0.10));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero h1{margin:0 0 6px 0; font-size:26px;}
.module-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px;
}
@media (max-width:980px){ .module-grid{grid-template-columns:1fr;} }
.module-btn{
  text-align:left;
  padding:16px;
  border-radius:22px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  cursor:pointer;
}
.module-btn:hover{border-color: rgba(122,167,255,0.55); background: rgba(255,255,255,0.08);}
.module-title{font-size:18px; font-weight:950;}
.module-sub{margin-top:6px; color:var(--muted); font-size:13px; line-height:1.35;}

.row{display:flex; gap:10px; align-items:center;}
.row.right{justify-content:flex-end;}
.row.wraprow{flex-wrap:wrap;}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
@media (max-width:980px){ .grid2{grid-template-columns:1fr;} }

.field{display:flex; flex-direction:column; gap:6px; min-width:190px;}
.field span{font-size:12px; color:var(--muted); font-weight:900; text-transform:uppercase; letter-spacing:.6px;}

input,select{
  padding:10px 12px;
  border-radius:12px;
  border:2px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:var(--txt);
  font-weight:900;
}
input:focus{outline:none; border-color: rgba(122,167,255,0.75);}

input.req{
  border-color: rgba(255,107,107,0.85);
  background: rgba(255,107,107,0.10);
}
input.req.valid{
  border-color: rgba(59,211,123,0.85);
  background: rgba(59,211,123,0.10);
}

.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  font-weight:950; font-size:12px;
}
.badge.good{border-color: rgba(59,211,123,0.45); background: rgba(59,211,123,0.10);}
.badge.warn{border-color: rgba(255,204,102,0.45); background: rgba(255,204,102,0.10);}
.badge.bad{border-color: rgba(255,107,107,0.45); background: rgba(255,107,107,0.10);}

.canvas-wrap{
  background: rgba(0,0,0,0.35);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
}
canvas{width:100%; height:auto; display:block; border-radius:14px;}

.table{width:100%; border-collapse:collapse; font-size:14px;}
.table th,.table td{border-bottom:1px solid rgba(255,255,255,0.10); padding:10px 8px; vertical-align:top;}
.table th{font-weight:950; background: rgba(255,255,255,0.04);}

.modal::backdrop{ background: rgba(0,0,0,0.6); }
.modal-card{
  width:min(760px, calc(100vw - 24px));
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.16);
  background: rgba(12,16,30,0.96);
  box-shadow: var(--shadow);
}
.modal-title{font-weight:950; font-size:18px; margin-bottom:8px;}
.modal-body{color: rgba(255,255,255,0.86);}

.qrbox{margin-top:14px; display:flex; flex-direction:column; align-items:flex-start;}
.qrTarget{
  width:256px; height:256px;
  display:flex; align-items:center; justify-content:center;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  overflow:hidden;
}


/* v4.3.3 hotfix: iOS/table inputs sometimes render black text – force it */
input, select, textarea{
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt);
}
input::placeholder, textarea::placeholder{
  color: rgba(255,255,255,0.55);
}
.table input{
  width: 100%;
  background: rgba(255,255,255,0.06) !important;
  color: var(--txt) !important;
  -webkit-text-fill-color: var(--txt);
}
