/* JacAI Trainer Pro — App Styles */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  background: radial-gradient(1200px 700px at 10% 10%, rgba(99,102,241,.18), transparent 60%),
              radial-gradient(1200px 700px at 90% 10%, rgba(34,211,238,.12), transparent 55%),
              radial-gradient(1200px 700px at 50% 120%, rgba(34,197,94,.10), transparent 55%),
              var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

a{ color:inherit; }
small{ color:var(--muted); }

.container{
  width:min(1180px, calc(100% - 32px));
  margin: 18px auto 40px;
}

.topbar{
  position: sticky;
  top:0;
  z-index:40;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(0,0,0,.10), rgba(0,0,0,0));
  padding: 14px 0 10px;
}

.topbar-inner{
  width:min(1180px, calc(100% - 32px));
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
}
.brand-badge{
  width:42px;height:42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(96,165,250,.24), rgba(167,139,250,.18));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1), var(--glow);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.brand-badge img{ width:100%; height:100%; object-fit:cover; opacity:.96; }
.brand h1{
  font-size: 14px;
  letter-spacing:.12em;
  text-transform: uppercase;
  margin:0;
  line-height:1.1;
}
.brand .sub{
  font-size: 12px;
  margin-top:2px;
  color: var(--muted);
  letter-spacing:.03em;
}

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  transition: transform var(--dur) ease, background var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
  box-shadow: var(--shadow-1);
  font-weight: 650;
  letter-spacing:.01em;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(56,189,248,.35); }
.btn:focus{ outline:none; box-shadow: var(--shadow-1), var(--ring); }
.btn.primary{
  background: linear-gradient(135deg, rgba(79,70,229,.95), rgba(124,58,237,.92));
  border-color: rgba(99,102,241,.35);
  color: white;
}
.btn.good{
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(16,185,129,.92));
  border-color: rgba(34,197,94,.35);
  color: #052e1a;
}
.btn.ghost{
  background: transparent;
}

.select{
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}

.grid{
  display:grid;
  grid-template-columns: 390px 1fr;
  gap: 16px;
  align-items:start;
  margin-top: 14px;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow-2);
  overflow:hidden;
}
.card-head{
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid var(--border);
}
.card-head h2{
  margin:0;
  font-size: 13px;
  letter-spacing:.12em;
  text-transform: uppercase;
}
.card-body{ padding: 14px 16px 16px; }

.kpis{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-bottom: 12px;
}
@media (max-width: 520px){
  .kpis{ grid-template-columns: 1fr; }
}
.kpi{
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.10);
  border: 1px solid var(--border);
}
.kpi .n{ font-size: 20px; font-weight: 750; letter-spacing:-.02em; }
.kpi .t{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.split{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 10px;
}
.field label{
  font-size: 12px;
  color: var(--muted);
}
.input, textarea{
  width:100%;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.08);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  font-family: var(--sans);
  transition: box-shadow var(--dur) ease, border-color var(--dur) ease, transform var(--dur) ease;
}
textarea{ min-height: 140px; resize: vertical; }
.input:focus, textarea:focus{
  outline:none;
  box-shadow: var(--ring);
  border-color: rgba(56,189,248,.35);
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.row .grow{ flex:1; min-width: 220px; }

.tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tab{
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.08);
  cursor:pointer;
  font-weight: 650;
  font-size: 13px;
}
.tab.active{
  background: var(--chip);
  color: var(--chipText);
  border-color: rgba(79,70,229,.20);
}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,.08);
}
.item-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.item-title{
  font-weight: 750;
  font-size: 13px;
}
.meta{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.badges{ display:flex; gap:6px; flex-wrap:wrap; margin-top: 8px; }
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.12);
  border:1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.badge.good{ color: rgba(34,197,94,.95); }
.badge.bad{ color: rgba(239,68,68,.95); }
.badge.warn{ color: rgba(245,158,11,.95); }

.hr{ height:1px; background: var(--border); margin: 12px 0; }

.code{
  background: var(--codeBg);
  color: var(--codeText);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  max-height: 300px;
  overflow:auto;
}

.toast{
  position: fixed;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow-2);
  max-width: min(420px, calc(100% - 28px));
  display:none;
}
.toast.show{ display:block; animation: pop .18s ease; }
@keyframes pop { from{ transform: translateY(8px); opacity: .0;} to{ transform: translateY(0); opacity:1;} }

.footer{
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.footer a{ color: var(--muted); text-decoration:none; border-bottom: 1px dashed rgba(255,255,255,.14); }
.footer a:hover{ color: var(--text); }

kbd{
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.10);
}
