/* JafaStage Cloud — komponenty panelu, spójne z aplikacją desktop
   (control.html): te same tokeny, ta sama typografia i zasady. */

body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Sen', system-ui, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* ── Górna belka ── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s4);
    padding: var(--s3) var(--s6);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-default);
}
.brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav { display: flex; gap: var(--s1); flex-wrap: wrap; }
.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--r-md);
    transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: var(--bg-surface); color: var(--text-primary); }
.nav a.active { background: var(--accent-subtle); color: var(--accent); }

.topbar-user { display: flex; align-items: center; gap: var(--s3); }
.topbar-user a { color: var(--text-secondary); text-decoration: none; font-size: .85rem; }
.topbar-user a:hover { color: var(--text-primary); }

.shell { max-width: 1020px; margin: 0 auto; padding: var(--s6); }
.shell-narrow { max-width: 460px; margin: 48px auto; padding: 0 var(--s5); }

/* ── Panele ── */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    padding: var(--s6);
    margin-bottom: var(--s5);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s4);
    flex-wrap: wrap;
    margin-bottom: var(--s4);
}
.panel h2 { margin: 0; font-size: 1.25rem; }
.panel h3 { margin: 0 0 var(--s3); font-size: 1rem; }

.section-title {
    font-size: var(--font-xs);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0 0 var(--s3);
}

.muted { color: var(--text-tertiary); font-size: 0.9em; }
.hint  { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; }

/* ── Formularze ── */
label { display: block; font-size: .85rem; color: var(--text-secondary); margin: var(--s3) 0 var(--s1); }
input, select, textarea {
    background: var(--bg-inset);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 120px; }
.check { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0; }
.check input { width: auto; }
.check label { margin: 0; color: var(--text-primary); font-size: .95rem; }

/* ── Przyciski ── */
button, .btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--r-md);
    padding: 9px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
    line-height: 1.3;
}
button:hover, .btn:hover { background: var(--accent-hover); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-surface); color: var(--text-primary); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--border-strong); }
.btn-danger:hover { background: var(--red-subtle); }
.btn-live { background: var(--red); }
.btn-live:hover { background: #f88; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ── Tabele ── */
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    padding: var(--s2) var(--s3);
    font-size: var(--font-xs);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-strong);
}
td {
    text-align: left;
    padding: var(--s3);
    border-bottom: 1px solid var(--border-default);
    vertical-align: middle;
}
td a.row-link { color: var(--text-primary); font-weight: 700; text-decoration: none; }
td a.row-link:hover { color: var(--accent); }

/* ── Komunikaty ── */
.flash {
    background: var(--amber-subtle);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: var(--amber);
    border-radius: var(--r-md);
    padding: 10px 14px;
    margin-bottom: var(--s4);
    font-size: 0.9rem;
}

/* ── Kafelki sekcji (LIVE) — jak .slide-btn w desktopie ── */
.tiles { display: flex; flex-wrap: wrap; gap: var(--s3); }
.tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    padding: var(--s3) var(--s4);
    cursor: pointer;
    min-width: 150px;
    max-width: 230px;
    transition: border-color .15s ease, background .15s ease;
}
.tile:hover { border-color: var(--accent); }
.tile.active { background: var(--accent-subtle); border-color: var(--accent); }
.tile-label {
    font-size: var(--font-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2px;
}
.tile-preview { color: var(--text-tertiary); font-size: 0.83rem; line-height: 1.4; }
.tile-transition { border-style: dashed; border-color: rgba(251, 191, 36, 0.5); }
.tile-transition .tile-label { color: var(--amber); }
.tile-transition:hover { border-color: var(--amber); }
.tile-transition.active { background: var(--amber-subtle); border-color: var(--amber); }

/* ── Kod zaproszenia / adresy ── */
.invite-code {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 0.22em;
    background: var(--bg-inset);
    border: 1px solid var(--border-default);
    padding: var(--s2) var(--s4);
    border-radius: var(--r-md);
    display: inline-block;
}
.mono-url { font-family: monospace; font-size: 0.8rem; color: var(--text-tertiary); word-break: break-all; }

.qr-box { background: #fff; border-radius: var(--r-md); padding: var(--s2); width: fit-content; }

.badge {
    display: inline-block;
    font-size: var(--font-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}
.badge-live { background: var(--red-subtle); color: var(--red); }

/* ── Pasek narzędzi ćwiczenia ── */
.toolbar {
    display: flex;
    gap: var(--s2);
    align-items: center;
    flex-wrap: wrap;
}
.toolbar b { min-width: 34px; text-align: center; }
