:root{
  --bg:#08111f;
  --panel:rgba(19,31,51,.84);
  --line:#294363;
  --accent:#4ea6ff;
  --text:#edf4ff;
  --muted:#9ab2cc;
  --danger:#f87171;
}
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Segoe UI,Arial,sans-serif
}
body{
  min-height:100vh;
  background:radial-gradient(circle at top,#13253f,#08111f 60%);
  color:var(--text)
}
.login-page{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px
}
.login-card{
  width:min(460px,100%);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:22px;
  padding:42px;
  box-shadow:0 25px 70px rgba(0,0,0,.35)
}
.brand-mark{
  display:inline-block;
  padding:6px 10px;
  margin-bottom:18px;
  border:1px solid var(--accent);
  border-radius:8px;
  color:#9dd3ff;
  font-weight:700;
  letter-spacing:1px
}
.login-card h1{
  font-size:32px;
  margin-bottom:12px
}
.login-card p{
  color:var(--muted);
  margin-bottom:30px
}
.login-card label{
  display:block;
  margin:16px 0 7px;
  color:#c7d9ed
}
.login-card input{
  width:100%;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#0d1b30;
  color:#fff;
  font-size:16px
}
.login-card input:focus{
  outline:2px solid var(--accent);
  border-color:transparent
}
button{
  background:linear-gradient(135deg,#2563eb,#0ea5e9);
  border:none;
  color:#fff;
  padding:9px 14px;
  border-radius:9px;
  cursor:pointer;
  font-size:14px
}
button:disabled{
  opacity:.65;
  cursor:wait
}
.login-card button{
  width:100%;
  margin-top:22px
}
.api-state{
  text-align:center;
  margin-top:18px;
  color:var(--muted);
  font-size:14px
}
.api-state.online{color:#79ffb1}
.api-state.offline{color:var(--danger)}
.message{min-height:22px;margin-top:12px}
.error-message{color:var(--danger)}
.visible{
  padding:10px;
  border:1px solid rgba(248,113,113,.45);
  border-radius:10px
}

/* Górny pasek */
.top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:58px;
  padding:10px 26px;
  background:rgba(9,18,33,.94);
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:10
}
.top h1{
  font-size:23px;
  line-height:1;
  letter-spacing:.2px
}
.top span{color:var(--muted)}
.right{
  display:flex;
  align-items:center;
  gap:13px
}
.status{
  display:flex;
  align-items:center;
  gap:7px;
  color:#79ffb1;
  font-size:13px
}
.dot{
  width:8px;
  height:8px;
  background:#35e37a;
  border-radius:50%;
  box-shadow:0 0 9px #35e37a
}
.identity{
  display:flex;
  flex-direction:column;
  line-height:1.15
}
.identity strong{font-size:14px}
.identity span{font-size:11px}
.logout-button{
  background:linear-gradient(135deg,#dc2626,#ef4444);
  padding:8px 12px
}

/* Cały dashboard bardziej zwarty */
main{
  max-width:1320px;
  margin:auto;
  padding:14px 24px 18px
}
h2{
  margin:13px 0 8px;
  color:#9dd3ff;
  letter-spacing:1.5px;
  font-size:15px;
  line-height:1.1
}
.g2,.g3{
  display:grid;
  gap:10px
}
.g2{
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.g3{
  grid-template-columns:repeat(3,minmax(0,1fr))
}

/* Dużo mniejsze kafle */
.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px 14px;
  min-height:58px;
  transition:.18s
}
.card:hover{
  transform:translateY(-2px);
  border-color:var(--accent);
  box-shadow:0 7px 18px rgba(78,166,255,.16)
}
.dashboard-card{
  display:flex;
  align-items:center;
  min-height:58px
}
.dashboard-card h3{
  font-size:15px;
  line-height:1.15;
  font-weight:600
}
.muted,.placeholder{color:var(--muted)}
.placeholder{
  display:flex;
  align-items:center;
  font-size:13px
}

/* AIQ również znacznie niższe */
.ai{
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:76px;
  padding:12px 15px
}
.ai h3{
  font-size:16px
}
.ai p{
  font-size:13px;
  color:var(--muted)
}
.ai input{
  width:42%;
  padding:9px 12px;
  border-radius:9px;
  border:1px solid var(--line);
  background:#0d1b30;
  color:#fff;
  font-size:13px
}
.aiq-card{
  display:grid;
  grid-template-columns:minmax(210px,auto) minmax(320px,1fr);
  gap:10px 22px
}
.aiq-brand{align-self:center}
.aiq-memory{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:11px;
  line-height:1.3
}
.aiq-memory.growing{color:#79ffb1}
.aiq-form{min-width:0}
.aiq-controls{
  display:flex;
  gap:8px
}
.aiq-controls input{
  width:100%;
  min-width:0
}
.aiq-controls button{
  flex:0 0 auto;
  min-width:88px
}
.aiq-status{
  min-height:16px;
  margin-top:5px;
  color:var(--muted);
  font-size:11px
}
.aiq-answer{
  grid-column:1/-1;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:330px;
  overflow:auto;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#0d1b30;
  color:#e8f2ff;
  font-size:13px;
  line-height:1.55
}
[hidden]{display:none!important}

@media(max-width:900px){
  .g2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ai input{width:48%}
}
@media(max-width:720px){
  .top{
    padding:10px 15px;
    align-items:flex-start;
    gap:10px
  }
  .right{
    flex-wrap:wrap;
    justify-content:flex-end
  }
  main{padding:12px 14px 18px}
  .g2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .g3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ai{
    flex-direction:column;
    align-items:stretch;
    gap:9px
  }
  .ai input{width:100%}
  .aiq-card{display:flex}
  .aiq-form{width:100%}
}
@media(max-width:480px){
  .top{
    flex-direction:column;
    position:static
  }
  .right{
    width:100%;
    justify-content:space-between
  }
  .status{display:none}
  .g2,.g3{grid-template-columns:1fr}
  .card,.dashboard-card{min-height:52px}
  .dashboard-card h3{font-size:14px}
  .login-card{padding:30px 24px}
  .login-card h1{font-size:27px}
}
