:root {
    --bg: #071426;
    --sidebar: #0a1b31;
    --card: #10243c;
    --border: #24405a;
    --text: #f4faff;
    --muted: #9bb1c7;
    --primary: #19c8d9;
    --green: #33d69f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
}

h1, h2, h3 {
    line-height: 1.2;
}

h1 {
    font-size: clamp(30px, 4vw, 46px);
}

p {
    color: var(--muted);
    line-height: 1.7;
}

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

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

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg,#19c8d9,#0796b2);
    color: #041827;
    border: 0;
    border-radius: 11px;
    padding: 14px 22px;
    font-weight: bold;
    text-align: center;
}

.btn:hover {
    filter: brightness(1.12);
}

.loginmain {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(
        circle at top,
        #125175,
        #071426 65%
    );
}

.loginbox {
    width: 100%;
    max-width: 470px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 80px #0006;
}

.loginicon {
    font-size: 65px;
}

.loginbox em {
    color: var(--primary);
    font-style: normal;
}

.small {
    font-size: 13px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 17px;
    text-align: left;
    margin-top: 25px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 14px;
    background: #07182b;
    border: 1px solid #31506c;
    border-radius: 10px;
    color: white;
}

.form textarea {
    min-height: 110px;
    resize: vertical;
}

.form .checkbox-label {
    flex-direction: row;
    align-items: center;
}

.checkbox-label input {
    width: auto;
}

.flash {
    padding: 15px;
    background: #173c50;
    border: 1px solid var(--primary);
    border-radius: 10px;
    margin-bottom: 20px;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    flex-shrink: 0;
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 8px 30px;
}

.brand-icon {
    font-size: 30px;
    background: #153b57;
    padding: 10px;
    border-radius: 14px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 13px;
}

.brand small {
    color: var(--primary);
    letter-spacing: 3px;
    font-size: 11px;
    margin-top: 5px;
}

.nav-label {
    color: #7897b1;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 20px 14px 12px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav a {
    display: block;
    padding: 15px;
    color: #abc1d5;
    border-radius: 11px;
    font-size: 14px;
    font-weight: bold;
}

.nav a:hover,
.nav a.active {
    background: #16465b;
    color: #5be5ef;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 30px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 5px;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #052039;
    font-weight: bold;
}

.profile strong,
.profile small {
    display: block;
}

.profile strong {
    font-size: 13px;
}

.profile small {
    color: var(--muted);
    margin-top: 5px;
}

.logout {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: white;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 90px;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.help-top {
    background: #15344b;
    border: 1px solid #2c5b71;
    border-radius: 10px;
    padding: 12px 18px;
    color: white;
    font-weight: bold;
}

.content {
    padding: 40px;
    max-width: 1500px;
    margin: auto;
}

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg,#123d59,#092039);
    border: 1px solid #23617b;
    border-radius: 24px;
    padding: 45px;
    margin-bottom: 30px;
}

.hero h1 {
    max-width: 650px;
}

.hero h1 span {
    display: block;
    color: #54e1e9;
}

.hero p {
    max-width: 550px;
}

.hero-dolphin {
    position: absolute;
    right: 50px;
    top: 50px;
    font-size: 130px;
    opacity: .4;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
    margin: 25px 0 35px;
}

.stat,
.panel,
.course-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 25px;
}

.stat span,
.stat small {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    display: block;
    font-size: 38px;
    margin: 12px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 35px 0 20px;
}

.section-head a,
.back {
    color: var(--primary);
    font-weight: bold;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(245px,1fr)
    );
    gap: 20px;
}

.course-card {
    display: block;
    transition: .2s;
}

.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: #16304d;
}

.course-emoji {
    font-size: 42px;
    margin-bottom: 20px;
}

.tag,
.mandatory {
    display: inline-block;
    background: #1a4056;
    color: #76dce5;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: bold;
}

.mandatory {
    background: #523b26;
    color: #ffcf80;
    margin-left: 5px;
}

.course-card h3 {
    min-height: 50px;
}

.course-card p {
    min-height: 70px;
    font-size: 13px;
}

.progressbar {
    width: 100%;
    height: 9px;
    background: #24415b;
    border-radius: 20px;
    overflow: hidden;
    margin: 20px 0 12px;
}

.progressbar div {
    height: 100%;
    background: linear-gradient(90deg,#0796b2,#35e5d1);
    border-radius: 20px;
}

.course-bottom {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: bold;
}

.page-heading {
    margin-bottom: 35px;
}

.panel {
    margin-bottom: 20px;
}

.big-number {
    font-size: 65px;
    font-weight: bold;
    color: var(--primary);
}

.progress-row,
.certificate-row,
.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 20px;
    margin-bottom: 12px;
}

.progress-row small,
.user-row small {
    display: block;
    color: var(--muted);
    margin-top: 7px;
}

.back {
    display: inline-block;
    margin-bottom: 25px;
}

.course-header {
    background: linear-gradient(120deg,#143b56,#10243c);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 35px;
    margin-bottom: 30px;
}

.lesson {
    display: flex;
    gap: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 17px;
}

.lesson-number {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: #1b5369;
    color: var(--primary);
    border-radius: 12px;
    font-weight: bold;
}

.lesson-content {
    flex: 1;
    min-width: 0;
}

.video-link {
    display: block;
    color: var(--primary);
    margin: 20px 0;
    font-weight: bold;
}

.completed {
    display: inline-block;
    color: var(--green);
    font-weight: bold;
    padding: 12px 0;
}

.success-panel {
    text-align: center;
    background: #123d40;
    border: 1px solid var(--green);
    border-radius: 20px;
    padding: 35px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(300px,1fr)
    );
    gap: 20px;
}

.admin-grid .panel {
    margin: 0;
}

.user-row {
    background: #0b1d32;
    padding: 15px;
}

.user-row strong,
.user-row small {
    overflow-wrap: anywhere;
}

.certificate {
    background: white;
    color: #12314c;
    border: 15px double #0c7894;
    padding: 65px 30px;
    text-align: center;
    max-width: 900px;
    min-height: 570px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.certificate-logo {
    font-size: 65px;
}

.certificate h1 {
    color: #0a6983;
    font-size: 60px;
    letter-spacing: 7px;
}

.certificate h2 {
    font-size: 40px;
    border-bottom: 2px solid #0a6983;
    padding-bottom: 15px;
}

.certificate h3 {
    font-size: 28px;
}

.certificate p {
    color: #476276;
}

.certificate-footer {
    margin-top: 45px;
    font-weight: bold;
}

.print-button {
    display: block;
    margin: 20px auto;
}

.delfi-button {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 67px;
    height: 67px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,#1ad4df,#067da9);
    box-shadow: 0 10px 35px #00c6dc55;
    font-size: 34px;
    z-index: 200;
}

.delfi-menu {
    position: fixed;
    right: 25px;
    bottom: 105px;
    width: 340px;
    max-width: calc(100vw - 35px);
    background: #102a43;
    border: 1px solid #32617b;
    border-radius: 20px;
    padding: 20px;
    z-index: 250;
    box-shadow: 0 20px 70px #0008;
}

.delfi-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 19px;
}

.delfi-menu-head button {
    background: transparent;
    border: 0;
    color: white;
}

.delfi-menu > button {
    display: block;
    width: 100%;
    text-align: left;
    background: #1a3a55;
    border: 1px solid #315671;
    border-radius: 10px;
    color: white;
    padding: 13px;
    margin-top: 9px;
}

#delfi-answer {
    margin-top: 15px;
    color: #9ee9ec;
    font-size: 13px;
    line-height: 1.6;
}

.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,9,20,.78);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tour-box {
    position: relative;
    z-index: 1002;
    width: 100%;
    max-width: 460px;
    padding: 35px;
    background: #102b45;
    border: 1px solid #31728a;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 25px 100px #0009;
}

.tour-icon {
    font-size: 65px;
}

#tour-counter {
    color: #9ab5c9;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
}

.tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.tour-skip {
    background: transparent;
    border: 0;
    color: #a9bfd0;
    padding: 12px;
}

.tour-highlight {
    position: relative;
    z-index: 1001;
    background: #16627a !important;
    color: white !important;
    box-shadow:
        0 0 0 4px var(--primary),
        0 0 35px #00d5e688;
    border-radius: 12px;
}

@media(max-width:900px) {
    .sidebar {
        width: 220px;
    }

    .content {
        padding: 25px;
    }

    .topbar {
        padding: 20px 25px;
    }

    .hero-dolphin {
        opacity: .2;
    }
}

@media(max-width:700px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        min-height: 0;
        position: relative;
        padding: 15px;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2,1fr);
    }

    .nav a {
        font-size: 12px;
        padding: 12px;
    }

    .nav-label {
        grid-column: 1/-1;
    }

    .sidebar-bottom {
        padding-top: 15px;
    }

    .content {
        padding: 20px 15px 100px;
    }

    .topbar {
        padding: 15px;
    }

    .hero {
        padding: 30px 22px;
    }

    .hero-dolphin {
        display: none;
    }

    .stats,
    .admin-grid,
    .course-grid {
        grid-template-columns: 1fr;
    }

    .loginbox {
        padding: 30px 20px;
    }

    .lesson {
        padding: 20px;
    }

    .progress-row,
    .certificate-row {
        flex-wrap: wrap;
    }

    .tour-box {
        padding: 25px 20px;
    }

    .certificate {
        padding: 30px 15px;
        min-height: 450px;
    }

    .certificate h1 {
        font-size: 38px;
    }

    .certificate h2 {
        font-size: 28px;
    }
}

@media print {
    body {
        background: white;
    }

    .sidebar,
    .topbar,
    .delfi-button,
    .delfi-menu,
    .tour-overlay,
    .print-button {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .certificate {
        margin: 0 auto;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}