:root {
    --color-teal: #1a4a5c;
    --color-teal-light: #2a6a7c;
    --color-salmon: #f8e8e0;
    --color-salmon-text: #8b4513;
    --color-white: #ffffff;
    --color-gray-light: #f5f5f5;
    --color-gray: #cccccc;
    --color-gray-dark: #666666;
    --color-text: #015C71;
    --color-folder-card: #D9EAEE;
    --font-heading: 'Avenir', 'Open Sans', Georgia, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-white);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a:hover {
    color: #AB4967;
}

.portal-main,
.portal-files,
.admin-dashboard {
    flex: 1;
}

button,
input[type="submit"] {
    font-family: var(--font-body);
}

.btn,
.admin-btn,
.portal-message-banner__edit-btn,
.portal-search-row__upload-btn,
.portal-upload-modal__btn,
.portal-login__submit,
.admin-tree__action-btn,
.portal-file-row__action-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-teal);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    touch-action: manipulation;
}

.btn--primary,
.admin-btn--primary,
.portal-message-banner__edit-btn--primary,
.portal-upload-modal__btn--primary,
.portal-search-row__upload-btn,
.portal-login__submit {
    background: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

.btn--primary:hover,
.admin-btn--primary:hover,
.portal-message-banner__edit-btn--primary:hover,
.portal-upload-modal__btn--primary:hover,
.portal-search-row__upload-btn:hover,
.portal-login__submit:hover {
    background: var(--color-teal-light);
    border-color: var(--color-teal-light);
}

.portal-upload-modal__btn--danger {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.portal-upload-modal__btn--danger:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

.btn--outline,
.admin-btn:not(.admin-btn--primary),
.portal-message-banner__edit-btn:not(.portal-message-banner__edit-btn--primary),
.portal-upload-modal__btn:not(.portal-upload-modal__btn--primary) {
    background: transparent;
    color: var(--color-teal);
    border-color: var(--color-teal);
}

.btn--outline:hover,
.admin-btn:not(.admin-btn--primary):hover,
.portal-message-banner__edit-btn:not(.portal-message-banner__edit-btn--primary):hover,
.portal-upload-modal__btn:not(.portal-upload-modal__btn--primary):hover {
    background: var(--color-teal);
    color: var(--color-white);
}

.btn--link,
.admin-tree__action-btn,
.portal-file-row__action-btn {
    background: none;
    border: none;
    color: var(--color-teal);
    padding: 0.4rem;
    font-size: 0.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.btn--link:hover,
.admin-tree__action-btn:hover,
.portal-file-row__action-btn:hover {
    color: var(--color-teal-light);
    background: rgba(0, 0, 0, 0.05);
}

.portal-file-row__action-btn--danger,
.admin-tree__action-btn--danger {
    color: #c0392b;
}

.portal-file-row__action-btn--danger:hover,
.admin-tree__action-btn--danger:hover {
    color: #e74c3c;
    background: rgba(192, 57, 43, 0.08);
}

.portal-tree__row--pinned {
    background: #fffdf5;
}

.portal-file-row__action-btn--pinned {
    color: var(--color-teal);
}

.portal-header-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.portal-topbar {
    background: #015C71;
    color: var(--color-white);
    padding: 0.35rem 2rem;
    border-bottom: 1px solid var(--color-white);
    font-size: 0.8rem;
}

.portal-topbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.portal-topbar__greeting {
    font-style: italic;
}

.portal-topbar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-topbar__link {
    color: var(--color-white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.portal-topbar__link:hover {
    opacity: 1;
}

.portal-topbar__link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.portal-topbar__link img,
.portal-topbar__link avatar {
    border-radius: 50%;
    vertical-align: middle;
}

.portal-topbar__link--logout {
    opacity: 0.7;
}

.portal-nav {
    background: #287A8D;
    color: var(--color-white);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.portal-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
}

.portal-nav__logo img,
.portal-nav__logo-img {
    height: 44px;
    width: auto;
}

.portal-nav__logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-white);
}

.portal-nav__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-nav__welcome {
    text-decoration: none;
}

.portal-nav__welcome em {
    font-style: italic;
    font-size: 1.5rem;
    color: var(--color-white);
}

.portal-nav__avatar img {
    border-radius: 50%;
}

.portal-nav__admin-link {
    color: var(--color-white);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.portal-nav__admin-link:hover {
    opacity: 0.8;
}

.portal-nav__bell {
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--color-white);
}

.portal-nav__avatar img {
    border-radius: 50%;
}

.portal-nav__logout {
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.875rem;
}

.portal-nav__logout:hover {
    text-decoration: underline;
}

.portal-main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 3rem;
}

.portal-message-banner__inner {
    background: #F5E6E8;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    border: 1px solid #AB4967;
    margin-bottom: 2rem;
}

.portal-message-banner__label {
    font-weight: 700;
    color: #015C71;
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.portal-message-banner__body {
    color: #015C71;
    font-size: 0.95rem;
}

.portal-message-banner__editor {
    margin-top: 1rem;
}

.portal-message-banner__editor input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.portal-message-banner__editor input[type="text"]:focus {
    border-color: var(--color-teal);
    outline: none;
}

.portal-message-banner__editor textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.portal-message-banner__editor textarea:focus {
    border-color: var(--color-teal);
    outline: none;
}

.portal-message-banner__editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.portal-search-row__inner {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.portal-search-row__input-wrap {
    flex: 1;
    position: relative;
}

.portal-search-row__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #015C71;
    font-size: 0.95rem;
    pointer-events: none;
}

.portal-search-row__input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid #015C71;
    border-radius: 0;
    font-size: 1rem;
    outline: none;
    color: #015C71;
}

.portal-search-row__input::placeholder {
    color: #015C71;
    opacity: 0.5;
}

.portal-search-row__input:focus {
    border-color: var(--color-teal);
}

.portal-search-row__search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.3);
    background: var(--color-teal);
    color: var(--color-white);
    cursor: pointer;
    font-size: 0.95rem;
}

.portal-search-row__search-btn:hover {
    background: var(--color-teal-light);
}

.portal-search-row__upload-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.portal-search-row__btn--outline {
    background: transparent;
    color: #AB4967;
    border: 2px solid #AB4967;
}

.portal-search-row__btn--outline:hover {
    background: #AB4967;
    color: #fff;
}

.portal-files__header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.portal-files__header-icon {
    font-size: 2.5rem;
    padding: 0 0.5rem;
    color: #AB4967;
}

.portal-files__header-icon:hover {
    background: #ECF4F6;
}

.portal-search-floating .portal-search-row__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    margin-bottom: 0;
}

.portal-featured {
    background: #ECF4F6;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.portal-featured__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.portal-featured__label {
    font-family: var(--font-heading);
    color: #AB4967;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.portal-featured__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.portal-featured__carousel {
    position: relative;
}

.portal-featured__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 2rem;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.portal-featured__track::-webkit-scrollbar {
    display: none;
}

.portal-folder-card {
    scroll-snap-align: start;
    flex-shrink: 0;
}

.portal-featured__arrow {
    background: none;
    border: none;
    color: var(--color-teal);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.portal-featured__arrow:hover {
    color: #AB4967;
}

.portal-featured__play {
    background: none;
    border: none;
    color: var(--color-teal);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.portal-featured__play:hover {
    color: #AB4967;
}

.portal-featured__nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.portal-featured__arrow:hover {
    color: #AB4967;
}

.portal-featured__empty {
    text-align: center;
    color: var(--color-gray-dark);
    font-style: italic;
    padding: 2rem;
    width: 100%;
}

.portal-folder-card {
    background: var(--color-folder-card);
    border-radius: 8px;
    padding: 1.25rem;
    min-width: 260px;
    max-width: 280px;
    flex-shrink: 0;
    position: relative;
    transition: transform 0.15s ease;
    display: flex;
    flex-direction: column;
}

.portal-folder-card:hover {
    transform: translateY(-2px);
}

.portal-folder-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.portal-folder-card__unpin-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.15);
    color: var(--color-gray-dark);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.portal-folder-card__unpin-btn:hover {
    background: rgba(180, 40, 40, 0.2);
    color: #a00;
}

.portal-folder-card__label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #287A8D;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.portal-folder-card__date {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #015C71;
}

.portal-folder-card__date-label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #287A8D;
    letter-spacing: 0.1em;
    margin-top: auto;
}

.portal-folder-card__title {
    font-family: 'Cardo', Georgia, serif;
    font-weight: 600;
    font-size: 1.625rem;
    color: var(--color-teal);
    margin-bottom: 0.5rem;
}

.portal-folder-card__title:hover {
    color: #AB4967;
}

.portal-files__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.portal-files__header-row .portal-files__label {
    margin-bottom: 0;
}

.portal-files__label {
    font-family: var(--font-heading);
    color: #AB4967;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.portal-files__scroll {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b0c4cc transparent;
}

.portal-files__scroll::-webkit-scrollbar {
    width: 6px;
}

.portal-files__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.portal-files__scroll::-webkit-scrollbar-thumb {
    background: #b0c4cc;
    border-radius: 3px;
}

.portal-files__scroll::-webkit-scrollbar-thumb:hover {
    background: #8aabb5;
}

.portal-files__table {
    width: 100%;
    border-collapse: collapse;
}

.portal-files__table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #015C71;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--color-gray-dark);
    letter-spacing: 0.05em;
    transition: color 0.15s;
    position: sticky;
    top: 0;
    background: var(--color-white);
    z-index: 1;
}

.portal-files__table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.portal-files__table thead th.sortable:hover {
    color: var(--color-teal);
}

.portal-files__table thead th.sortable::after {
    content: ' \2195';
    opacity: 0.6;
    font-size: 1rem;
}

.portal-files__table thead th.sortable.sort-asc::after {
    content: ' \2191';
    opacity: 1;
    color: var(--color-teal);
}

.portal-files__table thead th.sortable.sort-desc::after {
    content: ' \2193';
    opacity: 1;
    color: var(--color-teal);
}

.portal-files__table thead th:not(.sortable):hover {
    color: var(--color-teal);
}

.portal-files__table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #015C71;
    font-size: 0.9rem;
}

.portal-files__table tbody tr:hover {
    background: #ECF4F6;
}

.portal-tree__toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-teal);
    font-size: 12px;
    transition: transform 0.15s ease;
}

.portal-tree__toggle:hover {
    color: var(--color-teal);
}

.portal-tree__chevron {
    transition: transform 0.15s ease;
}

.portal-tree__toggle-spacer {
    display: inline-block;
    width: 20px;
}

.portal-tree__name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.portal-tree__folder-label {
    white-space: nowrap;
}

.portal-tree__row--folder {
    cursor: pointer;
}

.portal-tree__row.selected {
    background: #ECF4F6;
}

.portal-tree__row[data-tree-depth="1"] td:first-child { padding-left: 24px; }
.portal-tree__row[data-tree-depth="2"] td:first-child { padding-left: 48px; }
.portal-tree__row[data-tree-depth="3"] td:first-child { padding-left: 72px; }
.portal-tree__row[data-tree-depth="4"] td:first-child { padding-left: 96px; }
.portal-tree__row[data-tree-depth="5"] td:first-child { padding-left: 120px; }

.portal-files__empty {
    text-align: center;
    color: var(--color-gray-dark);
    padding: 2rem;
}

.portal-file-row__icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-file-row__icon .portal-file-row__icon-fa {
    font-size: 20px;
    color: var(--color-teal);
    flex-shrink: 0;
}

.portal-file-row__name-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.portal-file-row__name-link:hover {
    text-decoration: underline;
}

.portal-file-row__location {
    font-size: 0.85rem;
    color: var(--color-gray-dark);
}

.portal-file-row__location a {
    color: var(--color-teal);
    text-decoration: none;
}

.portal-file-row__location a:hover {
    color: #AB4967;
    text-decoration: underline;
}

.portal-file-row__actions {
    display: flex;
    gap: 0.5rem;
}

.portal-folder-breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: var(--color-gray-dark);
}

.portal-folder-breadcrumb a {
    color: var(--color-teal);
    text-decoration: none;
}

.portal-folder-breadcrumb a:hover {
    color: #AB4967;
    text-decoration: underline;
}

.portal-folder-breadcrumb .current {
    color: var(--color-text);
    font-weight: 600;
}

.portal-footer {
    background: var(--color-teal);
    color: var(--color-white);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
}

.portal-upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.portal-upload-modal.active {
    display: flex;
}

.portal-upload-modal__card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
}

.portal-upload-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.portal-upload-modal__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #AB4967;
    margin: 0;
}

.portal-upload-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-gray-dark);
    padding: 0;
    line-height: 1;
}

.portal-upload-modal__close:hover {
    color: var(--color-text);
}

.portal-upload-modal__field {
    margin-bottom: 1rem;
}

.portal-upload-modal__field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-gray-dark);
}

.portal-upload-modal__field input,
.portal-upload-modal__field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.95rem;
}

.portal-upload-modal__new-folder-toggle {
    background: none;
    border: none;
    color: var(--color-teal);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.35rem 0;
    text-decoration: underline;
}

.portal-upload-modal__new-folder-toggle:hover {
    color: #AB4967;
}

.portal-upload-modal__new-folder-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portal-upload-modal__new-folder-row input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.9rem;
}

.portal-upload-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.portal-upload-dropzone {
    border: 2px dashed var(--color-gray);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.portal-upload-dropzone:hover,
.portal-upload-dropzone--active {
    border-color: var(--color-teal);
    background: #ECF4F6;
}

.portal-upload-dropzone__icon {
    font-size: 2.5rem;
    color: var(--color-teal);
    margin-bottom: 0.5rem;
}

.portal-upload-dropzone__text {
    font-size: 0.95rem;
    color: var(--color-text);
    margin: 0;
}

.portal-upload-dropzone__subtext {
    font-size: 0.8rem;
    color: var(--color-gray-dark);
    margin: 0.5rem 0;
}

.portal-upload-dropzone__btn {
    margin-top: 0.25rem;
}

.portal-upload-queue {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.portal-upload-queue__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    background: #fafafa;
}

.portal-upload-queue__info {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    max-width: 180px;
}

.portal-upload-queue__name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-upload-queue__size {
    font-size: 0.7rem;
    color: var(--color-gray-dark);
}

.portal-upload-queue__title {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.85rem;
    min-width: 0;
}

.portal-upload-queue__progress {
    width: 60px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.portal-upload-queue__progress-bar {
    height: 100%;
    background: var(--color-teal);
    border-radius: 2px;
    transition: width 0.2s;
}

.portal-upload-queue__done {
    color: #27ae60;
    font-size: 1.1rem;
}

.portal-upload-queue__error {
    color: #e74c3c;
    font-size: 0.8rem;
    font-weight: 600;
}

.portal-upload-queue__remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray-dark);
    padding: 0.25rem;
    font-size: 0.9rem;
}

.portal-upload-queue__remove:hover {
    color: #e74c3c;
}

@media (max-width: 768px) {
    .portal-nav__inner {
        padding: 0 1rem;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .portal-nav__welcome {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .portal-search-row__inner {
        flex-direction: column;
    }

    .portal-search-row__search-btn {
        position: relative;
        height: auto;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .portal-search-row__upload-btn {
        width: 100%;
    }

    .portal-main {
        padding: 1rem;
    }

    .portal-files__table {
        display: block;
        overflow-x: auto;
    }

    .portal-folder-card {
        min-width: 160px;
    }

    .portal-file-row__actions {
        flex-wrap: wrap;
    }
}

.portal-profile {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.portal-profile__header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2rem;
}

.portal-profile__title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: #AB4967;
}

.portal-profile__role {
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    background: var(--color-gray-light);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.portal-profile__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.portal-profile__card {
    background: var(--color-white);
    border: 1px solid var(--color-gray);
    border-radius: 8px;
    padding: 1.5rem;
}

.portal-profile__section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #AB4967;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-light);
}

.portal-profile__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-profile__field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    margin-bottom: 0.25rem;
}

.portal-profile__field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.portal-profile__field input:disabled {
    background: var(--color-gray-light);
    color: var(--color-gray-dark);
    cursor: not-allowed;
}

.portal-profile__field select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: #fff;
}

.portal-profile__status {
    font-size: 0.85rem;
    min-height: 1.2em;
}

.portal-profile__photo-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.portal-profile__photo-wrap img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-gray);
}

.portal-profile__photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-profile__back {
    font-size: 0.9rem;
    color: var(--color-teal);
    text-decoration: none;
}

.portal-profile__back:hover {
    color: #AB4967;
    text-decoration: underline;
}

.portal-profile__hint {
    font-size: 0.85rem;
    color: var(--color-gray-dark);
    margin-bottom: 0.5rem;
}

.portal-profile__btn-row {
    display: flex;
    gap: 0.75rem;
}

.portal-profile__field .admin-users__password-row {
    display: flex;
    gap: 0.25rem;
}

.portal-profile__field .admin-users__password-row input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.portal-profile__field .admin-users__password-row .admin-btn {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.portal-profile__field .admin-users__pw-meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.portal-profile__field .admin-users__pw-meter-bar {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.portal-profile__field .admin-users__pw-meter-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.2s, background 0.2s;
}

.portal-profile__field .admin-users__pw-meter-text {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.portal-profile__match-hint {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

.admin-activity__user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-activity__user-cell img {
    border-radius: 50%;
}

@media (max-width: 768px) {
    .portal-profile__grid {
        grid-template-columns: 1fr;
    }
}

/* Document Viewer */
#jcrc-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    overscroll-behavior: none;
}

#jcrc-viewer-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #525659;
    display: flex;
    flex-direction: column;
}

#jcrc-viewer-toolbar {
    height: 48px;
    flex-shrink: 0;
    background: var(--color-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 10;
    user-select: none;
}

.jcrc-viewer__left,
.jcrc-viewer__center,
.jcrc-viewer__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.jcrc-viewer__left {
    flex: 1;
    min-width: 0;
}

.jcrc-viewer__center {
    flex: 0 0 auto;
}

.jcrc-viewer__right {
    flex: 1;
    justify-content: flex-end;
}

.jcrc-viewer__btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    touch-action: manipulation;
}

.jcrc-viewer__btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.jcrc-viewer__title {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jcrc-viewer__page-info {
    font-size: 0.8rem;
    min-width: 80px;
    text-align: center;
}

.jcrc-viewer__zoom-level {
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
}

.jcrc-viewer__btn--download {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

#jcrc-viewer-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.jcrc-viewer-page-wrapper {
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    background: #fff;
    line-height: 0;
}

.jcrc-viewer-page-wrapper canvas {
    display: block;
}

#jcrc-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    padding-top: 3rem;
}

.jcrc-viewer__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jcrc-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes jcrc-spin {
    to { transform: rotate(360deg); }
}

#jcrc-viewer-error {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    padding-top: 3rem;
}

#jcrc-viewer-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jcrc-viewer__image {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#jcrc-viewer-mobile-nav {
    height: 56px;
    flex-shrink: 0;
    background: var(--color-teal);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    padding-bottom: env(safe-area-inset-bottom);
}

#jcrc-viewer-mobile-nav .jcrc-viewer__btn {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
}

@media (max-width: 768px) {
    .jcrc-viewer__title {
        max-width: 100px;
    }

    .jcrc-viewer-page-wrapper {
        margin: 0 4px 8px;
    }

    .jcrc-viewer__btn--download {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}
