:root {
    --bg: #07111f;
    --card: #0f1d2f;
    --card-2: #12243a;
    --border: rgba(96, 165, 250, 0.22);
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --panel: #0e1b2d;
    --panel-2: #13243a;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: #223954;
    --blue: #2f80ff;
    --blue-2: #6bb6ff;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: #fff; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    padding: 22px;
    background: #09182a;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.brand { font-size: 24px; font-weight: 800; color: #fff; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a {
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--muted);
}
.sidebar nav a:hover { background: var(--panel-2); color: #fff; }
.user-box { margin-top: auto; display: grid; gap: 8px; color: var(--muted); }

.content { flex: 1; padding: 32px; overflow-x: hidden; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 8px; font-size: 32px; }
.page-head p, .muted { color: var(--muted); margin: 0; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
}
.card h2 { margin-top: 0; font-size: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats .card span { color: var(--muted); display: block; margin-bottom: 10px; }
.stats .card strong { font-size: 34px; }
.student-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    padding: 24px;
    margin-bottom: 18px;
    border: 1px solid rgba(107, 182, 255, .35);
    border-radius: 8px;
    background: linear-gradient(135deg, #102642, #0c1a2c);
}
.student-hero h2 { margin: 8px 0; font-size: 30px; }
.student-hero p { margin: 0; color: var(--muted); }
.eyebrow {
    color: var(--blue-2);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}
.student-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}
.metric-card span, .mini-panel span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}
.metric-card strong { font-size: 28px; }
.student-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 18px;
}
.activity-list { display: grid; gap: 10px; }
.activity-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #09182a;
}
.activity-item span { display: block; margin-top: 5px; color: var(--muted); }
.mini-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #09182a;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}
.btn:hover, button:hover { border-color: var(--blue-2); }
.btn.primary, button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger, button.danger { background: var(--red); border-color: var(--red); color: #fff; }

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(47, 128, 255, .18);
    color: var(--blue-2);
    font-size: 13px;
}
.notice {
    background: rgba(246, 181, 63, .12);
    border: 1px solid rgba(246, 181, 63, .35);
    color: #ffd58a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
}
.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--panel-2);
    border: 1px solid var(--line);
}
.alert.success { border-color: rgba(36, 200, 120, .45); color: #92f0bd; }
.alert.danger { border-color: rgba(239, 83, 80, .45); color: #ffaaa8; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
tr.deleted { opacity: .55; }
.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.inline button { min-height: auto; padding: 0; border: 0; background: transparent; color: #ffaaa8; }
.empty { color: var(--muted); }

.form { display: grid; gap: 16px; max-width: 720px; }
.upload-form { max-width: 1100px; }
label { display: grid; gap: 7px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #09182a;
    color: var(--text);
    padding: 11px 12px;
    font: inherit;
}
textarea { resize: vertical; }
.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 170px;
    padding: 22px;
    border: 2px dashed rgba(107, 182, 255, .45);
    border-radius: 8px;
    background: #09182a;
    color: var(--text);
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.dropzone.is-dragover {
    border-color: var(--blue-2);
    background: #102642;
}
.dropzone-title { font-size: 20px; font-weight: 800; }
.dropzone-text, .selected-files { color: var(--muted); }
.selected-files {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #09182a;
}
.upload-help,
.upload-limit {
    display: block;
    color: var(--muted);
    line-height: 1.55;
}
.upload-limit {
    margin: -6px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(96, 165, 250, .18);
    border-radius: 12px;
    background: rgba(59, 130, 246, .08);
    color: #bfdbfe;
    font-weight: 800;
}

.upload-form.is-uploading {
    pointer-events: none;
    user-select: none;
}

.upload-form.is-uploading .rich-note-panel,
.upload-form.is-uploading .dropzone,
.upload-form.is-uploading .selected-files {
    opacity: .62;
}

.upload-form.is-uploading button,
.upload-form.is-uploading input,
.upload-form.is-uploading textarea,
.upload-form.is-uploading select {
    cursor: not-allowed;
}

.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3, 7, 18, .9);
    backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity .22s ease;
}

.upload-overlay[hidden] {
    display: none;
}

.upload-overlay.is-visible {
    opacity: 1;
}

.upload-loader-card {
    position: relative;
    overflow: hidden;
    display: grid;
    justify-items: center;
    gap: 16px;
    width: min(520px, 100%);
    padding: 34px;
    border: 1px solid rgba(96, 165, 250, .34);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0, rgba(96, 165, 250, .24), transparent 36%),
        linear-gradient(180deg, rgba(18, 36, 58, .98), rgba(8, 17, 31, .98));
    box-shadow: 0 32px 120px rgba(0, 0, 0, .55);
    text-align: center;
}

.upload-glow-image {
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    border-radius: 32px;
    background: rgba(59, 130, 246, .12);
    box-shadow: 0 0 52px rgba(59, 130, 246, .42);
    animation: uploadPulse 1.8s ease-in-out infinite;
}

.upload-big-icon {
    position: relative;
    width: 62px;
    height: 52px;
    border: 4px solid #bfdbfe;
    border-top: 0;
    border-radius: 0 0 16px 16px;
}

.upload-big-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -28px;
    width: 22px;
    height: 38px;
    border-radius: 999px 999px 4px 4px;
    background: #60a5fa;
    transform: translateX(-50%);
}

.upload-big-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -38px;
    width: 28px;
    height: 28px;
    border-left: 8px solid #60a5fa;
    border-top: 8px solid #60a5fa;
    transform: translateX(-50%) rotate(45deg);
}

.upload-percent {
    color: #fff;
    font-size: clamp(42px, 8vw, 70px);
    font-weight: 900;
    line-height: 1;
}

.upload-progress {
    overflow: hidden;
    width: 100%;
    height: 16px;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 999px;
    background: rgba(8, 17, 31, .9);
}

.upload-progress-bar {
    position: relative;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #22c55e);
    transition: width .16s ease;
}

.upload-progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
    animation: uploadShimmer 1.2s linear infinite;
}

.upload-status {
    min-height: 24px;
    color: #dbeafe;
    font-size: 18px;
    font-weight: 800;
}

.upload-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
}

.upload-details span,
.upload-warning {
    padding: 8px 11px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 999px;
    background: rgba(8, 17, 31, .62);
}

.upload-warning {
    border-radius: 12px;
    color: #bfdbfe;
    line-height: 1.45;
}

.upload-overlay.is-success .upload-status {
    color: #86efac;
}

.upload-overlay.is-error .upload-loader-card {
    border-color: rgba(239, 68, 68, .55);
}

.upload-overlay.is-error .upload-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.upload-overlay.is-error .upload-status {
    color: #fecaca;
}

@keyframes uploadPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes uploadShimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.rich-note-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 36, 58, .96), rgba(15, 29, 47, .96));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

.rich-note-panel,
.rich-note-canvas,
.note-element,
.note-text-content,
.rich-note-viewer,
.rich-note-view-text,
pre {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(15, 29, 47, .85);
}

.rich-note-panel::-webkit-scrollbar,
.rich-note-canvas::-webkit-scrollbar,
.note-element::-webkit-scrollbar,
.note-text-content::-webkit-scrollbar,
.rich-note-viewer::-webkit-scrollbar,
.rich-note-view-text::-webkit-scrollbar,
pre::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.rich-note-panel::-webkit-scrollbar-track,
.rich-note-canvas::-webkit-scrollbar-track,
.note-element::-webkit-scrollbar-track,
.note-text-content::-webkit-scrollbar-track,
.rich-note-viewer::-webkit-scrollbar-track,
.rich-note-view-text::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
    background: rgba(15, 29, 47, .85);
    border-radius: 999px;
}

.rich-note-panel::-webkit-scrollbar-thumb,
.rich-note-canvas::-webkit-scrollbar-thumb,
.note-element::-webkit-scrollbar-thumb,
.note-text-content::-webkit-scrollbar-thumb,
.rich-note-viewer::-webkit-scrollbar-thumb,
.rich-note-view-text::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
    border: 2px solid rgba(15, 29, 47, .85);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary-light), #2563eb);
}

.rich-note-panel::-webkit-scrollbar-thumb:hover,
.rich-note-canvas::-webkit-scrollbar-thumb:hover,
.note-element::-webkit-scrollbar-thumb:hover,
.note-text-content::-webkit-scrollbar-thumb:hover,
.rich-note-viewer::-webkit-scrollbar-thumb:hover,
.rich-note-view-text::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #93c5fd, var(--primary));
}

.rich-note-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.rich-note-head h2 {
    margin: 0 0 6px;
    color: #fff;
}

.rich-note-head p,
.rich-note-tip {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.note-help-button,
.rich-note-toolbar button,
.note-grid-toggle {
    min-height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, .25);
    background: rgba(8, 17, 31, .78);
    color: var(--text);
    font-weight: 800;
}

.rich-note-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 16px;
    background: rgba(8, 17, 31, .58);
}

.rich-note-toolbar button {
    min-width: 132px;
    min-height: 44px;
    justify-content: center;
    white-space: nowrap;
}

.note-grid-toggle {
    min-width: 110px;
    justify-content: center;
}

.rich-note-toolbar button:hover,
.note-help-button:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, .62);
}

.note-grid-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.rich-note-canvas {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 420px;
    border: 1px dashed rgba(96, 165, 250, .38);
    border-radius: 18px;
    background: #07111f;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, .24);
    touch-action: none;
}

.rich-note-canvas.has-grid {
    background-image:
        linear-gradient(rgba(96, 165, 250, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, .08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.rich-note-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    pointer-events: none;
}

.rich-note-placeholder strong {
    color: #dbeafe;
    font-size: 19px;
}

.note-element {
    position: absolute;
    min-width: 80px;
    min-height: 60px;
    border: 1px solid rgba(96, 165, 250, .24);
    border-radius: 14px;
    background: rgba(15, 29, 47, .9);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    color: var(--text);
    font-family: inherit;
}

.note-element.selected {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, .25), 0 16px 40px rgba(59, 130, 246, .18);
}

.note-drag-handle {
    position: absolute;
    z-index: 4;
    top: 6px;
    right: 42px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(59, 130, 246, .88);
    border-color: transparent;
    color: #fff;
    cursor: move;
    font-family: inherit;
}

.note-delete-button {
    position: absolute;
    z-index: 6;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(239, 68, 68, .42);
    border-radius: 999px;
    background: rgba(239, 68, 68, .14);
    color: #fecaca;
}

.note-delete-button::before {
    content: "";
    width: 13px;
    height: 14px;
    background: currentColor;
    clip-path: polygon(20% 30%, 80% 30%, 72% 100%, 28% 100%, 20% 30%, 32% 30%, 36% 16%, 64% 16%, 68% 30%, 82% 30%, 82% 23%, 18% 23%, 18% 30%);
}

.note-delete-button:hover {
    border-color: rgba(239, 68, 68, .85);
    background: rgba(239, 68, 68, .3);
    color: #fff;
}

.note-resize-handle {
    position: absolute;
    z-index: 5;
    right: -6px;
    bottom: -6px;
    width: 14px;
    height: 14px;
    border: 2px solid #07111f;
    border-radius: 4px;
    background: var(--primary-light);
    cursor: nwse-resize;
}

.note-text-content {
    width: 100%;
    height: 100%;
    padding: 36px 12px 12px;
    outline: 0;
    overflow: auto;
    color: var(--text);
    background: rgba(15, 29, 47, .92);
    border-radius: 14px;
    font-family: inherit;
    line-height: 1.5;
}

.note-text-content[data-empty="true"]::before {
    content: "Írd ide a jegyzetet...";
    color: rgba(248, 250, 252, .48);
    pointer-events: none;
}

.note-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    user-select: none;
    pointer-events: none;
}

.rich-note-viewer {
    position: relative;
    overflow: hidden;
    width: min(100%, calc(var(--note-width) * 1px));
    height: min(70vh, calc(var(--note-height) * 1px));
    min-height: 320px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(rgba(96, 165, 250, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, .06) 1px, transparent 1px),
        #07111f;
    background-size: 24px 24px;
}

.rich-note-view-text,
.rich-note-view-image,
.rich-note-image-frame {
    position: absolute;
    border: 1px solid rgba(96, 165, 250, .18);
    border-radius: 12px;
}

.rich-note-view-text {
    overflow: auto;
    padding: 10px;
    background: rgba(15, 29, 47, .9);
    color: var(--text);
    line-height: 1.5;
}

.rich-note-view-image {
    object-fit: contain;
    background: rgba(8, 17, 31, .65);
}

.rich-note-image-frame {
    overflow: hidden;
    background: rgba(8, 17, 31, .65);
}

.rich-note-image-open {
    display: block;
    width: 100%;
    height: 100%;
}

.rich-note-image-frame .rich-note-view-image {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
}

.rich-note-image-download {
    position: absolute;
    z-index: 3;
    right: 8px;
    top: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(96, 165, 250, .4);
    border-radius: 999px;
    background: rgba(7, 17, 31, .88);
    color: #dbeafe;
    font-size: 18px;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.rich-note-image-download:hover {
    border-color: rgba(96, 165, 250, .86);
    background: rgba(37, 99, 235, .92);
    color: #fff;
}

.rich-note-details {
    min-width: 260px;
}

.rich-note-details summary {
    cursor: pointer;
    color: var(--primary-light);
    font-weight: 800;
}

.plain-note {
    max-width: 360px;
    color: var(--muted);
}
.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.password-toggle {
    white-space: nowrap;
    background: #0b2138;
    color: var(--blue-2);
}
.danger-link { color: #ffaaa8; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.preview img { max-width: 100%; border-radius: 8px; }
.preview iframe { width: 100%; min-height: 75vh; border: 0; background: #fff; border-radius: 8px; }
pre {
    overflow: auto;
    background: #050b14;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    line-height: 1.5;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at top, #12325a, var(--bg) 52%);
}
.login-card {
    width: min(430px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    display: grid;
    gap: 16px;
}
.login-card h1 { margin: 0; font-size: 30px; }
.login-card p { margin: 0; color: var(--muted); }

.student-dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

.student-header-card,
.student-project-card,
.student-panel,
.student-stat-card {
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.student-header-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 210px;
    margin-bottom: 24px;
    padding: 34px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 12%, rgba(96, 165, 250, .34), transparent 34%),
        linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(15, 23, 42, .82));
    backdrop-filter: blur(16px);
}

.student-header-card::after {
    content: "";
    position: absolute;
    right: 120px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .18);
    filter: blur(8px);
}

.student-header-content,
.student-profile-card {
    position: relative;
    z-index: 1;
}

.student-header-content h1 {
    margin: 10px 0 10px;
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1;
    color: #fff;
}

.student-header-content p {
    max-width: 680px;
    margin: 0;
    color: #bfdbfe;
    font-size: 17px;
    line-height: 1.65;
}

.student-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.student-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--primary-light);
    box-shadow: 0 0 18px rgba(96, 165, 250, .9);
}

.student-profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 230px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(8, 17, 31, .58);
}

.student-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.student-role {
    display: inline-flex;
    margin-bottom: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .14);
    color: #86efac;
    font-size: 12px;
    font-weight: 800;
}

.student-profile-card strong {
    display: block;
    color: #fff;
}

.student-project-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 20px;
    padding: 26px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(15, 29, 47, .98), rgba(18, 36, 58, .88));
}

.project-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
}

.project-title-row h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
}

.project-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
}

.folder-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}

.folder-pill {
    border: 1px solid rgba(96, 165, 250, .24);
    background: rgba(59, 130, 246, .12);
    color: #bfdbfe;
}

.status-pill.active {
    border: 1px solid rgba(34, 197, 94, .28);
    background: rgba(34, 197, 94, .13);
    color: #86efac;
}

.status-pill.waiting {
    border: 1px solid rgba(245, 158, 11, .32);
    background: rgba(245, 158, 11, .13);
    color: #facc15;
}

.student-action-panel {
    display: grid;
    gap: 10px;
    min-width: 230px;
}

.student-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 14px;
    background: rgba(15, 29, 47, .9);
    color: var(--text);
    font-weight: 800;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.student-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, .7);
    color: #fff;
}

.student-btn.primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #2563eb);
    box-shadow: 0 16px 34px rgba(37, 99, 235, .24);
}

.btn-icon,
.stat-icon,
.work-file-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(96, 165, 250, .16);
}

.btn-icon::before,
.stat-icon::before,
.work-file-icon::before {
    color: var(--primary-light);
    font-size: 15px;
    font-weight: 900;
}

.upload-icon::before { content: "↑"; }
.history-icon::before { content: "↺"; }
.folder-icon::before { content: "□"; }
.file-icon::before { content: "F"; }
.list-icon::before { content: "L"; }
.size-icon::before { content: "M"; }
.version-icon::before { content: "V"; }
.work-file-icon::before { content: "F"; }

.student-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.student-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 182px;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 36, 58, .96), rgba(15, 29, 47, .96));
    transition: transform .16s ease, border-color .16s ease;
}

.student-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, .48);
}

.student-stat-card .stat-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 14px;
}

.student-stat-card span:not(.stat-icon) {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.student-stat-card strong {
    display: block;
    margin: 8px 0;
    color: #fff;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
}

.student-stat-card p {
    margin: 0;
    color: #9fb2cc;
    line-height: 1.45;
}

.student-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
    gap: 20px;
}

.student-panel {
    padding: 22px;
    border-radius: 20px;
    background: rgba(15, 29, 47, .94);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 6px 0 0;
    color: #fff;
    font-size: 24px;
}

.panel-heading a {
    font-weight: 800;
    color: var(--primary-light);
}

.work-list {
    display: grid;
    gap: 12px;
}

.work-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 16px;
    background: rgba(8, 17, 31, .64);
    transition: border-color .16s ease, background .16s ease;
}

.work-item:hover {
    border-color: rgba(96, 165, 250, .38);
    background: rgba(18, 36, 58, .72);
}

.work-file-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

.work-main strong {
    display: block;
    color: #fff;
    overflow-wrap: anywhere;
}

.work-main span,
.work-main p {
    display: block;
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.work-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.work-actions a {
    padding: 8px 10px;
    border: 1px solid rgba(96, 165, 250, .2);
    border-radius: 10px;
    background: rgba(15, 29, 47, .8);
    color: #bfdbfe;
    font-weight: 800;
}

.info-panel {
    border-left: 4px solid var(--primary);
    background: linear-gradient(180deg, rgba(18, 36, 58, .98), rgba(15, 29, 47, .96));
}

.info-dot {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(96, 165, 250, .16);
    color: var(--primary-light);
    font-weight: 900;
}

.note-text {
    margin: 0 0 18px;
    color: #dbeafe;
    line-height: 1.65;
}

.info-row {
    display: grid;
    gap: 5px;
    padding: 14px 0;
    border-top: 1px solid rgba(96, 165, 250, .16);
}

.info-row span {
    color: var(--muted);
    font-size: 13px;
}

.info-row strong {
    color: #fff;
    overflow-wrap: anywhere;
}

.student-empty-state {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 48px 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 29, 47, .92);
    text-align: center;
}

.student-empty-state.compact {
    padding: 34px 20px;
}

.student-empty-state h2,
.student-empty-state h3 {
    margin: 0;
    color: #fff;
}

.student-empty-state p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.empty-visual {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 1px solid rgba(96, 165, 250, .34);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, .26), rgba(96, 165, 250, .08)),
        var(--card-2);
    box-shadow: inset 0 0 0 12px rgba(96, 165, 250, .06);
}

@media (max-width: 1100px) {
    .student-project-card,
    .student-content-grid {
        grid-template-columns: 1fr;
    }

    .student-action-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: 0;
    }

    .student-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
    .content { padding: 20px; }
    .stats { grid-template-columns: 1fr; }
    .student-hero { display: grid; align-items: start; }
    .student-stats, .student-grid { grid-template-columns: 1fr; }
    .activity-item { display: grid; }
    .student-dashboard { padding-bottom: 24px; }
    .student-header-card {
        display: grid;
        min-height: 0;
        padding: 24px;
        border-radius: 18px;
    }
    .student-profile-card { min-width: 0; }
    .student-project-card { padding: 20px; border-radius: 18px; }
    .student-action-panel { grid-template-columns: 1fr; }
    .student-stat-grid { grid-template-columns: 1fr; }
    .student-content-grid { grid-template-columns: 1fr; }
    .work-item { grid-template-columns: 1fr; }
    .work-actions { justify-content: flex-start; }
    .filters { grid-template-columns: 1fr; }
    .rich-note-head { display: grid; }
    .rich-note-canvas { min-height: 360px; }
    .page-head h1 { font-size: 26px; }
}

/* ================================
   Reszponzív / Mobil nézet
================================ */

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

button,
.btn,
.student-btn,
input,
select,
textarea {
    min-height: 44px;
}

input,
select,
textarea {
    font-size: 16px;
}

a,
button,
.btn {
    -webkit-tap-highlight-color: transparent;
}

button:active,
.btn:active,
.student-btn:active {
    transform: scale(.98);
}

.mobile-topbar,
.mobile-nav-overlay {
    display: none;
}

.selected-files ul {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.selected-files li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 10px;
    background: rgba(8, 17, 31, .55);
}

.selected-files span {
    overflow-wrap: anywhere;
}

.selected-files strong {
    flex: 0 0 auto;
    color: var(--primary-light);
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 1200px) {
    .content {
        padding: 26px;
    }

    .student-dashboard {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-header-card {
        display: grid;
        min-height: 0;
    }

    .student-profile-card {
        width: fit-content;
        min-width: min(100%, 230px);
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .upload-form,
    .form {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 80;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 62px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(7, 17, 31, .94);
        backdrop-filter: blur(14px);
    }

    .mobile-brand {
        color: #fff;
        font-size: 20px;
        font-weight: 900;
    }

    .mobile-menu-toggle {
        display: grid;
        gap: 5px;
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 10px;
        border-radius: 14px;
        background: var(--panel-2);
    }

    .mobile-menu-toggle span {
        display: block;
        height: 2px;
        border-radius: 999px;
        background: #fff;
    }

    .mobile-nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 85;
        background: rgba(0, 0, 0, .48);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }

    .mobile-menu-open .mobile-nav-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

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

    .sidebar {
        position: fixed;
        z-index: 90;
        top: 74px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 92px);
        overflow-y: auto;
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(9, 24, 42, .98);
        box-shadow: 0 24px 90px rgba(0, 0, 0, .45);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform .18s ease, opacity .18s ease;
    }

    .mobile-menu-open .sidebar {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar .brand {
        display: none;
    }

    .sidebar nav a {
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 16px;
    }

    .content {
        width: 100%;
        padding: 18px 16px 28px;
    }

    .page-head {
        margin-bottom: 16px;
    }

    .page-head h1 {
        font-size: 28px;
    }

    .page-head p {
        line-height: 1.5;
    }

    .card,
    .student-panel,
    .student-stat-card,
    .student-project-card,
    .student-header-card {
        border-radius: 16px;
        padding: 16px;
    }

    .login-body {
        padding: 16px;
        align-items: center;
    }

    .login-card {
        padding: 20px;
    }

    .login-card .btn,
    .login-card button {
        width: 100%;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .actions .btn,
    .actions a,
    .row-actions a,
    .row-actions button {
        min-height: 44px;
    }

    .student-header-content h1 {
        font-size: 34px;
    }

    .student-header-content p {
        font-size: 15px;
    }

    .project-title-row h2 {
        font-size: 27px;
    }

    .project-meta-row {
        display: grid;
        align-items: start;
    }

    .student-btn,
    .btn.primary,
    .upload-form > button[type="submit"] {
        width: 100%;
    }

    .filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .table-wrap {
        overflow: visible;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    table {
        min-width: 0;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 12px;
    }

    tr {
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: rgba(15, 29, 47, .92);
    }

    td {
        display: grid;
        grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr);
        gap: 10px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(96, 165, 250, .12);
        overflow-wrap: anywhere;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
    }

    td.row-actions,
    .row-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    td.row-actions::before {
        width: 100%;
        flex: 0 0 100%;
    }

    .row-actions a,
    .row-actions form,
    .row-actions button {
        flex: 1 1 130px;
        justify-content: center;
    }

    .inline button {
        min-height: 44px;
        padding: 8px 10px;
        border: 1px solid rgba(239, 68, 68, .34);
        border-radius: 10px;
        background: rgba(239, 68, 68, .12);
    }

    .dropzone {
        min-height: 140px;
        padding: 18px;
    }

    .dropzone-title {
        font-size: 18px;
    }

    .dropzone-text {
        font-size: 14px;
    }

    .rich-note-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .rich-note-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rich-note-toolbar button,
    .note-grid-toggle {
        width: 100%;
        min-height: 46px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .rich-note-canvas {
        min-height: 360px;
        max-width: 100%;
        overflow: hidden;
    }

    .rich-note-placeholder {
        padding: 18px;
    }

    .rich-note-tip {
        font-size: 14px;
    }

    .note-element {
        min-width: 96px;
        min-height: 72px;
    }

    .note-drag-handle {
        min-height: 32px;
        right: 48px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .note-delete-button {
        width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .note-resize-handle {
        right: -10px;
        bottom: -10px;
        width: 22px;
        height: 22px;
        border-radius: 7px;
    }

    .note-text-content {
        min-height: 72px;
        padding: 44px 12px 12px;
        font-size: 16px;
    }

    .rich-note-viewer {
        width: 100%;
        max-width: 100%;
        height: 62vh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rich-note-details {
        min-width: 0;
    }

    .preview iframe {
        min-height: 65vh;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .upload-overlay {
        padding: 14px;
    }

    .upload-loader-card {
        gap: 13px;
        padding: 24px 18px;
        border-radius: 18px;
    }

    .upload-glow-image {
        width: 92px;
        height: 92px;
        border-radius: 24px;
    }

    .upload-big-icon {
        width: 48px;
        height: 42px;
    }

    .upload-percent {
        font-size: 46px;
    }

    .upload-status {
        font-size: 16px;
    }

    .upload-details {
        width: 100%;
        display: grid;
    }

    h1,
    .page-head h1 {
        font-size: 27px;
    }

    h2,
    .card h2,
    .panel-heading h2 {
        font-size: 21px;
    }

    .content {
        padding: 16px 12px 24px;
    }

    .student-header-card {
        gap: 18px;
    }

    .student-profile-card {
        width: 100%;
    }

    .student-avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .student-stat-card {
        min-height: 150px;
    }

    .work-actions,
    .work-actions a {
        width: 100%;
    }

    .selected-files li {
        display: grid;
    }

    .password-field {
        grid-template-columns: 1fr;
    }

    .password-toggle {
        width: 100%;
    }

    td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    td::before {
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .mobile-topbar {
        padding: 10px 12px;
    }

    .mobile-brand {
        font-size: 18px;
    }

    .content {
        padding: 14px 10px 22px;
    }

    .card,
    .student-panel,
    .student-stat-card,
    .student-project-card,
    .student-header-card,
    .rich-note-panel {
        padding: 14px;
    }

    .student-header-content h1 {
        font-size: 30px;
    }

    .project-title-row h2 {
        font-size: 24px;
    }

    .rich-note-toolbar {
        grid-template-columns: 1fr;
    }

    .rich-note-canvas {
        min-height: 330px;
    }

    .dropzone {
        min-height: 118px;
    }
}
