/* =========================================================
   ADMIN STYLES — ADMIN PART OF THE SITE
   Sections:
   1. Base admin layout
   2. Admin navigation
   3. Admin common blocks
   4. Dashboard
   5. Manage content
   6. Stats admin table
   7. Publications admin
   8. Responsive
   PRACTICUM ADMIN
========================================================= */

/* =========================================================
   1. BASE ADMIN LAYOUT
========================================================= */

body.admin-page main,
body.admin-page .admin-main {
    display: block;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
}

body.admin-page #content {
    width: 100%;
    max-width: none;
    margin: 0;
    background-color: #fff;
    padding: 1.2em;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* =========================================================
   2. ADMIN NAVIGATION
   Uses main menu styling from stylesUs.css
   Here we keep only admin-specific dropdown behavior
========================================================= */

.admin-menu .has-submenu {
    position: relative;
}

.admin-menu .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.admin-menu .submenu li {
    margin: 0;
}

.admin-menu .submenu li a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 0;
}

.admin-menu .submenu li a:hover,
.admin-menu .submenu li a:focus {
    background: #f3f3f3;
}

.admin-menu .has-submenu:hover > .submenu,
.admin-menu .has-submenu:focus-within > .submenu {
    display: block;
}

body.admin-page #content {
    width: 100%;
    max-width: none;
    margin: 0;
    background-color: #fff;
    padding: 1.2em;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* =========================================================
   3. ADMIN COMMON BLOCKS
========================================================= */

.admin-block {
    margin-bottom: 28px;
}

.admin-message {
    color: green;
    margin-bottom: 16px;
}

.admin-error {
    color: red;
    margin-bottom: 16px;
}

.admin-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.secondary-button {
    background: #f2f2f2;
    border: 1px solid #ccc;
    padding: 8px 14px;
    cursor: pointer;
}


/* =========================================================
   4. DASHBOARD
========================================================= */

.dashboard-page .content-block {
    padding: 14px 0;
    margin: 0;
    border-top: 1px solid #d9d9d9;
}

.dashboard-page .content-block:first-of-type {
    border-top: none;
    padding-top: 6px;
}

.dashboard-page .content-title {
    margin: 0 0 8px 0;
    font-size: 1.35em;
    font-weight: 700;
    color: #004080;
    line-height: 1.2;
}

.dashboard-page .content-title-text {
    display: inline;
}

.dashboard-page .content-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.dashboard-page .content-toggle:focus {
    outline: none;
}

.dashboard-page .content-toggle:hover .content-title-text,
.dashboard-page .content-toggle:focus .content-title-text {
    text-decoration: underline;
}

.dashboard-page .toggle-icon {
    flex-shrink: 0;
    font-size: 0.85em;
    color: #666;
}

.dashboard-page .content-meta {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.45;
}

.dashboard-page .content-type {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    background: #f2f2f2;
    color: #333;
}

.dashboard-page .content-details {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dashboard-page .content-image {
    max-width: 150px;
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
    flex: 0 0 180px;
}

.dashboard-page .content-text {
    flex: 1 1 320px;
    min-width: 260px;
}

.dashboard-page .content-preview {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.dashboard-page .content-full {
    margin-top: 10px;
}

.dashboard-page .content-full summary {
    cursor: pointer;
    color: #800000;
    font-weight: 600;
    margin-bottom: 10px;
}

.dashboard-page .content-full-body {
    margin-top: 8px;
    line-height: 1.6;
}

.dashboard-page .toggle-full-text {
    text-decoration: none;
    font-weight: 700;
    margin-left: 6px;
    color: #800000;
    cursor: pointer;
}

.dashboard-page .location {
    margin-top: 10px;
}

.dashboard-page .actions {
    margin-top: 12px;
}

.dashboard-page .actions a {
    margin-right: 12px;
    text-decoration: none;
}


/* =========================================================
   5. MANAGE CONTENT
========================================================= */

.manage-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.manage-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: auto;
}

.manage-table th,
.manage-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
    word-break: break-word;
}

.manage-table th {
    background-color: #f2f2f2;
}

.manage-actions {
    white-space: nowrap;
}

.manage-actions a {
    text-decoration: none;
    margin-right: 8px;
    font-size: 18px;
}

.manage-filters {
    margin-bottom: 20px;
}

.manage-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.manage-pagination {
    margin-top: 20px;
}

.manage-pagination a {
    margin-right: 10px;
    text-decoration: none;
}

.manage-muted {
    color: #666;
    margin-bottom: 15px;
}

/* =========================================================
   6. STATS ADMIN TABLE
========================================================= */

.stats-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.stats-admin-table {
    width: 100%;
    min-width: 1100px;
    margin-top: 20px;
    border-collapse: collapse;
    table-layout: fixed;
}

.stats-admin-table th,
.stats-admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
    background: #fff;
}

.stats-admin-table input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* sticky columns */
.stats-admin-table th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center;
    white-space: nowrap;
}

.stats-admin-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 4;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    text-align: center;
    white-space: nowrap;
}

.stats-admin-table th:nth-child(2) {
    position: sticky;
    left: 48px;
    z-index: 5;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.stats-admin-table td:nth-child(2) {
    position: sticky;
    left: 48px;
    z-index: 4;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.stats-admin-table th:nth-child(3) {
    position: sticky;
    left: 268px;
    z-index: 5;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.stats-admin-table td:nth-child(3) {
    position: sticky;
    left: 268px;
    z-index: 4;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}


/* =========================================================
   7. PUBLICATIONS ADMIN
========================================================= */

.publications-admin-page .publications-admin-textarea {
    width: 100%;
    min-height: 220px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.publications-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.publications-manage-table,
.publications-saved-table,
.publications-edit-table {
    width: 100%;
    border-collapse: collapse;
}

.publications-manage-table input,
.publications-edit-table input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.publications-saved-link {
    max-width: 320px;
    word-break: break-all;
}

.publications-actions-cell {
    white-space: nowrap;
}

.publications-secondary-link {
    text-decoration: none;
    display: inline-block;
}


/* =========================================================
   8. RESPONSIVE
========================================================= */

@media (max-width: 600px) {
    body.admin-page .admin-main {
        padding: 1em;
    }

	.admin-menu .submenu {
		position: static;
		min-width: 100%;
		border: none;
		border-radius: 0;
		box-shadow: none;
	}

    .dashboard-page .content-details {
        flex-direction: column;
    }

    .dashboard-page .content-image {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .manage-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================================================
   ADMIN SECTIONS TOP MENU
========================================================= */

.admin-sections-menu {
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 64, 128, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.admin-sections-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #004080;
    margin: 0 0 10px 0;
}

.admin-sections-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.admin-sections-link {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2d3d;
    background: #f7f9fc;
    border: 1px solid #d9e2ec;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1.2;
    white-space: normal;
}

.admin-sections-link:hover,
.admin-sections-link:focus {
    background: #eef4fb;
    color: #004080;
    border-color: #c8d9eb;
    text-decoration: none;
}

.admin-sections-link.is-active {
    background: #004080;
    color: #ffffff;
    border-color: #004080;
    font-weight: 600;
}

@media (max-width: 700px) {
    .admin-sections-menu {
        padding: 10px 12px;
    }

    .admin-sections-title {
        margin-bottom: 8px;
    }

    .admin-sections-nav {
        gap: 6px;
    }

    .admin-sections-link {
        padding: 6px 10px;
    }
}

/* =========================================================
   PRACTICUM ADMIN
========================================================= */

.practicum-settings-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #004080;
    outline: none;
}

.practicum-settings-inner {
    margin-top: 16px;
}

.material-checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
}

.material-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.material-checkbox-item input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}

.material-checkbox-item span {
    display: block;
    line-height: 1.4;
}

.practicum-materials-cell .material-filter-input,
.practicum-materials-cell .material-type-filter {
    box-sizing: border-box;
}
.practicum-materials-cell .material-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
}
/* =========================================================
   STUDENTS ADMIN
========================================================= */

.students-admin-form-wrap {
    margin-top: 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
}

.students-courses-cell .students-courses-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #d9e2ec;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
}

.students-courses-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.students-courses-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex: 0 0 14px;
}

.students-courses-item span {
    display: block;
    line-height: 1.35;
}
/* =========================================================
   COURSE MATERIALS PICKER
========================================================= */

.course-materials-cell .material-checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
}

.course-materials-cell .material-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.course-materials-cell .material-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex: 0 0 14px;
}

.course-materials-cell .material-checkbox-item span {
    display: block;
    line-height: 1.35;
}
/* =========================================================
   COURSE TEACHERS PICKER
========================================================= */

.course-teachers-cell .teacher-checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
}

.course-teachers-cell .teacher-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.course-teachers-cell .teacher-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex: 0 0 14px;
}

.course-teachers-cell .teacher-checkbox-item span {
    display: block;
    line-height: 1.35;
}
/* =========================================================
   RESEARCH ADMIN
========================================================= */

.research-staff-cell .research-staff-checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
}

.research-staff-cell .research-staff-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.research-staff-cell .research-staff-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex: 0 0 14px;
}

.research-staff-cell .research-staff-checkbox-item span {
    display: block;
    line-height: 1.35;
}
/* =========================================================
   INSTALLATIONS ADMIN
========================================================= */

.installation-image-note {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 6px;
}

/* =========================================================
   COLLABORATIONS ADMIN
========================================================= */

.manage-table input[type="text"],
.manage-table textarea,
.manage-table select {
    max-width: 100%;
}