/* ============================================================================
   challengeMe — panel (partner / admin). Layout SaaS: sidebar + topbar.
   Wykorzystuje zmienne i komponenty z app.css.
   ============================================================================ */

.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #0c120b, #070a07);
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { margin: 4px 8px 26px; font-size: 19px; }
.side-role { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: 0 10px 10px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: var(--text-soft); font-weight: 600; font-size: 15px; transition: background .15s, color .15s;
}
.side-nav a svg { width: 19px; height: 19px; opacity: .8; }
.side-nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.side-nav a.active { background: var(--lime-soft); color: var(--lime); border: 1px solid var(--lime-glow); }
.side-nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 16px 10px 4px; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 70px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0;
  background: rgba(5,7,10,0.75); backdrop-filter: blur(12px); z-index: 20;
}
.topbar h1 { font-size: 21px; font-weight: 800; }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #05070A;
  background: linear-gradient(120deg, var(--lime-bright), var(--lime-dim)); }
.content { padding: 30px; max-width: 1200px; width: 100%; }

/* Statystyki */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid var(--border); border-radius: 20px; padding: 22px;
}
.stat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat b { display: block; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--text-muted); }
.stat small { font-size: 12px; font-weight: 700; }
.up { color: var(--lime); } .down { color: var(--flame); }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border: 1px solid var(--border); border-radius: 20px; padding: 22px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.panel-head h2 { font-size: 18px; font-weight: 800; }
.panel-head .sub { font-size: 13px; color: var(--text-muted); }

.cols { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.mt { margin-top: 18px; } .mt-lg { margin-top: 28px; }

/* Tabele */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 13px 12px; font-size: 14px; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--text-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.table tr:hover td { background: rgba(255,255,255,0.015); }
.table td.num { font-variant-numeric: tabular-nums; }
.table .muted { color: var(--text-muted); }

/* Znaczniki statusu */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.tag-green { background: rgba(52,227,155,0.14); color: #7ef0be; }
.tag-lime { background: var(--lime-soft); color: var(--lime); border: 1px solid var(--lime-glow); }
.tag-amber { background: rgba(255,203,69,0.14); color: var(--gold); }
.tag-red { background: rgba(255,90,90,0.14); color: #ff9a9a; }
.tag-gray { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* Wykresy */
.chart-wrap { position: relative; height: 260px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--lime), var(--lime-dim)); border-radius: 8px 8px 0 0; min-height: 6px;
  position: relative; transition: height .8s cubic-bezier(.2,.7,.2,1); }
.bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-muted); }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card p.sub { text-align: center; color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.demo-hint { margin-top: 18px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* Formularz w panelu */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border);
  background: rgba(255,255,255,0.02); color: var(--text-soft); cursor: pointer; }
.icon-btn:hover { border-color: var(--lime-glow); color: var(--lime); }
.icon-btn.danger:hover { border-color: rgba(255,90,90,0.5); color: #ff9a9a; }

.empty { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--lime); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-direction: column; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}
