:root {
    --bg: #f4f5fb;
    --card: #ffffff;
    --text: #1c1b3a;
    --muted: #6b728d;
    --line: #dfe3f2;
    --primary: #4f46e5;
    --primary-dark: #7c3aed;
    --primary-soft: #eef2ff;
    --shadow: 0 10px 30px rgba(36, 35, 70, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #dcfce7 0px, #eefaf4 120px, #f4f6f4 240px);
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.topbar {
    background: linear-gradient(135deg, #242346 0%, #2e2b5f 55%, #4f46e5 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 24px rgba(36, 35, 70, 0.18);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #ffffff;
}

.brand {
    text-decoration: none;
}

.brand:hover {
    color: #ffffff;
}

.toplinks {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
}

.toplinks a {
    font-weight: 600;
    color: #ffffff;
}

.toplinks a:hover {
    color: #dbeafe;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 14px;
}

.flash {
    max-width: 1240px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid;
}

.flash-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.flash-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.layout {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 28px;
    align-items: start;
}

.sidebar,
.main-card,
.auth-card,
.panel-card,
.table-card,
.question-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.sidebar {
    padding: 24px 18px;
    position: sticky;
    top: 92px;
}

.sidebar h3 {
    margin: 0 0 18px;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.4px;
    color: var(--text);
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar li + li {
    margin-top: 8px;
}

.sidebar a {
    display: block;
    padding: 13px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #1e40af;
    font-weight: 500;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar a:hover {
    background: #f8fbff;
    border-color: #dbeafe;
    transform: translateX(2px);
}

.sidebar a.active {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    color: var(--primary-dark);
    font-weight: 700;
}

.main-card,
.auth-card,
.panel-card,
.table-card {
    padding: 34px;
}

.main-card h1,
.auth-card h1,
.panel-card h1,
.table-card h1 {
    margin: 0 0 14px;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.9px;
    color: var(--text);
}

.main-card h2,
.panel-card h2,
.table-card h2 {
    margin: 28px 0 14px;
    font-size: 26px;
    line-height: 1.2;
    color: var(--text);
}

.muted {
    color: var(--muted);
    margin-bottom: 22px;
    font-size: 15px;
}

.lesson-body {
    font-size: 18px;
    color: #1e293b;
}

.lesson-body p {
    margin: 0 0 18px;
}

.lesson-body ul,
.lesson-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.lesson-body strong {
    color: #0f172a;
}

.media-box {
    margin-top: 26px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
}

.media-box img,
.media-box video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.media-box audio,
.media-box video {
    width: 100%;
}

.adsense-box {
    margin-top: 28px;
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #fafafa;
    color: #475569;
}

.adsense-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 17px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-row + .form-row {
    margin-top: 18px;
}

button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.18);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    color: #fff;
    opacity: 0.97;
    transform: translateY(-1px);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: var(--text);
    font-size: 15px;
}

tr:hover td {
    background: #fbfdff;
}

.question-card {
    margin-bottom: 18px;
    padding: 22px;
}

.question-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.answers-list {
    display: grid;
    gap: 10px;
}

.answer-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.answer-item input {
    width: auto;
    margin-top: 4px;
}

.auth-card {
    max-width: 560px;
    margin: 44px auto;
}

.footer {
    margin-top: 30px;
    background: transparent;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 20px 24px;
    color: #64748b;
    font-size: 14px;
}

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

    .sidebar {
        position: static;
    }

    .main-card h1,
    .auth-card h1,
    .panel-card h1,
    .table-card h1 {
        font-size: 34px;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand {
        font-size: 24px;
    }

    .layout {
        margin: 18px auto;
        padding: 0 12px;
        gap: 18px;
    }

    .sidebar,
    .main-card,
    .auth-card,
    .panel-card,
    .table-card,
    .question-card {
        padding: 20px;
        border-radius: 16px;
    }

    .sidebar h3 {
        font-size: 22px;
    }

    .main-card h1,
    .auth-card h1,
    .panel-card h1,
    .table-card h1 {
        font-size: 30px;
    }

    .lesson-body {
        font-size: 16px;
    }

    button,
    .btn,
    input[type="submit"] {
        width: 100%;
    }
}
/* delikatniejsze tło strony */
body {
    background: linear-gradient(180deg, #eaf1ff 0px, #f4f7fc 140px, #f6f8fc 320px);
}

/* trochę niższy i lżejszy pasek u góry */
.topbar-inner {
    padding: 16px 20px;
}

.brand {
    font-size: 26px;
    letter-spacing: -0.3px;
}

.toplinks {
    font-size: 14px;
    gap: 12px;
}

/* mniej masywny tytuł lekcji */
.main-card h1,
.auth-card h1,
.panel-card h1,
.table-card h1 {
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 18px;
}

/* bardziej zwarta treść */
.lesson-body {
    font-size: 16px;
    line-height: 1.8;
}

.muted {
    font-size: 14px;
    margin-bottom: 18px;
}

/* karta z treścią trochę subtelniejsza */
.sidebar,
.main-card,
.auth-card,
.panel-card,
.table-card,
.question-card {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    border-radius: 16px;
}

/* menu po lewej bardziej jak nowoczesny portal */
.sidebar a {
    padding: 12px 14px;
    line-height: 1.55;
}

.sidebar a.active {
    background: linear-gradient(135deg, #eef4ff 0%, #e8f0ff 100%);
    border-color: #bfd6ff;
}

/* reklama bardziej schludna */
.adsense-box {
    padding: 18px 20px;
    background: #fbfcfe;
}

.adsense-box strong {
    font-size: 15px;
    margin-bottom: 6px;
}

/* stopka delikatniejsza */
.footer-inner {
    padding-top: 14px;
    color: #7b8798;
}

/* komputer: lekko szersza treść */
.main-card {
    max-width: 1040px;
}

/* telefon */
@media (max-width: 640px) {
    .brand {
        font-size: 22px;
    }

    .main-card h1,
    .auth-card h1,
    .panel-card h1,
    .table-card h1 {
        font-size: 28px;
    }

    .lesson-body {
        font-size: 15px;
        line-height: 1.75;
    }

    .toplinks {
        gap: 10px;
        font-size: 13px;
    }
}
/* extra utility styles used in auth/admin/coach/pracownik pages */
.narrow {
    max-width: 760px;
    margin: 30px auto;
}

.simple-form {
    display: grid;
    gap: 16px;
}

.simple-form hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 10px 0;
}

.wide-form {
    max-width: 920px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.button:hover {
    color: #fff !important;
    opacity: 0.96;
}

.button.secondary {
    background: #ffffff;
    color: var(--text) !important;
    border: 1px solid var(--line);
    box-shadow: none;
}

.button.small {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #f8fafc;
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 22px 0 28px;
}

.stat-box {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-box strong {
    font-size: 15px;
    color: var(--muted);
}

.stat-box span {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.link-list {
    margin: 0;
    padding-left: 20px;
}

.link-list li + li {
    margin-top: 8px;
}

.inline-check,
.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.inline-check input,
.checkbox-line input {
    width: auto;
    margin-top: 4px;
}

.timer {
    display: inline-block;
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-weight: 700;
}

.small {
    font-size: 14px;
}
