:root {
    --bg-gradient: linear-gradient(135deg, #1e1e2f 0%, #2a2a40 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --accent: #6c5ce7;
    --accent-hover: #5649c0;
    --danger: #ff7675;
    --success: #55efc4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid var(--glass-border);
}

.sidebar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#memberList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.sidebar-footer,
.stats-panel {
    flex-shrink: 0;
}

.is-hidden {
    display: none !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    color: var(--text-primary);
    min-width: 0;
}

.brand i {
    color: var(--accent);
    flex-shrink: 0;
}

.brand h1 {
    font-size: clamp(1.1rem, 1.7vw, 1.35rem);
    line-height: 1.1;
    white-space: nowrap;
}

.role-summary {
    padding: 1rem;
    border-radius: 18px;
}

.role-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.role-kicker {
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.role-description,
.section-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.role-description {
    margin-top: 0.8rem;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-card {
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card-title {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.status-card-copy {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.status-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.status-btn {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.status-btn.approve {
    background: linear-gradient(135deg, #00b894 0%, #009d80 100%);
}

.status-btn.reject {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
}

.user-selection h3,
.stats-panel h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.edit-name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.member-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.member-card.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.2);
}

.member-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    min-width: 0;
}

.member-name {
    overflow-wrap: anywhere;
}

.member-identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.12rem;
}

.member-position {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.member-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.member-card:hover .member-actions {
    opacity: 1;
}

.action-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.delete-icon:hover {
    color: var(--danger);
}

.icon-spacer {
    width: 22px;
    /* Approx size of icon */
    display: inline-block;
}

/* Buttons */
/* Buttons */
button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Primary Button (New Appointment) */
.primary-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
    filter: brightness(1.1);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.primary-btn:disabled {
    background: #444;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.primary-btn.mode-active,
.availability-btn.mode-active,
.secondary-btn.mode-active {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

/* Secondary Button (Lab Meeting) */
.secondary-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 15px;
    /* Added spacing */
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 118, 117, 0.5);
    filter: brightness(1.1);
}

.secondary-btn:active {
    transform: translateY(1px);
}

.availability-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #00b894 0%, #009d80 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.28);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 15px;
}

.availability-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.38);
    filter: brightness(1.05);
}

.research-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #0984e3 0%, #6c5ce7 100%);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.25);
}

.research-btn.review-btn {
    background: linear-gradient(135deg, #6c5ce7 0%, #a55eea 100%);
}

.research-btn.workspace-btn {
    background: linear-gradient(135deg, #00b894 0%, #0984e3 100%);
}

.workspace-btn i {
    margin-right: 0.4rem;
}

.research-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.research-btn:disabled {
    background: #444;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Action Button (New Member) */
.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* View Buttons (Calendar/List) */
.view-toggles {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.view-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.view-btn.active {
    background: var(--glass-bg);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

.view-btn:hover:not(.active) {
    color: white;
}

/* Modal Buttons (keep .btn and .btn-primary reference or update modal HTML) */
.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.student-view-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.filter-chip {
    padding: 0.58rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-chip:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

.filter-chip.active {
    background: rgba(108, 92, 231, 0.22);
    border-color: rgba(108, 92, 231, 0.45);
    color: var(--text-primary);
}

.calendar-container {
    flex: 1;
    min-height: 0;
    border-radius: 20px;
    padding: 1.5rem;
    overflow: auto;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Calendar Overrides */
.fc {
    color: var(--text-primary);
}

#calendar {
    min-width: 0;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--glass-border);
}

.fc .fc-toolbar {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fc .fc-toolbar-title {
    font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.fc .fc-button {
    padding: 0.55rem 0.8rem !important;
}

.fc .fc-scrollgrid {
    min-width: 0;
}

.fc .calendar-reference-event {
    z-index: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.fc-button-primary {
    background-color: var(--glass-bg) !important;
    border-color: var(--glass-border) !important;
}

.fc-button-primary:hover {
    background-color: var(--accent) !important;
}

.fc-button-active {
    background-color: var(--accent) !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.close-modal,
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover,
.close-modal:hover {
    color: var(--text-primary);
}

.modal-hint {
    color: var(--text-secondary);
    margin-top: 0.75rem;
    margin-bottom: 1.4rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group select option {
    background: #2a2a40;
    color: white;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

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

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

.profile-subsection-title {
    margin: 0.25rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.research-modal-content {
    max-width: 780px;
}

.research-review-modal-content {
    max-width: 1040px;
    max-height: 92vh;
}

.workspace-modal-content {
    max-width: 1180px;
    max-height: 94vh;
    padding: 2rem;
}

.icon-close-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
}

.workspace-header {
    padding-right: 3rem;
}

.workspace-kicker {
    margin-bottom: 0.35rem;
    color: #74b9ff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
    padding: 0.35rem;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
}

.workspace-tab {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
}

.workspace-tab.active {
    background: rgba(108, 92, 231, 0.3);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(183, 175, 255, 0.22);
}

.workspace-tab i {
    margin-right: 0.45rem;
}

.workspace-panel {
    min-height: 420px;
}

.workspace-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 0.9rem;
}

.workspace-section-header h3 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.workspace-section-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.workspace-section-header.compact-heading {
    margin-top: 0;
}

.profile-member-picker {
    max-width: 420px;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(85, 239, 196, 0.2);
    border-radius: 999px;
    background: rgba(0, 184, 148, 0.1);
    color: #88f2d5;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.workspace-card {
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.16);
}

.workspace-card .form-group:last-child {
    margin-bottom: 0;
}

.inline-actions {
    display: flex;
    justify-content: flex-end;
}

.inline-actions .btn {
    padding: 0.75rem 1.15rem;
}

.document-section-heading {
    margin-top: 1.4rem;
}

.document-upload-grid {
    grid-template-columns: 0.85fr 1.15fr 1.6fr;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.document-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.document-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: rgba(0, 184, 148, 0.16);
    color: #7fffdc;
}

.document-icon.knowledge-icon {
    background: rgba(9, 132, 227, 0.16);
    color: #74b9ff;
}

.document-card-body {
    min-width: 0;
}

.document-card-body h4 {
    margin: 0.2rem 0 0.35rem;
    overflow-wrap: anywhere;
}

.document-card-body p {
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.document-card-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.danger-ghost-btn {
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 118, 117, 0.25);
    border-radius: 9px;
    background: rgba(255, 118, 117, 0.09);
    color: #ffb8b8;
    font-weight: 600;
}

.danger-ghost-btn:hover:not(:disabled) {
    background: rgba(255, 118, 117, 0.18);
}

.compact-empty-state {
    padding: 1.25rem 1rem;
}

.knowledge-layout {
    display: grid;
    grid-template-columns: minmax(250px, 0.78fr) minmax(0, 2fr);
    gap: 1rem;
    align-items: start;
}

.knowledge-folder-pane {
    position: sticky;
    top: 0;
}

.folder-create-form {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.folder-create-form .form-group {
    margin-bottom: 0.75rem;
}

.folder-add-btn {
    width: 100%;
}

.knowledge-folder-tree {
    display: flex;
    max-height: 430px;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 1rem;
    overflow-y: auto;
}

.knowledge-folder-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.65rem 0.65rem calc(0.65rem + var(--folder-depth) * 1rem);
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
}

.knowledge-folder-item:hover,
.knowledge-folder-item.active {
    border-color: rgba(108, 92, 231, 0.28);
    background: rgba(108, 92, 231, 0.14);
    color: white;
}

.knowledge-folder-item span {
    overflow-wrap: anywhere;
}

.knowledge-folder-item small {
    min-width: 1.5rem;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
}

.knowledge-folder-header {
    min-height: 56px;
}

.knowledge-upload-form {
    margin-bottom: 1rem;
}

.field-hint {
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.form-group input[type="file"] {
    padding: 0.55rem;
}

.form-group input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.55rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: rgba(108, 92, 231, 0.85);
    color: white;
    cursor: pointer;
}

.review-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-right: 2.5rem;
}

.research-review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.research-empty-state {
    padding: 2.5rem 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: var(--text-secondary);
    text-align: center;
}

.research-review-card {
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid #f1c40f;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.16);
}

.research-review-card[data-status="reviewed"] {
    border-left-color: #00b894;
}

.research-review-card[data-status="needs_revision"] {
    border-left-color: #ff7675;
}

.research-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.research-card-header h3 {
    margin-top: 0.35rem;
    line-height: 1.35;
}

.research-card-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.research-status {
    flex-shrink: 0;
    padding: 0.42rem 0.68rem;
    border-radius: 999px;
    background: rgba(241, 196, 15, 0.18);
    color: #ffeaa7;
    font-size: 0.78rem;
    font-weight: 700;
}

.research-status.reviewed {
    background: rgba(0, 184, 148, 0.18);
    color: #7fffdc;
}

.research-status.needs_revision {
    background: rgba(255, 118, 117, 0.18);
    color: #ffb8b8;
}

.research-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.research-detail-block {
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.research-detail-block h4 {
    margin-bottom: 0.45rem;
    color: #dfe6e9;
    font-size: 0.84rem;
}

.research-detail-block p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.research-attachment-row {
    margin: 0.9rem 0;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #74b9ff;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.attachment-link:hover {
    text-decoration: underline;
}

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

.review-comment-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.review-comment-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    color: white;
    font: inherit;
    resize: vertical;
}

.review-comment-input:focus {
    outline: none;
    border-color: var(--accent);
}

.research-review-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.status-btn.revision {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.status-btn.delete {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.1);
    color: #ffb8b8;
}

.role-modal {
    display: none;
}

.role-modal-content {
    max-width: 560px;
}

.role-modal-copy {
    color: var(--text-secondary);
    margin-top: 0.8rem;
    line-height: 1.6;
}

.entry-login-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.entry-login-grid.single-panel {
    grid-template-columns: minmax(0, 1fr);
}

.entry-login-panel {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.entry-login-panel form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.entry-login-heading {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.entry-login-heading p {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.entry-login-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
    background: rgba(108, 92, 231, 0.2);
    color: #b7afff;
}

.entry-submit-btn {
    margin-top: auto;
}

.undergraduate-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
    border: 1px solid rgba(85, 239, 196, 0.22);
    border-radius: 12px;
    background: rgba(0, 184, 148, 0.08);
    cursor: pointer;
}

.undergraduate-option input {
    width: auto;
    margin-top: 0.18rem;
    accent-color: #00b894;
}

.undergraduate-option span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.undergraduate-option small {
    color: var(--text-secondary);
    line-height: 1.4;
}

#memberPasswordInput:disabled,
#entryMemberSelect:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.role-auth-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
}

.role-auth-actions .btn,
.role-auth-actions .action-btn {
    width: auto;
}

.auth-error {
    margin-top: -0.4rem;
    margin-bottom: 1rem;
    color: #ff9f9f;
    font-size: 0.92rem;
}

.auth-error.is-hidden {
    display: none;
}

body[data-role="professor"] .role-summary {
    border-color: rgba(108, 92, 231, 0.38);
}

body[data-role="graduate"] .role-summary,
body[data-role="undergraduate"] .role-summary,
body[data-role="student"] .role-summary {
    border-color: rgba(0, 184, 148, 0.35);
}

@media (max-width: 900px) {
    body {
        min-height: 100dvh;
    }

    .app-container {
        min-height: 100dvh;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1.25rem;
        gap: 1.25rem;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .brand {
        gap: 0.6rem;
        font-size: 1rem;
    }

    .brand h1 {
        font-size: 1.05rem;
    }

    #memberList {
        max-height: 32vh;
    }

    .member-actions,
    .member-card:hover .member-actions {
        opacity: 1;
    }

    .member-name {
        overflow-wrap: anywhere;
    }

    .main-content {
        padding: 1rem;
    }

    .top-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-bar-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .student-view-controls {
        width: 100%;
    }

    .filter-chip {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    .view-toggles {
        width: 100%;
        overflow-x: auto;
    }

    .calendar-container {
        padding: 0.85rem;
        border-radius: 16px;
    }

    .fc {
        min-height: 620px;
    }

    .fc .fc-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .entry-login-grid {
        grid-template-columns: 1fr;
    }

    .form-grid.two-columns,
    .research-detail-grid,
    .document-upload-grid,
    .knowledge-layout {
        grid-template-columns: 1fr;
    }

    .workspace-modal-content {
        padding: 1.15rem;
    }

    .workspace-tabs {
        flex-direction: column;
    }

    .workspace-section-header,
    .document-card {
        align-items: stretch;
    }

    .document-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .document-delete-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .knowledge-folder-pane {
        position: static;
    }

    .knowledge-folder-tree {
        max-height: 320px;
    }

    .review-modal-header,
    .research-card-header,
    .research-review-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .role-auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .role-auth-actions .btn,
    .role-auth-actions .action-btn {
        width: 100%;
    }

    .fc .fc-button {
        font-size: 0.8rem !important;
        padding: 0.45rem 0.65rem !important;
    }

    .fc .fc-col-header-cell-cushion,
    .fc .fc-timegrid-axis-cushion,
    .fc .fc-timegrid-slot-label-cushion {
        font-size: 0.75rem;
    }

    .modal {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        margin: auto;
        padding: 1.25rem;
    }

    .close-modal,
    .modal-close {
        top: 1rem;
        right: 1rem;
    }
}
