:root {
    --bg: #f4f9ff;
    --card: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --primary: #24a6a4;
    --primary-dark: #0f766e;
    --line: rgba(15, 118, 110, 0.14);
    --shadow: 0 12px 34px rgba(15, 118, 110, 0.10);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 4%, rgba(36, 166, 164, 0.16), transparent 30%),
        linear-gradient(180deg, #f8fcff 0%, #eef9fb 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}


.logout-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #ffffff;
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 800;
}

.panel-container {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 44px;
}

.page-title {
    margin-bottom: 20px;
}

.page-title h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -1px;
}

.page-title p {
    margin: 0;
    color: var(--muted);
    font-weight: 650;
    line-height: 1.6;
}

.btn {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 900;
    transition: transform 0.18s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #0284c7);
    box-shadow: var(--shadow);
}

.alert {
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    color: #991b1b;
    background: #fee2e2;
}

.empty-box {
    padding: 24px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 680px) {

    .panel-container {
        width: min(100% - 18px, 1180px);
        padding-top: 10px;
    }

    .logout-link {
        padding: 9px 12px;
        font-size: 13px;
    }
}

.alert-success {
    color: #166534;
    background: #dcfce7;
}

/* =========================
   GLOBAL UI POLISH
========================= */

body {
    opacity: 1;
    transform: none;
}

.panel-container,
.auth-card {
    animation: pageSoftIn 0.28s ease both;
}

.panel-container {
    animation: pageSoftIn 0.28s ease both;
}

@keyframes pageSoftIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn,
.logout-link,
.danger-btn,
.success-btn,
.menu-card,
.stat-card,
.dashboard-stat-card,
.student-stat-card,
.user-card,
.lesson-card,
.admin-lesson-card,
.detail-box,
.form-card,
.dashboard-panel,
.student-reader-card,
.student-quiz-card,
.student-result-card,
.answer-detail,
.question-preview-card,
.profile-card,
.lesson-detail-card,
.content-preview {
    backface-visibility: hidden;
    transform: translateZ(0);
}

.btn,
.logout-link,
.danger-btn,
.success-btn {
    position: relative;
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {

    .btn:hover,
    .logout-link:hover,
    .danger-btn:hover,
    .success-btn:hover {
        transform: translateY(-2px);
    }

    .menu-card:hover,
    .user-card:hover,
    .lesson-card:hover,
    .admin-lesson-card:hover {
        transform: translateY(-4px);
    }
}

.ui-ripple {
    position: absolute;
    border-radius: 999px;
    transform: scale(0);
    animation: rippleEffect 0.48s ease-out;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(3.6);
        opacity: 0;
    }
}

.empty-box {
    position: relative;
    padding: 26px;
    text-align: center;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.78);
}

.empty-box::before {
    content: "📭";
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
}

.alert {
    border: 1px solid transparent;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.18);
}

.alert-error {
    border-color: rgba(239, 68, 68, 0.18);
}

/* Loading overlay */

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    background: rgba(248, 252, 255, 0.68);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.app-loader.show {
    opacity: 1;
    visibility: visible;
}

.app-loader-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-weight: 900;
}

.app-loader-spinner,
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(36, 166, 164, 0.20);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.btn-spinner {
    width: 15px;
    height: 15px;
    border-width: 2px;
    border-top-color: #ffffff;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    pointer-events: none;
    opacity: 0.82;
}

/* Better tables */

.table-wrap {
    box-shadow: var(--shadow);
}

.simple-table tr:last-child td {
    border-bottom: 0;
}

.simple-table tbody tr {
    transition: background 0.16s ease;
}

.simple-table tbody tr:hover {
    background: #f8fafc;
}

/* Mobile polish */

@media (max-width: 680px) {
    body {
        background:
            radial-gradient(circle at 10% 0%, rgba(36, 166, 164, 0.13), transparent 34%),
            linear-gradient(180deg, #f8fcff 0%, #eef9fb 100%);
    }

    .panel-container {
        padding-bottom: 32px;
    }

    .page-title h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .btn,
    .logout-link,
    .danger-btn,
    .success-btn {
        min-height: 44px;
    }

    .empty-box {
        padding: 22px 16px;
    }

    .app-loader {
        backdrop-filter: none;
        background: rgba(248, 252, 255, 0.84);
    }
}

/* =========================
   NEW CLEAN PANEL HEADER
========================= */

.panel-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(248, 252, 255, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 118, 110, 0.10);
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.panel-header-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-header-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #24a6a4, #38bdf8);
    box-shadow: 0 10px 24px rgba(36, 166, 164, 0.22);
    font-size: 21px;
}

.logout-link {
    min-height: 42px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #ffffff;
    border: 1px solid rgba(15, 118, 110, 0.14);
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.08);
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.logout-link:hover {
    transform: translateY(-2px);
    background: #ecfeff;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.14);
}

/* köhnə strong/span dizaynını söndürürük */
.panel-header strong,
.panel-header strong::before,
.panel-header span:not(.panel-header-icon) {
    all: unset;
}

/* Mobile */
@media (max-width: 680px) {
    .panel-header {
        width: min(100% - 18px, 1180px);
        padding: 10px 0;
        gap: 10px;
        backdrop-filter: none;
        background: rgba(248, 252, 255, 0.95);
    }

    .panel-header-title {
        gap: 9px;
    }

    .panel-header-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 14px;
        font-size: 18px;
    }

    .panel-header-title h1 {
        font-size: 17px;
    }

    .logout-link {
        min-height: 38px;
        padding: 8px 13px;
        font-size: 13px;
    }
}