﻿

:root {
    
    --bg: #ffffff;
    --surface: #f8f7fb;
    --surface-strong: #f1eef8;
    --text: #211b2d;
    --muted: #71667e;
    --border: #ded7ea;
    --primary: #6f35c5;
    --primary-dark: #54249d;
    --primary-light: #efe7ff;
    --success: #18845b;
    --success-bg: #e7f7ef;
    --warning: #9a6500;
    --warning-bg: #fff5da;
    --danger: #bd2d45;
    --danger-bg: #ffe8ed;
    --shadow: 0 16px 40px rgba(58, 35, 91, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}



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

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

img {
    max-width: 100%;
}

.topbar {
    
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px clamp(16px, 5vw, 56px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.nav a:not(.button) {
    color: var(--text);
    font-size: 14px;
}

.nav a.button {
    color: #fff !important;
}

.nav a.button:hover {
    color: #fff !important;
}

.topbar .nav > a.register-button,
.topbar .nav > a.register-button:visited,
.topbar .nav > a.register-button:hover,
.topbar .nav > a.register-button:focus {
    color: #fff !important;
}

.page {
    
    flex: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 52px;
}

.footer {
    
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px clamp(16px, 5vw, 56px);
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.page-title h1 {
    margin: 0 0 14px;
    font-size: 48px;
    line-height: 1.06;
    letter-spacing: 0;
}

.page-title p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.auth-title {
    text-align: center;
}

.auth-title h1 {
    margin-bottom: 0;
    font-size: 44px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.panel,
.profile-panel,
.portfolio-card,
.form-panel,
.table-panel {
    
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}



.panel,
.form-panel,
.table-panel {
    padding: 22px;
}

.profile-panel {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 20px;
}

.profile-panel h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.profile-panel p {
    margin: 6px 0;
}

.profile-panel > div,
.portfolio-card,
.portfolio-card > *,
.section-head > *,
.portfolio-header > div,
.file-page,
.file-page-editor,
.document-preview,
.modal {
    min-width: 0;
}

.profile-panel h2,
.profile-panel p,
.portfolio-card h3,
.portfolio-meta,
.section-head h1,
.section-head h2,
.page-title h1,
.portfolio-header h1,
.portfolio-header p,
.link-list a,
.readonly-field,
.alert {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-layout {
    
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
    align-items: start;
}

.section {
    
    margin-top: 30px;
}

.section-head {
    
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-head h2,
.panel h2,
.form-panel h2,
.table-panel h2 {
    margin: 0;
    font-size: 24px;
}

.muted-text {
    color: var(--muted);
}

.small-text {
    font-size: 13px;
}



.button,
button {
    
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.button:hover,
button:hover {
    color: #fff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.button-secondary {
    
    color: var(--primary);
    background: var(--primary-light);
    border-color: #d7c3ff;
}

.button-secondary:hover {
    color: #fff;
}

.register-button {
    color: #fff !important;
    background: var(--primary);
    border-color: var(--primary);
}

.register-button:hover {
    color: #fff !important;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.button-danger {
    
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #ffc4cf;
}

.button-danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.button-small {
    
    min-height: 34px;
    padding: 7px 11px;
    font-size: 14px;
}

.button-ghost {
    
    color: var(--text);
    background: #fff;
    border-color: var(--border);
}

.button-ghost:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
    border-color: #d7c3ff;
}

form {
    margin: 0;
}



.form-grid {
    
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.compact-fields {
    
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.form-grid .full {
    
    grid-column: 1 / -1;
}

.auth-shell {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 190px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 0;
}

.auth-alert {
    width: min(460px, 100%);
}

.auth-form {
    width: min(460px, 100%);
    margin: 18px 0 0;
    padding: 22px;
}

.auth-form-register {
    width: min(520px, 100%);
}

.auth-form .form-grid,
.auth-form .compact-fields,
.auth-form .password-pair {
    grid-template-columns: 1fr;
}

.auth-form .form-grid {
    gap: 16px;
}

.auth-form .password-pair {
    gap: 16px;
}

.auth-form .password-helper {
    min-height: auto;
}

.auth-form .actions {
    justify-content: center;
    margin-top: 24px;
}

label {
    
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}

input,
select,
textarea {
    
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

input[readonly],
input[disabled],
select[disabled],
textarea[readonly],
textarea[disabled] {
    
    color: var(--muted);
    background: var(--surface);
    cursor: not-allowed;
    opacity: 1;
}

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

input:focus,
select:focus,
textarea:focus {
    
    outline: 3px solid rgba(111, 53, 197, 0.18);
    border-color: var(--primary);
}

.check-choice {
    
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 700;
}

.check-choice input {
    width: auto;
    min-height: auto;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.success-text {
    color: var(--success);
}

.danger-text {
    color: var(--danger);
}

.password-meter {
    height: 8px;
    overflow: hidden;
    background: #ece6f6;
    border-radius: 999px;
}

.password-meter span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--danger);
    transition: width 0.2s ease, background 0.2s ease;
}

.password-field {
    
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.password-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 16px;
}

.password-pair label {
    align-content: start;
}

.password-helper {
    display: block;
    min-height: 3em;
    line-height: 1.5;
}

.password-toggle {
    min-height: 42px;
    white-space: nowrap;
}

.password-match-message {
    display: block;
}



.alert {
    
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.alert.auth-alert {
    margin-top: 38px;
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
    border-color: #b9e8d0;
}

.alert-warning {
    color: var(--warning);
    background: var(--warning-bg);
    border-color: #f5daa0;
}

.alert-danger {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #ffc4cf;
}

.alert-info {
    color: var(--primary-dark);
    background: var(--primary-light);
    border-color: #d7c3ff;
}

.alert-dismissible {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.alert-dismissible > span {
    min-width: 0;
}

.alert-close {
    flex: 0 0 auto;
    width: 30px;
    min-height: 30px;
    padding: 0;
    color: inherit;
    background: transparent;
    border-color: transparent;
    border-radius: 6px;
    font-size: 24px;
    line-height: 1;
}

.alert-close:hover {
    color: var(--text);
    background: rgba(111, 53, 197, 0.12);
    border-color: #d7c3ff;
}

.error-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 20px;
}

.badge {
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.badge-muted {
    color: var(--muted);
    background: #eeeaf4;
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-bg);
}

.badge-success {
    color: var(--success);
    background: var(--success-bg);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-bg);
}



.portfolio-list {
    
    display: grid;
    gap: 14px;
}

.portfolio-card {
    
    display: grid;
    gap: 14px;
    padding: 18px;
}

.portfolio-card h3 {
    margin: 0;
    font-size: 21px;
}

.portfolio-meta {
    
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.portfolio-actions {
    
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.review-card {
    
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.student-photo {
    
    width: 94px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
}

.avatar {
    
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}

.avatar-large {
    width: 82px;
    height: 82px;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    font-weight: 700;
}

.table-wrap {
    
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}



.portfolio-document {
    
    display: grid;
    gap: 22px;
    padding: 26px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.portfolio-header {
    
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.portfolio-header-no-photo {
    grid-template-columns: minmax(0, 1fr);
}

.portfolio-photo {
    
    width: 150px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.link-list {
    
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}



.file-pages {
    
    display: grid;
    gap: 18px;
}

.file-page-editor {
    
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.file-page {
    
    padding: 18px;
    min-height: 75vh;
    page-break-before: always;
}

.file-page h3 {
    margin: 8px 0 10px;
    font-size: 24px;
}

.file-section-title {
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.15;
    break-after: avoid;
    page-break-after: avoid;
}

.file-page-editor .file-page-number {
    display: none;
}

.file-preview {
    
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.file-preview img {
    
    display: block;
    width: min(100%, 760px);
    max-height: 72vh;
    object-fit: contain;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.pdf-preview-frame {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 0;
}

.pdf-preview-open {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 2;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.pdf-preview-open:hover {
    color: var(--primary);
}

.document-preview {
    
    width: min(100%, 820px);
    min-height: 520px;
    margin: 12px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.document-preview-empty {
    display: grid;
    place-items: center;
    padding: 22px;
    text-align: center;
}

.course-work-page {
    
    display: grid;
    align-content: start;
}

.course-work-meta {
    
    display: grid;
    gap: 4px;
    margin: 8px 0 14px;
}

.course-work-meta p {
    margin: 0;
}

.course-work-cover {
    
    
    position: relative;
    display: block;
    width: min(100%, 620px);
    aspect-ratio: 210 / 297;
    margin-top: 14px;
    overflow: hidden;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.course-work-cover:hover {
    
    border-color: var(--primary);
    box-shadow: 0 10px 26px rgba(58, 35, 91, 0.14);
}

.course-work-cover img {
    
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    border: 0;
}

.course-work-editor .course-work-cover {
    
    width: min(100%, 520px);
}

.readonly-field {
    
    min-height: 42px;
    padding: 10px 12px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 400;
}

.profile-photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.optional-block {
    display: grid;
    gap: 12px;
}

.delete-file-choice,
.file-page-editor [data-remove-file-row] {
    
    margin-top: 20px;
}



.access-key-form {
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.4fr) auto;
    align-items: end;
}

.access-key-actions {
    align-self: end;
    margin-top: 0;
}

.access-key-actions button {
    min-height: 42px;
}

.access-code {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.admin-filter {
    box-shadow: none;
}

.filter-actions {
    align-items: end;
    margin-top: 0;
}

.admin-password-grid {
    grid-template-columns: minmax(460px, 1fr) auto;
    align-items: end;
}

.admin-password-grid .password-field {
    grid-template-columns: minmax(260px, 1fr) auto;
}

.admin-password-actions {
    align-self: end;
    margin-top: 0;
}

.admin-password-actions button {
    min-height: 42px;
    padding: 10px 14px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal {
    
    
    width: min(920px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.modal-small {
    width: min(620px, calc(100% - 32px));
}

.modal::backdrop {
    background: rgba(33, 27, 45, 0.42);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-head h3 {
    margin: 0;
    font-size: 24px;
}

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

.modal-divider {
    height: 1px;
    margin: 22px 0;
    background: var(--border);
}

.modal-danger {
    margin-top: 18px;
}

.admin-users-table td {
    position: relative;
}

.admin-portfolios-table .badge {
    min-width: 104px;
    white-space: normal;
}

.empty {
    
    padding: 18px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 6px;
}



@media (max-width: 860px) {
    

    .dashboard-layout,
    .form-grid,
    .compact-fields,
    .password-pair,
    .modal-grid,
    .review-card,
    .portfolio-header {
        grid-template-columns: 1fr;
    }

    .topbar,
    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        justify-content: flex-start;
    }

    .profile-panel {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .avatar-large {
        width: 68px;
        height: 68px;
    }

    .page-title h1 {
        
        font-size: 34px;
    }
}

@media (max-width: 640px) {
    .topbar {
        position: static;
        padding: 12px 14px;
    }

    .page {
        width: min(1180px, calc(100% - 20px));
        padding: 20px 0 38px;
    }

    .footer {
        padding: 18px 14px;
    }

    .section {
        margin-top: 22px;
    }

    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .section-head h2,
    .panel h2,
    .form-panel h2,
    .table-panel h2,
    .modal-head h3 {
        font-size: 22px;
    }

    .panel,
    .form-panel,
    .table-panel,
    .profile-panel,
    .portfolio-card,
    .modal {
        padding: 16px;
    }

    .page-title h1,
    .auth-title h1 {
        font-size: 32px;
    }

    .profile-panel {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 14px;
    }

    .avatar-large {
        width: 64px;
        height: 64px;
    }

    .portfolio-document {
        gap: 18px;
        padding: 18px;
    }

    .portfolio-header {
        gap: 16px;
    }

    .portfolio-photo {
        width: min(130px, 100%);
    }

    .file-page {
        min-height: auto;
        padding: 12px 0;
    }

    .file-page h3 {
        font-size: 21px;
    }

    .file-page-editor {
        padding: 14px;
    }

    .actions,
    .portfolio-actions,
    .filter-actions {
        gap: 8px;
    }

    .actions .button,
    .actions button,
    .portfolio-actions .button,
    .portfolio-actions button,
    .filter-actions .button,
    .filter-actions button,
    .section-head .button,
    .section-head button {
        width: 100%;
    }

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

    .check-choice {
        align-items: flex-start;
    }

    input[type="file"] {
        font-size: 14px;
    }

    .modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .modal-head {
        align-items: stretch;
        flex-direction: column;
    }

    .course-work-cover {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .profile-panel {
        grid-template-columns: 1fr;
    }

    .profile-panel .avatar-large {
        justify-self: start;
    }
}

@media print {

    
    @page {
        size: A4;
        margin: 12mm;
    }

    .topbar,
    .footer,
    .no-print,
    .alert {
        display: none !important;
    }

    .page {
        width: 100%;
        padding: 0;
    }

    .portfolio-document {
        border: 0;
        border-radius: 0;
        padding: 0;
    }

    .portfolio-document .file-page {
        background: transparent;
        box-shadow: none;
    }

    .document-preview {
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .course-work-page {
        
        min-height: 0;
        padding: 0;
        border: 0;
        break-inside: avoid;
    }

    .course-work-meta {
        gap: 1.5mm;
        margin: 3mm 0 4mm;
        font-size: 11pt;
    }

    .course-work-cover {
        
        width: 130mm;
        max-width: 100%;
        margin: 4mm auto 0;
        overflow: hidden;
        box-shadow: none;
        break-inside: avoid;
    }

    .pdf-preview-frame {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        overflow: hidden;
        clip-path: inset(0);
        border: 0;
    }

    .pdf-preview-open {
        display: none !important;
    }

    body {
        background: #fff;
    }
}
