:root {
    --portal-orange: #e67e22;
    --portal-orange-light: #fdf2e6;
    --portal-orange-dark: #d35400;
    --portal-bg: #f4f5f7;
    --portal-card: #ffffff;
    --portal-text: #2c3e50;
    --portal-muted: #7f8c8d;
    --portal-border: #e8eaed;
    --portal-sidebar-width: 260px;
    --portal-right-width: 300px;
    --portal-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body.portal-body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--portal-bg);
    color: var(--portal-text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-shell {
    display: grid;
    grid-template-columns: var(--portal-sidebar-width) 1fr;
    min-height: 100vh;
}

.portal-main-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Sticky chrome: header + optional page title bar stick together */
.portal-top {
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--portal-card);
    border-bottom: 1px solid var(--portal-border);
}

.portal-page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    padding: 0.4rem 1.5rem 0.5rem;
    background: var(--portal-card);
    border-bottom: 1px solid var(--portal-border);
}

.portal-page-bar-main {
    min-width: 0;
    flex: 1 1 12rem;
}

.portal-page-bar-main > a.list-item-meta,
.portal-page-bar-main > a.quick-action-link {
    display: inline-block;
    margin-bottom: 0.1rem;
    font-size: 0.8rem;
}

.portal-page-bar-main h1,
.portal-page-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.3;
}

.portal-page-bar-main p,
.portal-page-subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    color: var(--portal-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-page-bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    flex-shrink: 0;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
}

.portal-brand-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 8px;
}

.portal-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--portal-orange), var(--portal-orange-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.portal-greeting-card {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 160px;
    margin-bottom: 0;
}

.portal-greeting-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.portal-greeting-overlay {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1.75rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.94) 0%,
        rgba(255, 255, 255, 0.82) 40%,
        rgba(255, 255, 255, 0.35) 70%,
        rgba(255, 255, 255, 0.1) 100%
    );
}

.portal-greeting-overlay h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.portal-greeting-overlay p {
    margin: 0;
    color: var(--portal-muted);
}

/* ===== Home dashboard ===== */
.home-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-greeting {
    margin-bottom: 0;
}

.home-block {
    margin: 0;
}

.home-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.home-news {
    margin-bottom: 0;
}

/* HR & services — compact cards (no rainbow pills) */
.home-service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-service-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    box-shadow: var(--portal-shadow);
    color: inherit;
    text-decoration: none;
    min-height: 4.25rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-service-card:hover {
    border-color: rgba(230, 126, 34, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
    color: inherit;
}

.home-service-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.home-service-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.home-service-title {
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.3;
}

.home-service-desc {
    font-size: 0.78rem;
    color: var(--portal-muted);
    line-height: 1.3;
}

.home-service-chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--portal-muted);
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.home-service-card:hover .home-service-chevron {
    opacity: 1;
    color: var(--portal-orange);
    transform: translateX(2px);
}

/* Soft accent chips (services + workspace icons) */
.accent-orange { background: #fdf2e6; color: #d35400; }
.accent-blue { background: #ebf5fb; color: #2980b9; }
.accent-green { background: #eafaf1; color: #1e8449; }
.accent-purple { background: #f5eef8; color: #7d3c98; }
.accent-red { background: #fdedec; color: #c0392b; }
.accent-teal { background: #e8f8f5; color: #148f77; }

/* Work area: one shell, 3 columns */
.home-workspace {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

.home-workspace > .home-workspace-panel {
    display: flex;
    flex-direction: column;
    min-height: 17rem;
    height: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.home-workspace > .home-workspace-panel + .home-workspace-panel {
    border-left: 1px solid var(--portal-border);
}

.home-workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    height: 3.15rem;
    min-height: 3.15rem;
    max-height: 3.15rem;
    padding: 0 1.1rem;
    background: linear-gradient(180deg, #fafbfc 0%, #f7f8fa 100%);
    border-bottom: 1px solid var(--portal-border);
    box-sizing: border-box;
}

.home-workspace-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.home-workspace-badge {
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--portal-border);
    color: var(--portal-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.home-workspace-icon {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.home-workspace-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.home-workspace-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1.1rem 1.05rem;
}

.home-workspace-body .task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-course-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.home-course-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.home-course-item:hover {
    background: #fafbfc;
    border-color: var(--portal-border);
    color: inherit;
}

.home-course-item .progress-bar-wrap {
    margin: 0.45rem 0 0.3rem;
}

.home-panel-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem 0.5rem;
    gap: 0.15rem;
}

.home-panel-empty i {
    font-size: 1.45rem;
    color: var(--portal-muted);
    opacity: 0.55;
    margin-bottom: 0.35rem;
}

.home-panel-empty p {
    font-size: 0.85rem;
    color: var(--portal-muted);
    margin: 0 0 0.45rem;
}

.home-panel-empty-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.home-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.home-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    padding: 0.55rem 0.55rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.home-file-item:hover {
    background: #fafbfc;
    border-color: var(--portal-border);
    color: inherit;
}

.home-file-item-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.home-file-item-text {
    min-width: 0;
}

.home-file-item-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.home-file-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light, #fdebd0);
    color: var(--portal-orange-dark, #b9770e);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.home-file-chevron {
    font-size: 0.68rem;
    color: var(--portal-muted);
    opacity: 0.5;
}

.home-file-item:hover .home-file-chevron {
    opacity: 1;
    color: var(--portal-orange);
}

.home-file-star {
    color: #f1c40f;
    font-size: 0.75rem;
    margin-right: 0.2rem;
}

.home-files-hint {
    margin: 0.65rem 0.2rem 0;
}

@media (max-width: 1200px) {
    .home-service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .home-workspace {
        grid-template-columns: 1fr;
    }

    .home-workspace > .home-workspace-panel {
        min-height: 0;
    }

    .home-workspace > .home-workspace-panel + .home-workspace-panel {
        border-left: none;
        border-top: 1px solid var(--portal-border);
    }
}

@media (max-width: 640px) {
    .home-service-grid {
        grid-template-columns: 1fr;
    }
}

.fm-btn.is-favorite,
.fm-btn.is-favorite i {
    color: #f1c40f;
}

.fm-item-star {
    margin-left: auto;
    opacity: 0.35;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    line-height: 1;
}

.fm-item-star:hover,
.fm-item-star.is-on {
    opacity: 1;
    color: #f1c40f;
}

.fm-row.is-list .fm-item-star {
    flex-shrink: 0;
}

.login-brand {
    justify-content: center;
}

.login-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--portal-text);
}

.portal-dropdown {
    min-width: 260px;
    border-radius: 12px;
    box-shadow: var(--portal-shadow);
}

/* legacy img rule kept via .news-card-image img below */

.news-detail {
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.news-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.news-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--portal-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.news-detail-back:hover {
    color: var(--portal-orange-dark);
}

.news-detail-nav-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.news-detail-delete-form {
    display: inline;
    margin: 0;
}

.news-engagement {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-detail-article {
    padding: 0;
    overflow: hidden;
}

.news-detail-cover {
    position: relative;
    max-height: 480px;
    min-height: 220px;
    background: linear-gradient(135deg, #fdebd0, #e67e22);
    overflow: hidden;
}

.news-detail-image {
    width: 100%;
    max-height: 480px;
    min-height: 220px;
    object-fit: cover;
    display: block;
}

.news-detail-content {
    padding: 2rem 2.25rem 1.75rem;
}

.news-detail-article:not(.has-cover) .news-detail-content {
    padding-top: 2rem;
}

.news-detail-article:not(:has(.news-detail-reactions)) .news-detail-content {
    padding-bottom: 2.25rem;
}

.news-detail-header {
    margin-bottom: 1.65rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--portal-border);
}

.news-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.news-detail-category {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.news-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.news-detail-meta-item i {
    opacity: 0.75;
    font-size: 0.8rem;
}

.news-detail-title {
    margin: 0 0 0.7rem;
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--portal-text);
}

.news-detail-lead {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.55;
    color: var(--portal-muted);
    font-weight: 500;
    max-width: 62rem;
}

.news-detail-body {
    font-size: 1.05rem;
    line-height: 1.75;
    max-width: 62rem;
}

.news-detail-body > :first-child {
    margin-top: 0;
}

.news-detail-body > :last-child {
    margin-bottom: 0;
}

.news-detail-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1rem 2.25rem 1.25rem;
    border-top: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.news-detail-reactions-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--portal-muted);
    margin-right: 0.15rem;
}

.news-detail-reactions .news-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.news-detail-reactions .news-reaction-btn {
    background: #fff;
}

.employee-card:hover {
    border-color: var(--portal-orange);
    transform: translateY(-2px);
    transition: transform 0.15s, border-color 0.15s;
}

.portal-search {
    flex: 1;
    max-width: 640px;
    position: relative;
}

.portal-search-wrap {
    position: relative;
}

.portal-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--portal-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.portal-search input {
    width: 100%;
    border: 1px solid var(--portal-border);
    background: #f8f9fa;
    border-radius: 999px;
    padding: 0.7rem 1.2rem 0.7rem 2.5rem;
    font-size: 0.95rem;
}

.portal-search input:focus {
    outline: 2px solid rgba(230, 126, 34, 0.25);
    border-color: var(--portal-orange);
    background: #fff;
}

.portal-search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 200;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
    max-height: min(70vh, 480px);
    overflow: auto;
    padding: 0.4rem 0;
}

.portal-search-section + .portal-search-section {
    border-top: 1px solid var(--portal-border);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.portal-search-section-title {
    padding: 0.4rem 1rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--portal-muted);
}

.portal-search-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    text-decoration: none;
    color: inherit;
}

.portal-search-item:hover,
.portal-search-item:focus {
    background: var(--portal-orange-light);
    outline: none;
}

.portal-search-item-icon {
    width: 1.1rem;
    margin-top: 0.2rem;
    color: var(--portal-orange);
    flex-shrink: 0;
    text-align: center;
}

.portal-search-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-search-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    word-break: break-word;
}

.portal-search-item-meta {
    font-size: 0.78rem;
    color: var(--portal-muted);
    line-height: 1.3;
    word-break: break-word;
}

.portal-search-item-badge {
    flex-shrink: 0;
    max-width: 42%;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--portal-orange-dark);
    background: var(--portal-orange-light);
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: center;
}

.portal-search-empty {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--portal-muted);
}

.portal-search-footer {
    display: block;
    border-top: 1px solid var(--portal-border);
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-orange-dark);
    text-align: center;
}

.portal-search-footer:hover {
    background: var(--portal-orange-light);
}

.search-doc-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-doc-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.search-doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
    margin-top: 0.15rem;
}

.search-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #f0f2f5;
    color: var(--portal-muted);
}

.search-badge-source {
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
}

.search-badge-type {
    background: #eef6ff;
    color: #2c6fad;
}

/* Full search results page */
.search-page {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.search-page-search {
    box-shadow: var(--portal-shadow);
}

.search-page-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-page-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    font-size: 0.92rem;
    color: var(--portal-muted);
}

.search-page-meta-count {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.search-page-meta-query {
    font-weight: 600;
    color: var(--portal-text);
}

.search-page-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.search-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: var(--portal-card);
    color: var(--portal-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.search-page-jump i {
    color: var(--portal-orange);
    font-size: 0.78rem;
}

.search-page-jump span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.search-page-jump:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 40%, var(--portal-border));
    background: #fff8f0;
    color: var(--portal-orange-dark);
}

.search-page-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.search-page-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.search-page-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.search-page-empty-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    max-width: 32rem;
    line-height: 1.5;
}

.search-page-sections {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.search-section {
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 6rem;
}

.search-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.2rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.search-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.search-section-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.search-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.search-section-hint {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--portal-muted);
    line-height: 1.4;
}

.search-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.search-section-empty {
    margin: 0;
    padding: 1.25rem 1.2rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.search-section-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem 1.1rem;
    border-top: 1px solid var(--portal-border);
    background: #fafbfc;
}

.search-hit-list {
    display: flex;
    flex-direction: column;
}

.search-hit {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--portal-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.search-hit:last-child {
    border-bottom: none;
}

.search-hit:hover {
    background: color-mix(in srgb, var(--portal-orange) 5%, #fff);
    color: inherit;
}

.search-hit-media {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #fdebd0, #e67e22);
    color: #fff;
    font-size: 1.15rem;
}

.search-hit-media-news {
    background: linear-gradient(145deg, #fdebd0, #e67e22);
}

.search-hit-media-doc {
    background: linear-gradient(145deg, #ebf5fb, #5dade2);
}

.search-hit-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-hit-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.search-hit-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
}

.search-hit-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.5rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.search-hit-meta {
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.search-hit-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--portal-text);
}

.search-hit:hover .search-hit-title {
    color: var(--portal-orange-dark);
}

.search-hit-summary {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--portal-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 640px) {
    .search-hit {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.8rem 1rem;
    }

    .search-hit-media {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .search-section-header {
        padding: 0.85rem 1rem;
    }
}

.portal-header-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.portal-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--portal-border);
}

.portal-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--portal-orange);
    color: white;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.portal-content-wrap {
    display: grid;
    grid-template-columns: 1fr var(--portal-right-width);
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: start;
}

/* Title lives in portal-page-bar; less top padding needed */
.portal-top:has(.portal-page-bar) + .portal-content-wrap {
    padding-top: 1rem;
}

/* Full-bleed only for file manager / chat shells */
.portal-content-wrap:has(.fm),
.portal-content-wrap:has(.chat-tg-shell) {
    padding: 0;
    gap: 0;
}

.portal-content-wrap.no-right {
    grid-template-columns: 1fr;
}

.portal-sidebar {
    background: var(--portal-card);
    border-right: 1px solid var(--portal-border);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.portal-sidebar-brand {
    padding: 1.25rem 1.5rem 0.5rem;
    display: none;
}

.portal-nav-section {
    padding: 1rem 0.75rem;
}

.portal-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-muted);
    padding: 0 0.75rem 0.5rem;
    font-weight: 600;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    color: var(--portal-text);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    transition: background 0.15s;
}

.portal-nav-link:hover {
    background: #f8f9fa;
}

.portal-nav-link.active {
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-weight: 600;
}

.portal-nav-link i {
    width: 1.25rem;
    text-align: center;
    color: var(--portal-muted);
}

.portal-nav-link.active i {
    color: var(--portal-orange);
}

.portal-user-card {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--portal-border);
}

.portal-user-info {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.portal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.portal-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.portal-user-dept {
    font-size: 0.8rem;
    color: var(--portal-muted);
}

.portal-user-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
}

.portal-user-links a {
    color: var(--portal-orange);
}

.portal-main {
    min-width: 0;
}

.portal-greeting h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.portal-greeting p {
    margin: 0 0 1.5rem;
    color: var(--portal-muted);
}

.portal-card {
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    box-shadow: var(--portal-shadow);
    padding: 1.25rem;
}

.portal-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-action-card {
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--portal-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-action-card i {
    font-size: 1.4rem;
    color: var(--portal-orange);
}

.quick-action-card h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.quick-action-link {
    color: var(--portal-orange);
    font-size: 0.85rem;
    font-weight: 600;
}

.news-index {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.news-index-search {
    box-shadow: var(--portal-shadow);
}

.news-index-toolbar {
    margin-bottom: 0.85rem;
}

.news-index-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.news-index-meta-count {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.news-index-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.news-index-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.news-index-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.news-index-empty-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    max-width: 28rem;
}

.news-featured {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    margin-bottom: 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-featured:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 35%, var(--portal-border));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.news-featured-media {
    min-height: 260px;
    background: linear-gradient(135deg, #fdebd0, #e67e22);
    position: relative;
    overflow: hidden;
}

.news-featured-media img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
}

.news-featured-media.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-featured-fallback {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.news-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.75rem 1.85rem;
    min-width: 0;
}

.news-featured-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.news-featured-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: var(--portal-orange);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.news-featured-category {
    position: static;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-featured-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.news-featured-summary {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.98rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-section {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.15rem;
}

.news-section:last-child {
    margin-bottom: 0;
}

.news-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.news-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.news-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.news-section .news-grid {
    padding: 1.1rem;
    margin-bottom: 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: var(--portal-card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    text-decoration: none;
    color: inherit;
    min-height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.news-card:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 40%, var(--portal-border));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
    color: inherit;
}

.news-card-image {
    position: relative;
    isolation: isolate;
    height: 160px;
    background: linear-gradient(135deg, #fdebd0 0%, #f5b041 55%, #e67e22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card:nth-child(3n+2) .news-card-image {
    background: linear-gradient(135deg, #fdebd0, #e67e22);
}

.news-card:nth-child(3n+3) .news-card-image {
    background: linear-gradient(135deg, #ebf5fb, #5dade2);
}

.news-card:nth-child(3n+4) .news-card-image {
    background: linear-gradient(135deg, #e8f8f5, #48c9b0);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-image-fallback {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.92);
}

.news-card-category {
    position: absolute;
    left: 0.7rem;
    top: 0.7rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 1.4rem);
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--portal-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.news-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.05rem 1.05rem;
    flex: 1;
    min-width: 0;
}

.news-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--portal-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-form-preview {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.news-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

.news-editor-main {
    padding: 1.5rem;
}

.news-editor-side-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.news-editor-side-title {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.news-editor-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.news-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--portal-border);
}

.news-editor-cancel {
    color: var(--portal-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.news-editor-cancel:hover {
    color: var(--portal-orange-dark);
}

.news-editor-events {
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.news-events-subtitle {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.news-linked-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-linked-event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    background: var(--portal-surface-2, rgba(0, 0, 0, 0.02));
}

.news-linked-event-body {
    min-width: 0;
    flex: 1;
}

.news-detail-events {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--portal-border);
}

.news-detail-events-title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.news-detail-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.news-detail-events-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.event-linked-news-link {
    color: var(--portal-orange-dark, #c45c00);
    text-decoration: none;
}

.event-linked-news-link:hover {
    text-decoration: underline;
}

.news-char-count {
    font-size: 0.8rem;
    color: var(--portal-muted);
}

.news-quill-editor {
    min-height: 280px;
    background: #fff;
}

.news-quill-editor .ql-toolbar {
    border-radius: 10px 10px 0 0;
    border-color: var(--portal-border);
    background: #fafafa;
}

.news-quill-editor .ql-container {
    border-radius: 0 0 10px 10px;
    border-color: var(--portal-border);
    font-size: 0.95rem;
}

.news-quill-editor .ql-editor {
    min-height: 240px;
    line-height: 1.65;
}

.news-cover-dropzone {
    position: relative;
    border: 2px dashed var(--portal-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fafafa;
}

.news-cover-dropzone.is-dragover {
    border-color: var(--portal-orange);
    background: #fff8f0;
}

.news-cover-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.news-cover-dropzone-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--portal-muted);
    font-size: 0.8rem;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.55);
}

.news-cover-dropzone-hint i {
    font-size: 1.25rem;
    color: var(--portal-orange);
}

.news-editor-file-label {
    font-size: 0.85rem;
}

.news-manage-card,
.manage-card {
    padding: 0;
    overflow: hidden;
}

.news-manage-table,
.manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.news-manage-table th,
.news-manage-table td,
.manage-table th,
.manage-table td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
}

.news-manage-table th,
.manage-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-muted);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    font-weight: 700;
}

.news-manage-table tbody tr:hover,
.manage-table tbody tr:hover,
.directory-table tbody tr:hover {
    background: color-mix(in srgb, var(--portal-orange) 4%, #fff);
}

.news-manage-title,
.manage-table-title {
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

.news-manage-title:hover,
.manage-table-title:hover {
    color: var(--portal-orange-dark);
}

.news-manage-actions,
.manage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.news-btn-publish {
    border-color: var(--portal-orange) !important;
    color: var(--portal-orange-dark) !important;
}

.news-manage-empty,
.manage-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--portal-muted);
}

.news-manage-empty i {
    font-size: 2rem;
    color: var(--portal-orange);
    margin-bottom: 0.75rem;
}

.manage-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.manage-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.manage-empty-text {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    max-width: 28rem;
}

.manage-page {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.manage-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.manage-page-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.manage-page-meta-count {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.manage-page-meta-sep {
    opacity: 0.5;
}

.manage-card-padded {
    padding: 1.15rem 1.25rem 1.25rem;
}

.manage-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.manage-card-header-pad {
    margin: 0;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.manage-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.manage-filter-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.15rem;
}

.manage-filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-muted);
    margin: 0;
}

.manage-filter-select {
    max-width: 220px;
    border-radius: 999px;
}

.news-body-content {
    line-height: 1.7;
    font-size: 0.98rem;
}

.news-body-content h2,
.news-body-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.news-body-content p {
    margin-bottom: 0.85rem;
}

.news-body-content ul,
.news-body-content ol {
    margin-bottom: 0.85rem;
    padding-left: 1.25rem;
}

.news-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0.75rem 0;
}

.news-body-content .news-video-embed,
.news-body-content .news-inline-video,
.news-body-content video {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    border-radius: 12px;
    background: #000;
}

.news-body-content .news-video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.news-body-content .news-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.news-quill-toolbar {
    border: 1px solid var(--portal-border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: #fafafa;
}

.news-quill-toolbar .ql-video-custom {
    width: 28px;
    color: var(--portal-muted);
}

.news-quill-toolbar .ql-video-custom:hover {
    color: var(--portal-orange-dark);
}

.news-quill-editor .ql-container {
    border-radius: 0 0 10px 10px;
}

.news-quill-editor .news-video-embed {
    aspect-ratio: 16 / 9;
    margin: 0.5rem 0;
}

.news-quill-editor .news-video-embed iframe {
    width: 100%;
    height: 100%;
}

.news-quill-editor .news-inline-video,
.news-quill-editor video.news-inline-video {
    width: 100%;
    max-height: 360px;
}

.news-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.news-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.news-reaction-btn:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 50%, var(--portal-border));
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.news-reaction-btn.is-active {
    border-color: var(--portal-orange);
    background: #fff8f0;
}

.news-reaction-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.news-reaction-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--portal-text);
}

.news-reaction-count {
    color: var(--portal-muted);
    font-weight: 700;
    min-width: 0.9rem;
}

.news-comments {
    padding: 0;
    overflow: hidden;
}

.news-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.news-comments-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-comments-sort {
    margin: 0;
    min-width: 10rem;
}

.news-comments-sort-select,
.news-comments-sort select {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--portal-border);
    background: #fff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.news-comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.news-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    min-height: 6rem;
}

.news-comments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.25rem 1rem;
    text-align: center;
    color: var(--portal-muted);
}

.news-comments-empty-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.news-comments-empty-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.news-comments-empty-text {
    margin: 0;
    font-size: 0.9rem;
}

.news-comment-item {
    display: flex;
    gap: 0.8rem;
    padding: 0;
    border: none;
    align-items: flex-start;
}

.news-comment-item.is-reply .news-comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.news-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    --comment-avatar: var(--portal-orange);
    background: linear-gradient(145deg, color-mix(in srgb, var(--comment-avatar) 68%, #fff), var(--comment-avatar));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--comment-avatar) 28%, transparent);
}

.news-comment-body {
    flex: 1;
    min-width: 0;
}

.news-comment-bubble {
    padding: 0.75rem 0.95rem 0.85rem;
    border-radius: 4px 16px 16px 16px;
    background: #f5f7f9;
    border: 1px solid color-mix(in srgb, var(--portal-border) 80%, transparent);
}

.news-comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.35rem;
}

.news-comment-who {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    min-width: 0;
}

.news-comment-author {
    color: var(--portal-text);
    font-size: 0.92rem;
    font-weight: 700;
}

.news-comment-dept {
    font-size: 0.8rem;
    color: var(--portal-muted);
}

.news-comment-time {
    font-size: 0.78rem;
    color: var(--portal-muted);
    white-space: nowrap;
}

.news-comment-time::before {
    content: none;
}

.news-comment-text {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.96rem;
    color: var(--portal-text);
}

.news-comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-top: 0.4rem;
    padding-left: 0.15rem;
}

.news-comment-reactions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.news-comment-reaction-btn,
.news-comment-reaction-add {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--portal-muted);
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.news-comment-reaction-btn {
    background: #fff;
    border-color: var(--portal-border);
}

.news-comment-reaction-btn.is-active,
.news-comment-reaction-btn:hover,
.news-comment-reaction-add:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 45%, var(--portal-border));
    background: #fff8f0;
    color: var(--portal-orange-dark);
}

.news-comment-reaction-add {
    color: var(--portal-muted);
}

.news-comment-reaction-picker {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 5;
    display: flex;
    gap: 0.2rem;
    padding: 0.4rem;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.news-comment-reaction-pick {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.2rem 0.25rem;
    border-radius: 8px;
    line-height: 1;
}

.news-comment-reaction-pick:hover,
.news-comment-reaction-pick.is-active {
    background: #fff8f0;
}

.news-comment-reaction-pick.is-active {
    outline: 2px solid var(--portal-orange);
    outline-offset: 1px;
}

.news-comment-reply-btn,
.news-comment-delete,
.news-comment-reply-cancel {
    border: none;
    background: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
    color: var(--portal-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 6px;
}

.news-comment-reply-btn:hover {
    color: var(--portal-orange-dark);
    background: #fff8f0;
}

.news-comment-delete {
    color: #a93226;
}

.news-comment-delete:hover {
    background: #fdecea;
}

.news-comment-reply-form {
    margin-top: 0.55rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: #fafbfc;
    border: 1px solid var(--portal-border);
}

.news-comment-reply-form textarea {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.92rem;
    resize: vertical;
    background: #fff;
}

.news-comment-reply-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn-portal-sm {
    width: auto;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.news-comment-replies {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.85rem;
    margin-left: 0.35rem;
    padding-left: 0.9rem;
    border-left: 2px solid color-mix(in srgb, var(--portal-orange) 28%, var(--portal-border));
}

.news-comment-form {
    margin: 0;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid var(--portal-border);
    background: #fafbfc;
}

.news-comment-composer {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.news-comment-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f5d0a9, var(--portal-orange));
    color: #fff;
    font-size: 0.85rem;
}

.news-comment-composer-main {
    flex: 1;
    min-width: 0;
}

.news-comment-composer-input,
.news-comment-form textarea {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 2.75rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-comment-composer-input:focus,
.news-comment-form textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--portal-orange) 55%, var(--portal-border));
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.12);
}

.news-comment-form-actions {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.news-comment-composer-hint {
    font-size: 0.78rem;
    color: var(--portal-muted);
}

@media (max-width: 768px) {
    .news-detail-content {
        padding: 1.25rem 1.2rem 1.15rem;
    }

    .news-detail-title {
        font-size: 1.4rem;
    }

    .news-detail-cover,
    .news-detail-image {
        max-height: 260px;
        min-height: 160px;
    }

    .news-detail-reactions {
        padding: 0.9rem 1.2rem 1.1rem;
        gap: 0.55rem;
    }

    .news-detail-reactions-label {
        width: 100%;
    }

    .news-reaction-label {
        display: none;
    }

    .news-comments-header,
    .news-comments-list,
    .news-comment-form {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .news-comment-composer-hint {
        display: none;
    }
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    font-size: 0.95rem;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid rgba(230, 126, 34, 0.25);
    border-color: var(--portal-orange);
}

@media (max-width: 992px) {
    .news-editor-layout {
        grid-template-columns: 1fr;
    }
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.35rem;
}

.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--portal-muted);
}

.news-card-date i {
    font-size: 0.75rem;
    opacity: 0.8;
}

.news-card-stats {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.news-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-weight: 600;
}

.news-card-stat i {
    font-size: 0.75rem;
    opacity: 0.85;
}

.knowledge-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
}

.knowledge-search-bar > i {
    color: var(--portal-muted);
    flex-shrink: 0;
}

.knowledge-search-bar input {
    flex: 1;
    min-width: 200px;
    border: none;
    background: transparent;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.knowledge-search-bar input:focus {
    outline: none;
}

.knowledge-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.knowledge-layout:not(:has(.knowledge-nav)) {
    grid-template-columns: 1fr;
}

.knowledge-nav {
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 0.65rem;
    position: sticky;
    top: 5.5rem;
}

.knowledge-nav.section-nav {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
    overflow: hidden;
    padding: 0.5rem 0.65rem 0.65rem;
}

.section-nav-header {
    flex-shrink: 0;
    margin-bottom: 0.15rem;
}

.section-nav-search {
    width: 100%;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    background: var(--portal-bg);
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    margin: 0 0.35rem 0.35rem;
}

.section-nav-search:focus {
    outline: none;
    border-color: var(--portal-orange);
}

.section-nav-all {
    flex-shrink: 0;
    margin-bottom: 0.15rem;
}

.section-nav-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-right: 2px;
}

.section-nav-list.is-scrollable {
    mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent 100%);
}

.section-nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-nav-branch {
    margin-bottom: 0.05rem;
}

.section-nav-branch.is-filter-hidden {
    display: none;
}

.section-nav-branch-row {
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
}

.section-nav-branch-toggle {
    flex-shrink: 0;
    width: 1.35rem;
    border: none;
    background: transparent;
    color: var(--portal-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.section-nav-branch-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--portal-text);
}

.section-nav-branch-toggle i {
    font-size: 0.65rem;
    transition: transform 0.15s ease;
}

.section-nav-branch.is-open > .section-nav-branch-row .section-nav-branch-toggle i {
    transform: rotate(90deg);
}

.section-nav-branch-spacer {
    flex-shrink: 0;
    width: 1.35rem;
}

.section-nav-branch-row .knowledge-nav-link {
    flex: 1;
    min-width: 0;
}

.section-nav-branch-children {
    display: none;
}

.section-nav-branch.is-open > .section-nav-branch-children {
    display: block;
}

.knowledge-nav-link.is-filter-hidden {
    display: none;
}

.knowledge-nav-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-muted);
    padding: 0.35rem 0.75rem 0.55rem;
}

.knowledge-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--portal-text);
    transition: background 0.12s ease;
}

.knowledge-nav-tree-link {
    padding-left: calc(0.75rem + var(--tree-depth, 0) * 0.85rem);
}

.category-tree-indent {
    display: inline-block;
    width: calc(var(--tree-depth, 0) * 0.85rem);
    flex-shrink: 0;
}

.category-tree-edit-form {
    min-width: 12rem;
}

.category-tree-parent-form select {
    min-width: 10rem;
}

.knowledge-nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
}

.knowledge-nav-link.is-active {
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-weight: 600;
}

.knowledge-nav-count {
    font-size: 0.78rem;
    color: var(--portal-muted);
    font-weight: 500;
}

.knowledge-nav-link.is-active .knowledge-nav-count {
    color: var(--portal-orange-dark);
}

.knowledge-nav-mobile {
    display: none;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.knowledge-filter-chip {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--portal-card);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
}

.knowledge-filter-chip.is-active {
    background: var(--portal-orange-light);
    border-color: var(--portal-orange);
    color: var(--portal-orange-dark);
}

.knowledge-content-meta {
    font-size: 0.85rem;
    color: var(--portal-muted);
    margin: 0 0 0.75rem;
}

.knowledge-section {
    padding: 0;
    overflow: hidden;
}

.knowledge-section-title {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    background: #f8f9fa;
    border-bottom: 1px solid var(--portal-border);
}

.knowledge-section-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--portal-muted);
}

.knowledge-row {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    transition: background 0.12s ease;
}

.knowledge-row:last-child {
    border-bottom: none;
}

.knowledge-row:hover {
    background: rgba(230, 126, 34, 0.04);
}

.knowledge-row-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--portal-text);
    margin-bottom: 0.2rem;
}

.knowledge-row-summary {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--portal-muted);
    margin-bottom: 0.3rem;
}

.knowledge-row-meta {
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.knowledge-empty {
    padding: 1.5rem;
    color: var(--portal-muted);
}

/* Knowledge base index + detail */
.kb-index {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.kb-index-search {
    box-shadow: var(--portal-shadow);
}

.kb-index-toolbar {
    margin-bottom: 0.85rem;
}

.kb-index-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.kb-index-meta-count {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.kb-index-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.kb-index-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.kb-index-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.kb-index-empty-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    max-width: 28rem;
}

.kb-section {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.1rem;
}

.kb-section:last-child {
    margin-bottom: 0;
}

.kb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.kb-section-heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.kb-section-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.kb-section-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
}

.kb-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.kb-list {
    display: flex;
    flex-direction: column;
}

.kb-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.95rem;
    align-items: stretch;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--portal-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease;
}

.kb-card:last-child {
    border-bottom: none;
}

.kb-card:hover {
    background: color-mix(in srgb, var(--portal-orange) 5%, #fff);
    color: inherit;
}

.kb-card-media {
    width: 96px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(145deg, #fdebd0, #e67e22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-card:nth-child(3n+2) .kb-card-media {
    background: linear-gradient(145deg, #ebf5fb, #5dade2);
}

.kb-card:nth-child(3n+3) .kb-card-media {
    background: linear-gradient(145deg, #e8f8f5, #48c9b0);
}

.kb-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kb-card-media-fallback {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.35rem;
}

.kb-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.kb-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
}

.kb-card-category {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.kb-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.kb-card-date i {
    font-size: 0.72rem;
    opacity: 0.8;
}

.kb-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--portal-text);
}

.kb-card:hover .kb-card-title {
    color: var(--portal-orange-dark);
}

.kb-card-summary {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--portal-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--portal-orange-dark);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.kb-card:hover .kb-card-more {
    opacity: 1;
    transform: translateX(0);
}

.kb-detail {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.kb-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.kb-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--portal-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.kb-detail-back:hover {
    color: var(--portal-orange-dark);
}

.kb-detail-nav-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.kb-detail-article {
    padding: 0;
    overflow: hidden;
}

.kb-detail-cover {
    position: relative;
    max-height: 420px;
    min-height: 200px;
    background: linear-gradient(135deg, #fdebd0, #e67e22);
    overflow: hidden;
}

.kb-detail-image {
    width: 100%;
    max-height: 420px;
    min-height: 200px;
    object-fit: cover;
    display: block;
}

.kb-detail-content {
    padding: 2rem 2.25rem 2.25rem;
}

.kb-detail-article:not(.has-cover) .kb-detail-content {
    padding-top: 2rem;
}

.kb-detail-header {
    margin-bottom: 1.55rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--portal-border);
}

.kb-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.kb-detail-category {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.kb-detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.kb-detail-meta-item i {
    opacity: 0.75;
    font-size: 0.8rem;
}

.kb-detail-title {
    margin: 0 0 0.7rem;
    font-size: clamp(1.7rem, 2.6vw, 2.2rem);
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--portal-text);
}

.kb-detail-lead {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--portal-muted);
    font-weight: 500;
    max-width: 62rem;
}

.kb-detail-body {
    font-size: 1.05rem;
    line-height: 1.75;
    max-width: 62rem;
}

.kb-detail-body > :first-child {
    margin-top: 0;
}

.kb-detail-body > :last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .kb-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.85rem 1rem;
    }

    .kb-card-media {
        width: 72px;
        height: 64px;
        border-radius: 10px;
    }

    .kb-card-more {
        display: none;
    }

    .kb-detail-content {
        padding: 1.25rem 1.2rem 1.4rem;
    }

    .kb-detail-title {
        font-size: 1.4rem;
    }

    .kb-detail-cover,
    .kb-detail-image {
        max-height: 240px;
        min-height: 150px;
    }
}

/* Directory index */
.directory-index {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.directory-index-search {
    box-shadow: var(--portal-shadow);
}

.directory-index-toolbar {
    margin-bottom: 0.85rem;
}

.directory-index-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    font-size: 0.9rem;
    color: var(--portal-muted);
}

.directory-index-meta-count {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.directory-index-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.directory-index-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.directory-index-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.directory-index-empty-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    max-width: 28rem;
}

.directory-section {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.1rem;
}

.directory-section:last-child {
    margin-bottom: 0;
}

.directory-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.directory-section-heading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.directory-section-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.directory-section-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
}

.directory-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.directory-list {
    display: flex;
    flex-direction: column;
}

.dir-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--portal-border);
    transition: background 0.12s ease;
}

.dir-card:last-child {
    border-bottom: none;
}

.dir-card:hover {
    background: color-mix(in srgb, var(--portal-orange) 5%, #fff);
}

.dir-card-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.dir-card-main:hover {
    color: inherit;
}

.dir-card-avatar {
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dir-card-identity {
    min-width: 0;
    flex: 1;
}

.dir-card-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.dir-card-name {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--portal-text);
}

.dir-card-main:hover .dir-card-name {
    color: var(--portal-orange-dark);
}

.dir-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.dir-card-position {
    font-size: 0.86rem;
    color: var(--portal-muted);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-card-department {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.dir-card-department i {
    font-size: 0.7rem;
    opacity: 0.8;
    color: var(--portal-orange);
}

.dir-card-chevron {
    display: none;
    color: var(--portal-muted);
    font-size: 0.75rem;
    opacity: 0.55;
    flex-shrink: 0;
}

.dir-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    max-width: 28rem;
}

.dir-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: #fff;
    color: var(--portal-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.dir-card-action span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dir-card-action i {
    color: var(--portal-orange);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.dir-card-action:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 45%, var(--portal-border));
    background: #fff8f0;
    color: var(--portal-orange-dark);
}

.dir-card-action-primary {
    background: var(--portal-orange-light);
    border-color: color-mix(in srgb, var(--portal-orange) 30%, var(--portal-border));
    color: var(--portal-orange-dark);
}

.dir-card-action-primary:hover {
    background: #fff;
    color: var(--portal-orange-dark);
}

@media (max-width: 900px) {
    .dir-card {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        align-items: stretch;
    }

    .dir-card-actions {
        justify-content: flex-start;
        max-width: none;
        padding-left: 3.5rem;
    }

    .dir-card-chevron {
        display: inline-flex;
    }
}

@media (max-width: 560px) {
    .dir-card {
        padding: 0.85rem 1rem;
    }

    .dir-card-actions {
        padding-left: 0;
    }

    .dir-card-action span {
        max-width: 11rem;
    }
}

.portal-sidebar-toggle {
    border: 1px solid var(--portal-border);
    background: var(--portal-card);
    color: var(--portal-text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.portal-sidebar-toggle:hover {
    border-color: var(--portal-orange);
    color: var(--portal-orange);
}

.portal-shell.sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
}

.portal-shell.sidebar-collapsed .portal-sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.portal-sidebar {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Services catalog */
.services-page {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.services-page-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
}

.services-page-intro-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.services-page-intro-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.services-page-intro-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    line-height: 1.45;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}

.service-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.service-card:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 40%, var(--portal-border));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
    color: inherit;
}

.service-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.service-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.service-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.service-card:hover .service-card-title {
    color: var(--portal-orange-dark);
}

.service-card-desc {
    font-size: 0.84rem;
    color: var(--portal-muted);
    line-height: 1.4;
}

.service-card-chevron {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--portal-muted);
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.service-card:hover .service-card-chevron {
    opacity: 1;
    color: var(--portal-orange);
    transform: translateX(2px);
}

.service-detail {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.service-detail-nav {
    display: flex;
    align-items: center;
}

.service-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--portal-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.service-detail-back:hover {
    color: var(--portal-orange-dark);
}

.service-detail-card {
    padding: 0;
    overflow: hidden;
}

.service-detail-hero {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--portal-orange) 12%, #fff) 0%, #fff 70%);
    border-bottom: 1px solid var(--portal-border);
}

.service-detail-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.service-detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fef9e7;
    color: #d68910;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.service-detail-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 750;
    line-height: 1.25;
}

.service-detail-lead {
    margin: 0;
    color: var(--portal-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.service-detail-body {
    padding: 1.5rem 2rem 2rem;
}

.service-detail-panel {
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    background: #fafbfc;
    margin-bottom: 1.15rem;
}

.service-detail-panel-title {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
}

.service-detail-panel-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--portal-muted);
    line-height: 1.5;
}

.service-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

/* Tasks */
.tasks-page {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.tasks-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tasks-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: var(--portal-card);
    color: var(--portal-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.tasks-filter:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 40%, var(--portal-border));
    color: var(--portal-orange-dark);
}

.tasks-filter.is-active {
    background: var(--portal-orange);
    border-color: var(--portal-orange);
    color: #fff;
}

.tasks-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.72rem;
    font-weight: 700;
}

.tasks-filter:not(.is-active) .tasks-filter-count {
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
}

.tasks-filter-total {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--portal-muted);
    font-weight: 600;
}

.tasks-board {
    padding: 1.15rem 1.25rem 1.25rem;
}

.tasks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
}

.tasks-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.tasks-empty-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--portal-text);
}

.tasks-empty-text {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    color: var(--portal-muted);
    max-width: 28rem;
}

.tasks-assigned-header {
    margin-bottom: 0.15rem;
}

.tasks-assigned-title {
    margin: 0 0 0.25rem;
    font-size: 1.45rem;
    font-weight: 750;
}

.tasks-assigned-subtitle {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.95rem;
}

.tasks-detail {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.tasks-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.tasks-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--portal-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.tasks-detail-back:hover {
    color: var(--portal-orange-dark);
}

.tasks-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--portal-orange) 10%, #fff) 0%, #fff 72%);
}

.tasks-detail-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.tasks-detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.45rem;
}

.tasks-detail-type-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--portal-muted);
}

.tasks-detail-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 750;
    line-height: 1.25;
}

.tasks-detail-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tasks-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.15rem;
    align-items: start;
}

.tasks-detail-main,
.tasks-detail-side {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
}

.tasks-detail-panel {
    padding: 1.25rem 1.35rem 1.4rem;
}

.tasks-detail-panel-title {
    margin: 0 0 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tasks-detail-panel-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.tasks-detail-muted {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.tasks-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tasks-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tasks-detail-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-muted);
}

.tasks-detail-field-value {
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-word;
}

.tasks-detail-participants {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tasks-detail-side-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tasks-reject-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.tasks-reject-form .form-control {
    flex: 1;
    min-width: 200px;
}

.task-comment-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
}

.task-comment-form-actions {
    margin-top: 0.65rem;
    display: flex;
    justify-content: flex-end;
}

.service-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.service-pill {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.pill-orange { background: #e67e22; }
.pill-blue { background: #3498db; }
.pill-green { background: #27ae60; }
.pill-purple { background: #8e44ad; }
.pill-red { background: #e74c3c; }
.pill-teal { background: #16a085; }

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--portal-muted);
}

.file-type {
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

.status-new { background: #ebf5fb; color: #2980b9; }
.status-progress { background: #fef9e7; color: #d68910; }
.status-completed { background: #eafaf1; color: #1e8449; }
.status-rejected { background: #fdedec; color: #c0392b; }
.status-cancelled { background: #f4f6f7; color: #7f8c8d; }
.status-draft { background: #f4f6f7; color: #7f8c8d; }
.status-published { background: #eafaf1; color: #1e8449; }

@media (max-width: 1024px) {
    .tasks-detail-grid {
        grid-template-columns: 1fr;
    }

    .tasks-detail-hero {
        flex-direction: column;
    }

    .tasks-filter-total {
        margin-left: 0;
        width: 100%;
    }
}

.list-item-link {
    color: inherit;
    transition: background 0.15s ease;
}

.list-item-link:hover {
    background: rgba(0, 0, 0, 0.03);
}

.task-description {
    white-space: pre-wrap;
}

.task-widget-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.task-widget-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #ebf5fb;
    color: #2980b9;
}

.task-widget-add {
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--portal-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.task-widget-add:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--portal-orange-dark);
}

.task-widget-empty {
    text-align: center;
    padding: 1rem 0.5rem 0.25rem;
}

.task-widget-empty i {
    font-size: 1.5rem;
    color: var(--portal-muted);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.task-widget-empty p {
    font-size: 0.85rem;
    color: var(--portal-muted);
    margin-bottom: 0.75rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.task-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    background: #fff;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.task-card:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 40%, var(--portal-border));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.task-card-overdue {
    border-color: rgba(192, 57, 43, 0.25);
    background: linear-gradient(90deg, rgba(253, 237, 236, 0.55), #fff 40%);
}

.task-card-compact {
    padding: 0.55rem 0.65rem;
    gap: 0.6rem;
}

.task-card-type {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.task-card-compact .task-card-type {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.task-type-personal {
    background: #eafaf1;
    color: #1e8449;
}

.task-type-assignment {
    background: #ebf5fb;
    color: #2980b9;
}

.task-type-approval {
    background: #f5eef8;
    color: #7d3c98;
}

.task-card-body {
    flex: 1;
    min-width: 0;
}

.task-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

.task-card-compact .task-card-title {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.task-card-sep {
    opacity: 0.55;
}

.task-type-label {
    font-weight: 600;
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
}

.task-due-compact {
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.due-overdue { color: #c0392b; }
.due-today { color: #d68910; }
.due-tomorrow { color: #2980b9; }
.due-normal { color: var(--portal-muted); font-weight: 500; }
.due-muted { color: var(--portal-muted); font-weight: 500; }

.task-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.task-detail-type {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.task-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem 1.25rem;
}

.task-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.task-detail-meta-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-muted);
}

.task-detail-meta-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.task-detail-meta-wide {
    grid-column: 1 / -1;
}

.task-participant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.task-group {
    margin-bottom: 1.35rem;
}

.task-group:last-child {
    margin-bottom: 0;
}

.task-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--portal-border);
}

.task-group-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--portal-muted);
}

.task-group-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #f4f6f8;
    color: var(--portal-muted);
}

.task-group-overdue .task-group-title { color: #c0392b; }
.task-group-overdue .task-group-count { background: #fdedec; color: #c0392b; }
.task-group-today .task-group-title { color: #d68910; }
.task-group-finished .task-group-title { color: #7f8c8d; }

.task-participant-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
    min-height: 1.5rem;
}

.task-participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem 0.2rem 0.65rem;
    border-radius: 999px;
    background: #f4f6f8;
    font-size: 0.82rem;
}

.task-participant-remove {
    border: none;
    background: transparent;
    color: var(--portal-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.task-participant-search-wrap {
    position: relative;
}

.task-participant-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 20;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow: auto;
}

.task-participant-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
}

.task-participant-result:hover {
    background: rgba(0, 0, 0, 0.03);
}

.task-participant-result-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.task-participant-result-meta {
    font-size: 0.78rem;
    color: var(--portal-muted);
}

.task-participant-empty {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--portal-muted);
}

.task-history {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.task-history-entry {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--portal-border);
}

.task-history-entry:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.task-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.task-history-meta time {
    color: var(--portal-muted);
}

.task-history-changes {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.88rem;
    color: var(--portal-text, #2c3e50);
}

.task-history-changes li + li {
    margin-top: 0.2rem;
}

.task-comments {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.task-comment {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.task-comment-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.task-comment-body {
    flex: 1;
    min-width: 0;
    background: #f8f9fb;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
}

.task-comment-mine .task-comment-body {
    background: #fef9e7;
}

.task-comment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.task-comment-time {
    margin-left: auto;
    color: var(--portal-muted);
    font-size: 0.75rem;
}

.task-comment-text {
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.45;
}

.progress-bar-wrap {
    background: #ecf0f1;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--portal-orange);
    border-radius: 999px;
}

.portal-right-panel .portal-card {
    margin-bottom: 1rem;
}

.event-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.event-item:last-child { border-bottom: none; }

.event-date {
    min-width: 48px;
    text-align: center;
    background: var(--portal-orange-light);
    border-radius: 10px;
    padding: 0.35rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--portal-orange-dark);
    line-height: 1.2;
}

.employee-manager-item .employee-manager-body {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.employee-manager-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
    flex-shrink: 0;
}



.contact-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    border-radius: 999px;
    background: #f4f6f8;
    font-size: 0.8rem;
    line-height: 1.2;
}

.user-chip-avatar {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
}

.user-chip-label {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}

.user-chip-name {
    font-weight: 600;
    color: var(--portal-text, #1f2d3d);
}

.user-chip-meta {
    font-size: 0.72rem;
    color: var(--portal-muted, #6c757d);
}

.contact-avatar,
.avatar-host {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    --avatar-color: var(--portal-orange);
    background: linear-gradient(145deg, color-mix(in srgb, var(--avatar-color) 72%, #fff), var(--avatar-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-host.has-image {
    background: #ecf0f1;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.contact-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.contact-position {
    font-size: 0.75rem;
    color: var(--portal-muted);
}

.portal-ib-card {
    overflow: hidden;
}

.portal-ib-carousel {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #f8f4ff 0%, #f4f5f7 100%);
}

.portal-ib-carousel .carousel-indicators {
    margin-bottom: 0.35rem;
}

.portal-ib-carousel .carousel-indicators [data-bs-target] {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(230, 126, 34, 0.35);
    border: 0;
    opacity: 1;
}

.portal-ib-carousel .carousel-indicators .active {
    background-color: var(--portal-orange);
}

.portal-ib-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.portal-ib-article {
    display: block;
    color: inherit;
    text-decoration: none;
}

.portal-ib-article:hover .portal-ib-article-title {
    color: var(--portal-orange-dark);
}

.portal-ib-article .portal-ib-carousel {
    margin-bottom: 0.85rem;
}

.portal-ib-article-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-ib-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    transition: color 0.15s;
}

.portal-ib-article-summary {
    font-size: 0.8rem;
    color: var(--portal-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.important-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--portal-muted);
    line-height: 1.45;
}

.important-notice i {
    color: var(--portal-orange);
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* In-content headers (detail pages with rich chrome). Prefer portal-page-bar for list/manage. */
.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
    line-height: 1.3;
}

.page-header p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 12% 18%, rgba(230, 126, 34, 0.18) 0%, transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(243, 156, 18, 0.14) 0%, transparent 30%),
        linear-gradient(145deg, #fff8f1 0%, #fef3e7 38%, #f7f8fa 100%);
}

.login-shell {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(230, 126, 34, 0.14);
    box-shadow: 0 18px 48px rgba(44, 62, 80, 0.12);
}

.login-hero {
    position: relative;
    min-height: 560px;
    background: #101820;
    overflow: hidden;
}

.login-hero-media {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.login-hero-video {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #101820;
}

.login-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 2.25rem;
    color: #fff;
    pointer-events: none;
    background: linear-gradient(
        to right,
        rgba(211, 84, 0, 0.94) 0%,
        rgba(230, 126, 34, 0.82) 32%,
        rgba(230, 126, 34, 0.45) 50%,
        rgba(44, 62, 80, 0.1) 62%,
        transparent 72%
    );
}

.login-hero-overlay > * {
    pointer-events: auto;
    max-width: 24rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.login-hero-logo {
    width: min(240px, 72%);
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.18));
}

.login-hero-tagline {
    margin: 0 0 1.75rem;
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 26rem;
    color: rgba(255, 255, 255, 0.94);
}

.login-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.login-hero-features li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.login-hero-features i {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.85rem;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 2rem;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.login-card-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--portal-orange-light);
    padding: 0.45rem;
    flex-shrink: 0;
}

.login-card h1 {
    margin: 0 0 0.2rem;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
}

.login-card-header p {
    color: var(--portal-muted);
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.login-form {
    margin-top: 0.25rem;
}

.login-field {
    margin-bottom: 1.1rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--portal-muted);
    font-size: 0.9rem;
    pointer-events: none;
}



.login-submit {
    margin-top: 0.35rem;
    gap: 0.55rem;
    min-height: 48px;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(230, 126, 34, 0.34);
}

.login-submit:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.login-footer-note {
    margin: 1.35rem 0 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.login-footer-note i {
    color: var(--portal-orange);
    margin-top: 0.1rem;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 460px;
    }

    .login-hero {
        min-height: 240px;
    }

    .login-hero-overlay {
        padding: 1.5rem 1.35rem;
        justify-content: flex-end;
        background: linear-gradient(
            to top,
            rgba(211, 84, 0, 0.94) 0%,
            rgba(230, 126, 34, 0.72) 38%,
            rgba(44, 62, 80, 0.15) 58%,
            transparent 78%
        );
    }

    .login-hero-overlay > * {
        max-width: 100%;
    }

    .login-hero-logo {
        width: 180px;
        margin-bottom: 0.65rem;
    }

    .login-hero-tagline {
        margin-bottom: 0;
        font-size: 0.92rem;
    }

    .login-hero-features {
        display: none;
    }

    .login-panel {
        padding: 1.75rem 1.35rem 1.5rem;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    font-size: 0.95rem;
}

.form-group input:focus {
    outline: 2px solid rgba(230, 126, 34, 0.25);
    border-color: var(--portal-orange);
}

.login-input-wrap input {
    padding: 0.7rem 0.9rem 0.7rem 2.85rem;
}

.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-portal:hover {
    background: var(--portal-orange-dark);
}

.validation-summary {
    color: #c0392b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Person page: profile + directory contact card */
.person-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    max-width: 1280px;
}

.person-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background:
        radial-gradient(ellipse 80% 120% at 0% 0%, color-mix(in srgb, var(--contact-accent, #e67e22) 22%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, color-mix(in srgb, var(--contact-accent, #e67e22) 12%, #fff) 0%, #fff 68%);
    overflow: hidden;
}

.person-hero-main {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.person-avatar {
    width: 104px;
    height: 104px;
    font-size: 2.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 3px solid #fff;
    flex-shrink: 0;
}

.person-identity {
    min-width: 0;
}

.person-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.person-name {
    margin: 0 0 0.3rem;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.person-position {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--portal-text, #2c3e50);
}

.person-department,
.person-login {
    margin: 0.15rem 0 0;
    color: var(--portal-muted);
    font-size: 0.92rem;
}

.person-login {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.85rem;
}

.person-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.85rem;
    flex-shrink: 0;
}

.person-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.person-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--portal-border);
    background: #fff;
    color: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.person-action:hover {
    border-color: color-mix(in srgb, var(--portal-orange) 45%, var(--portal-border));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    color: inherit;
}

.person-action-primary {
    background: var(--portal-orange);
    border-color: var(--portal-orange);
    color: #fff;
}

.person-action-primary:hover {
    background: var(--portal-orange-dark);
    border-color: var(--portal-orange-dark);
    color: #fff;
}

.person-action-favorite.is-favorite {
    border-color: color-mix(in srgb, var(--portal-orange) 55%, var(--portal-border));
    color: var(--portal-orange);
    background: color-mix(in srgb, var(--portal-orange) 10%, #fff);
}

.person-action-favorite.is-favorite i {
    color: var(--portal-orange);
}

.person-action-favorite:disabled {
    opacity: 0.65;
    cursor: wait;
}

.person-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

.person-body-with-side {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.person-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.person-panel {
    padding: 1.35rem 1.5rem 1.5rem;
}

.person-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.person-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--portal-orange-light);
    color: var(--portal-orange-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.person-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

/* Without hierarchy side panel, fill width with denser field grid */
.person-body:not(.person-body-with-side) .person-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.person-body:not(.person-body-with-side) .profile-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.person-fields-readonly {
    margin-top: 0.25rem;
}

.person-field {
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fafbfc;
    min-height: 4.5rem;
}

.person-field-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--portal-muted);
    margin-bottom: 0.4rem;
}

.person-field-label i {
    width: 0.95rem;
    text-align: center;
    opacity: 0.85;
}

.person-field-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
}

a.person-field-value:hover {
    color: var(--portal-orange);
}

.person-field-empty {
    color: var(--portal-muted);
    font-weight: 500;
}

.person-manager {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fafbfc;
}

.person-manager .contact-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.person-manager-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.person-manager-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: inherit;
    text-decoration: none;
}

a.person-manager-name:hover {
    color: var(--portal-orange);
}

.person-manager-meta {
    font-size: 0.82rem;
    color: var(--portal-muted);
}

.person-reports {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.person-report-item {
    margin: 0;
    padding: 0.6rem 0.55rem;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.person-report-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.profile-form .form-group {
    margin-bottom: 1rem;
}

.profile-photo-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fafbfc;
}

.profile-photo-section .profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #fff;
}

.profile-photo-upload {
    flex: 1;
    min-width: 0;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.alert-warning {
    background: #fef9e7;
    color: #9a7d0a;
    border: 1px solid #f9e79f;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

@media (max-width: 1400px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .dashboard-columns { grid-template-columns: 1fr; }
    .news-featured {
        grid-template-columns: 1fr;
    }

    .news-featured-media,
    .news-featured-media img {
        min-height: 200px;
    }
}

@media (max-width: 900px) {
    .knowledge-layout {
        grid-template-columns: 1fr;
    }

    .knowledge-nav {
        display: none;
    }

    .knowledge-nav-mobile {
        display: flex;
    }
}

@media (max-width: 768px) {
    .knowledge-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-search-bar input {
        min-width: 0;
    }

    .person-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 1.35rem 1.25rem;
    }

    .person-hero-main {
        flex-direction: column;
        text-align: center;
    }

    .person-name {
        font-size: 1.4rem;
    }

    .person-badges {
        justify-content: center;
    }

    .person-hero-aside {
        align-items: stretch;
    }

    .person-actions {
        justify-content: center;
    }

    .person-body-with-side {
        grid-template-columns: 1fr;
    }

    .person-fields,
    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .person-panel {
        padding: 1.15rem 1.2rem 1.3rem;
    }
}

@media (max-width: 1024px) {
    .person-body-with-side {
        grid-template-columns: 1fr;
    }

    .person-body:not(.person-body-with-side) .person-fields,
    .person-body:not(.person-body-with-side) .profile-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .portal-content-wrap {
        grid-template-columns: 1fr;
    }

    .portal-right-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1rem;
    }
}

.admin-log-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.admin-log-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 120px;
}

.admin-log-stat-label {
    font-size: 0.8rem;
    color: var(--portal-text-muted, #7f8c8d);
}

.admin-logs-card {
    padding: 1rem 1.25rem;
}

.admin-logs-filters .admin-logs-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.admin-logs-search-group {
    flex: 1 1 220px;
}

.admin-logs-filter-actions {
    display: flex;
    align-items: flex-end;
}

.admin-logs-summary {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.admin-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-logs-table th,
.admin-logs-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: top;
}

.admin-logs-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-text-muted, #7f8c8d);
}

.admin-log-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-log-prefix,
.admin-log-trace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.admin-log-message {
    max-width: 420px;
    word-break: break-word;
}

.admin-log-properties {
    margin-top: 0.5rem;
}

.admin-log-properties pre {
    margin: 0.5rem 0 0;
    padding: 0.65rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-log-tampered {
    background: #fff5f5;
}

.admin-log-tamper-note {
    margin-top: 0.35rem;
    color: #c0392b;
    font-size: 0.8rem;
}

.admin-logs-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--portal-text-muted, #7f8c8d);
}

.admin-logs-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.admin-logs-pagination {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-log-level-error { background: #fdecea; color: #c0392b; }
.admin-log-level-warning { background: #fef9e7; color: #d68910; }
.admin-log-level-info { background: #ebf5fb; color: #2980b9; }
.admin-log-level-debug { background: #f4f6f7; color: #566573; }

.btn-portal-secondary {
    background: #ecf0f1;
    color: var(--portal-text, #2c3e50);
}

.chat-tg-shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: calc(100dvh - 7.5rem);
    max-height: calc(100dvh - 7.5rem);
    min-height: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.chat-tg-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e6ebee;
    background: #fff;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.chat-tg-sidebar-top {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e6ebee;
}

.chat-tg-search {
    flex: 1;
    border: none;
    background: #f0f2f5;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
}

.chat-tg-search:focus {
    outline: none;
    background: #e9edef;
}

.chat-tg-new-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #707579;
}

.chat-tg-new-btn:hover {
    background: #f0f2f5;
}

.chat-tg-conversation-list {
    flex: 1;
    overflow-y: auto;
}

.chat-tg-conv-item {
    width: 100%;
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: none;
    background: transparent;
    text-align: left;
}

.chat-tg-conv-item:hover,
.chat-tg-conv-item.is-active {
    background: #f4f4f5;
}

.chat-tg-avatar,
.chat-tg-thread-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-tg-conv-body {
    min-width: 0;
}

.chat-tg-conv-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.chat-tg-conv-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-tg-conv-time {
    font-size: 0.72rem;
    color: #8b9499;
    flex-shrink: 0;
}

.chat-tg-conv-preview {
    font-size: 0.82rem;
    color: #707579;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.chat-tg-conv-item-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.chat-tg-conv-item-wrap.is-pinned .chat-tg-conv-item {
    background: #fffaf3;
}

.chat-tg-conv-item-wrap .chat-tg-conv-item {
    flex: 1;
    min-width: 0;
}

.chat-tg-conv-pin-btn {
    display: none;
    align-self: center;
    margin-right: 0.35rem;
    border: none;
    background: transparent;
    color: #8b9499;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-tg-conv-item-wrap:hover .chat-tg-conv-pin-btn,
.chat-tg-conv-item-wrap.is-pinned .chat-tg-conv-pin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-tg-conv-item-wrap.is-pinned .chat-tg-conv-pin-btn,
.chat-tg-thread-menu-btn.is-active {
    color: var(--portal-orange, #e67e22);
}

.chat-tg-conv-pin-btn:hover,
.chat-tg-thread-menu-btn:hover {
    background: #eceff1;
}

.chat-tg-conv-pin-icon {
    font-size: 0.62rem;
    margin-right: 0.25rem;
    color: var(--portal-orange, #e67e22);
}

.chat-tg-conv-presence {
    font-size: 0.76rem;
    color: #707579;
    margin-top: 0.05rem;
}

.chat-tg-conv-presence.is-online {
    color: #2aabee;
}

.chat-tg-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
}

.chat-tg-avatar-wrap .chat-tg-avatar,
.chat-tg-avatar-wrap .chat-group-member-avatar {
    width: 100%;
    height: 100%;
}

.chat-tg-online-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2aabee;
    border: 2px solid #fff;
}

.chat-tg-thread-subtitle.is-online {
    color: #2aabee;
}

.chat-group-member-presence {
    font-size: 0.76rem;
    color: #707579;
}

.chat-group-member-presence.is-online {
    color: #2aabee;
}

.chat-tg-conv-badge {
    background: var(--portal-orange, #e67e22);
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: 0.35rem;
}

.chat-tg-thread {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: #e6ebee;
}

.chat-tg-thread-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b9499;
    gap: 0.5rem;
    font-size: 2.5rem;
}

.chat-tg-thread-active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.chat-tg-thread-header,
.chat-tg-pending-file,
.chat-tg-reply-bar,
.chat-tg-composer {
    flex-shrink: 0;
}

.chat-tg-thread-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e6ebee;
}

.chat-tg-thread-meta {
    flex: 1;
    min-width: 0;
}

.chat-tg-thread-meta.is-clickable {
    cursor: pointer;
    border-radius: 10px;
    padding: 0.15rem 0.35rem;
    margin: -0.15rem -0.35rem;
    transition: background 0.15s ease;
}

.chat-tg-thread-meta.is-clickable:hover {
    background: #f3f4f6;
}

.chat-tg-thread-menu-btn {
    border: none;
    background: transparent;
    color: #707579;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-tg-thread-menu-btn:hover {
    background: #f3f4f6;
    color: #2aabee;
}

.chat-tg-thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.chat-tg-thread-title {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 600;
}

.chat-tg-thread-subtitle {
    font-size: 0.78rem;
    color: #707579;
}

.chat-tg-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    -webkit-overflow-scrolling: touch;
}

.chat-tg-date-divider {
    align-self: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #707579;
    font-size: 0.75rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin: 0.35rem 0 0.15rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.chat-tg-msg-wrap {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    max-width: 72%;
}

.chat-tg-msg-wrap.is-mine {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-tg-msg-wrap.is-other {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-tg-msg-author {
    font-size: 0.72rem;
    color: #2aabee;
    font-weight: 600;
    margin: 0.15rem 0.35rem;
}

.chat-tg-bubble {
    position: relative;
    padding: 0.45rem 0.65rem 0.35rem;
    border-radius: 12px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.08);
    word-break: break-word;
}

.chat-tg-bubble--in {
    background: #fff;
    border-top-left-radius: 4px;
}

.chat-tg-bubble--out {
    background: #eeffde;
    border-top-right-radius: 4px;
}

.chat-tg-bubble-text {
    white-space: pre-wrap;
    font-size: 0.92rem;
    line-height: 1.35;
}

.chat-tg-bubble-time {
    float: right;
    margin-left: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: #8b9499;
}

.chat-tg-image {
    display: block;
    max-width: 280px;
    max-height: 320px;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.chat-tg-file-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 220px;
    text-decoration: none;
    color: inherit;
}

.chat-tg-file-card i {
    font-size: 1.6rem;
    color: #2aabee;
}

.chat-tg-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    word-break: break-all;
}

.chat-tg-file-size {
    font-size: 0.72rem;
    color: #8b9499;
}

.chat-tg-bubble-row {
    max-width: 100%;
}

.chat-tg-bubble-group {
    position: relative;
    max-width: 100%;
    min-width: 0;
}

.chat-tg-msg-toolbar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 2;
    white-space: nowrap;
}

.chat-tg-msg-wrap.is-other .chat-tg-msg-toolbar {
    left: calc(100% + 6px);
}

.chat-tg-msg-wrap.is-mine .chat-tg-msg-toolbar {
    right: calc(100% + 6px);
}

.chat-tg-bubble-group:hover .chat-tg-msg-toolbar,
.chat-tg-msg-toolbar:focus-within {
    opacity: 1;
    pointer-events: auto;
}

.chat-tg-msg-action {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #8b9499;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.chat-tg-msg-action:hover {
    color: #2aabee;
}

.chat-tg-reaction-quick {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 3px 5px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.chat-tg-reaction-pick {
    border: none;
    background: none;
    font-size: 1rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-tg-reaction-pick:hover {
    background: #f0f2f5;
    transform: scale(1.1);
}

.chat-tg-reactions-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: -6px;
    padding: 0 6px;
    position: relative;
    z-index: 1;
}

.chat-tg-msg-wrap.is-mine .chat-tg-reactions-bar {
    justify-content: flex-end;
}

.chat-tg-msg-wrap.is-other .chat-tg-reactions-bar {
    justify-content: flex-start;
}

.chat-tg-reactions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
}

.chat-tg-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 22px;
    padding: 0 6px 0 4px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.07);
}

.chat-tg-reaction-pill.is-active {
    background: #e8f4fc;
    border-color: #7cc4f0;
}

.chat-tg-reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.chat-tg-reaction-count {
    font-size: 11px;
    font-weight: 600;
    color: #6d7a83;
}

.chat-tg-reply-quote {
    border-left: 3px solid #2aabee;
    padding: 0.15rem 0.45rem;
    margin-bottom: 0.25rem;
    border-radius: 0 6px 6px 0;
    background: rgba(42, 171, 238, 0.08);
}

.chat-tg-bubble--out .chat-tg-reply-quote {
    border-left-color: #5fb947;
    background: rgba(95, 185, 71, 0.12);
}

.chat-tg-reply-quote-author {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2aabee;
    line-height: 1.2;
}

.chat-tg-bubble--out .chat-tg-reply-quote-author {
    color: #4a9e34;
}

.chat-tg-reply-quote-text {
    font-size: 0.78rem;
    color: #5d6b74;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.chat-tg-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0.75rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border-left: 3px solid #2aabee;
    border-radius: 8px;
    font-size: 0.85rem;
}

.chat-tg-reply-bar-title {
    font-weight: 700;
    color: #2aabee;
    font-size: 0.78rem;
}

.chat-tg-reply-bar-text {
    color: #5d6b74;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (hover: none) {
    .chat-tg-msg-toolbar {
        opacity: 1;
        pointer-events: auto;
    }
}

.chat-tg-pending-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0.75rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border-radius: 10px;
    font-size: 0.85rem;
}

.chat-tg-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
    background: #f0f2f5;
}

.chat-tg-composer-field {
    flex: 1;
    position: relative;
}

.chat-tg-composer textarea {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    resize: none;
    max-height: 120px;
    font-size: 0.92rem;
    background: #fff;
}

.chat-tg-composer textarea:focus {
    outline: none;
}

.chat-tg-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #707579;
    flex-shrink: 0;
}

.chat-tg-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-tg-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #2aabee;
    color: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-tg-send-btn:hover {
    background: #229ed9;
}

.chat-tg-send-btn i {
    font-size: 1.05rem;
    line-height: 1;
}

.chat-tg-emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.2rem;
    background: #fff;
    border-radius: 12px;
    padding: 0.45rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.chat-tg-emoji-btn {
    border: none;
    background: transparent;
    font-size: 1.15rem;
    padding: 0.15rem;
}

.chat-user-results {
    max-height: 240px;
    overflow-y: auto;
}

.chat-user-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-direction: column;
}

.chat-user-item:hover {
    background: #f3f4f6;
}

.chat-user-name {
    font-weight: 600;
}

.chat-user-dept {
    font-size: 0.8rem;
    color: #6b7280;
}

.chat-empty-hint {
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
}

.chat-group-info-count {
    color: #707579;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.chat-group-member-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chat-group-member {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.35rem;
    border-radius: 10px;
}

.chat-group-member:hover {
    background: #f8f9fa;
}

.chat-group-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.chat-group-member-body {
    min-width: 0;
}

.chat-group-member-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.chat-group-member-you {
    font-weight: 500;
    color: #707579;
    font-size: 0.82rem;
}

.chat-group-member-dept {
    font-size: 0.8rem;
    color: #6b7280;
}

.chat-selected-users .btn-close-sm {
    transform: scale(0.7);
}

.about-hero {
    position: relative;
    overflow: hidden;
    padding: 0;
    margin-bottom: 1.5rem;
    min-height: 280px;
}

.about-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.about-hero-overlay {
    position: relative;
    z-index: 1;
    padding: 2.5rem 2rem;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 52rem;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.88) 45%,
        rgba(255, 255, 255, 0.45) 75%,
        rgba(255, 255, 255, 0.15) 100%
    );
}

.about-hero-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--portal-orange);
}

.about-hero-overlay h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    max-width: 36rem;
}

.about-hero-lead {
    margin: 0;
    font-size: 1.05rem;
    color: var(--portal-muted);
    max-width: 32rem;
}

.about-intro {
    margin-bottom: 1.5rem;
}

.about-intro-card {
    border-left: 4px solid var(--portal-orange);
    background: linear-gradient(135deg, #fff 0%, var(--portal-orange-light) 100%);
}

.about-intro-card p {
    margin: 0 0 0.85rem;
    font-size: 1.02rem;
    line-height: 1.65;
}

.about-intro-cta {
    font-weight: 600;
    color: var(--portal-orange-dark);
}

.about-video {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.about-video-header {
    padding: 1.25rem 1.25rem 0.75rem;
}

.about-video-caption {
    margin: 0.35rem 0 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.about-video-player {
    padding: 0 1.25rem 1.25rem;
}

.about-video-player video {
    width: 100%;
    display: block;
    border-radius: 12px;
    background: #111;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.about-content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.about-story p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: var(--portal-text);
}

.about-map {
    padding-bottom: 1rem;
}

.about-map-image {
    width: 100%;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--portal-border);
    margin-bottom: 0.85rem;
}

.about-map-caption {
    font-size: 0.9rem;
    color: var(--portal-muted);
    line-height: 1.55;
}

.about-advantages-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.about-advantages-list li {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 12px;
    background: #fafbfc;
    border: 1px solid var(--portal-border);
    line-height: 1.55;
    font-size: 0.95rem;
}

.about-advantage-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-orange-light);
    color: var(--portal-orange);
    font-size: 1rem;
}

@media (max-width: 1100px) {
    .about-content-grid {
        grid-template-columns: 1fr;
    }

    .about-advantages-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .about-hero-overlay {
        padding: 1.75rem 1.25rem;
        min-height: 240px;
        background: linear-gradient(
            to top,
            rgba(255, 255, 255, 0.97) 0%,
            rgba(255, 255, 255, 0.9) 55%,
            rgba(255, 255, 255, 0.55) 100%
        );
    }

    .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        display: none;
    }

    .chat-tg-shell {
        grid-template-columns: 1fr;
        height: calc(100dvh - 7.5rem);
        max-height: calc(100dvh - 7.5rem);
    }

    .chat-tg-sidebar {
        border-right: none;
        border-bottom: 1px solid #e6ebee;
        max-height: 300px;
    }
}
/* ===== Documents file manager (filebrowser-inspired) ===== */
.fm {
    --fm-radius: 0;
    --fm-accent: var(--portal-orange);
    --fm-surface: #fff;
    --fm-muted: var(--portal-muted);
    --fm-border: var(--portal-border);
    --fm-hover: #f8f9fb;
    --fm-selected: #fff4e8;
    display: flex;
    flex-direction: column;
    min-height: min(72vh, 820px);
    background: var(--fm-surface);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* flush under page bar, no floating card chrome */
.portal-main > .fm {
    min-height: calc(100dvh - 7.5rem);
}

.fm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--fm-border);
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.fm-toolbar-left,
.fm-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
    height: auto;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--fm-border, #e8eaed);
    border-radius: 10px;
    background: #fff;
    color: var(--portal-text, #2c3e50);
    font-size: 0.88rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    box-sizing: border-box;
}

.fm-btn:hover:not(:disabled) {
    background: var(--fm-hover, #f8f9fb);
    border-color: #d5d9e0;
}

.fm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fm-btn.is-active {
    background: var(--portal-orange-light, #fdf2e6);
    border-color: #f0c48a;
    color: var(--portal-orange-dark, #d35400);
}

/* Explicit colors: dialogs live outside .fm, so --fm-* vars may be missing. */
.fm-btn-primary {
    background: var(--portal-orange, #e67e22) !important;
    border-color: var(--portal-orange, #e67e22) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(230, 126, 34, 0.25);
}

.fm-btn-primary:hover:not(:disabled) {
    background: var(--portal-orange-dark, #d35400) !important;
    border-color: var(--portal-orange-dark, #d35400) !important;
    color: #fff !important;
}

.fm-btn-danger {
    color: #c0392b;
}

.fm-btn-danger:hover:not(:disabled) {
    background: #fdecea;
    border-color: #f5c6c2;
    color: #c0392b;
}

.fm-btn-label {
    display: none;
}

@media (min-width: 900px) {
    .fm-btn-label { display: inline; }
}

.fm-upload-label { margin: 0; cursor: pointer; }

.fm-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    max-width: min(52vw, 520px);
    font-size: 0.92rem;
}

.fm-bc-link {
    border: none;
    background: none;
    color: var(--fm-accent);
    font-weight: 600;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    cursor: pointer;
}

.fm-bc-link:hover { background: var(--portal-orange-light); }

.fm-bc-sep { color: #c5cad3; user-select: none; }

.fm-bc-current {
    font-weight: 700;
    padding: 0.15rem 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.fm-search {
    position: relative;
    display: flex;
    align-items: center;
}

.fm-search i {
    position: absolute;
    left: 0.7rem;
    color: var(--fm-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.fm-search input {
    width: min(220px, 40vw);
    height: 2.15rem;
    border: 1px solid var(--fm-border);
    border-radius: 10px;
    padding: 0 0.75rem 0 2rem;
    background: #fff;
    font-size: 0.9rem;
}

.fm-search input:focus {
    outline: 2px solid rgba(230, 126, 34, 0.22);
    border-color: var(--fm-accent);
}

.fm-view-toggle { display: inline-flex; gap: 0.2rem; }

.fm-body {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 34%);
    flex: 1;
    min-height: 0;
}

@media (max-width: 960px) {
    .fm-body { grid-template-columns: 1fr; }
    .fm-preview { border-left: none; border-top: 1px solid var(--fm-border); max-height: 42vh; }
}

.fm-main {
    position: relative;
    min-height: 320px;
    overflow: auto;
    background: #fcfcfd;
}

.fm-drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(230, 126, 34, 0.1);
    border: 2px dashed var(--fm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-drop-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--portal-orange-dark);
    font-weight: 700;
    font-size: 1.05rem;
}

.fm-drop-overlay-inner i { font-size: 2rem; }

.fm-status,
.fm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 280px;
    color: var(--fm-muted);
}

.fm-empty i { font-size: 2.4rem; opacity: 0.55; }

.fm-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #eceff3;
    border-top-color: var(--fm-accent);
    border-radius: 50%;
    animation: fm-spin 0.7s linear infinite;
}

@keyframes fm-spin { to { transform: rotate(360deg); } }

.fm-list.is-list {
    display: flex;
    flex-direction: column;
}

.fm-list.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.65rem;
    padding: 0.85rem;
}

.fm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px 150px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #f0f2f5;
}

.fm-row-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f8fa;
    color: var(--fm-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fm-list.is-list .fm-item {
    cursor: pointer;
    transition: background 0.12s;
}

.fm-list.is-list .fm-item:hover { background: var(--fm-hover); }
.fm-list.is-list .fm-item.is-selected { background: var(--fm-selected); }

.fm-list.is-grid .fm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding: 0.85rem 0.55rem;
    border: 1px solid var(--fm-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
}

.fm-list.is-grid .fm-item:hover {
    border-color: #f0c48a;
    box-shadow: 0 4px 14px rgba(230, 126, 34, 0.12);
    transform: translateY(-1px);
}

.fm-list.is-grid .fm-item.is-selected {
    border-color: var(--fm-accent);
    background: var(--fm-selected);
}

.fm-col-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.fm-list.is-grid .fm-col-name {
    flex-direction: column;
    gap: 0.45rem;
}

.fm-item-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f5;
    color: #5d6b7a;
    flex-shrink: 0;
    overflow: hidden;
}

.fm-item-icon.is-folder {
    background: #fff3e0;
    color: #e67e22;
}

.fm-list.is-grid .fm-item-icon {
    width: 4.25rem;
    height: 4.25rem;
    font-size: 1.55rem;
    border-radius: 14px;
}

.fm-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex: 1;
    min-width: 0;
}

.fm-list.is-list .fm-col-name .fm-item-star {
    margin-left: auto;
}

.fm-list.is-grid .fm-item-name {
    font-size: 0.86rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fm-col-size,
.fm-col-date {
    color: var(--fm-muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.fm-item-meta {
    color: var(--fm-muted);
    font-size: 0.78rem;
}

.fm-preview {
    border-left: 1px solid var(--fm-border);
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.fm-preview-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem;
    color: var(--fm-muted);
    text-align: center;
}

.fm-preview-empty i { font-size: 1.8rem; opacity: 0.5; margin-bottom: 0.25rem; }

.fm-preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.fm-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem 0.35rem;
}

.fm-preview-title {
    font-weight: 700;
    word-break: break-word;
    line-height: 1.3;
}

.fm-preview-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

.fm-preview-meta {
    padding: 0 0.9rem 0.65rem;
    color: var(--fm-muted);
    font-size: 0.82rem;
    border-bottom: 1px solid var(--fm-border);
}

.fm-preview-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f9;
}

.fm-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.fm-preview-frame {
    width: 100%;
    height: min(58vh, 640px);
    border: none;
    border-radius: 8px;
    background: #fff;
}

.fm-preview-media {
    width: 100%;
    max-height: 50vh;
}

.fm-preview-pdf-wrap,
.fm-preview-media-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    min-height: 0;
}

.fm-preview-pdf-wrap .fm-preview-frame {
    flex: 1;
    width: 100%;
    min-height: 360px;
}

.fm-preview-open-tab {
    width: auto;
    flex-shrink: 0;
}

.fm-preview-media-wrap .fm-preview-fallback {
    width: 100%;
}

.fm-preview-office-wrap {
    width: 100%;
    height: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.fm-preview-office-frame {
    flex: 1;
    width: 100%;
    min-height: 360px;
    background: #fff;
}

.fm-preview-text {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0.85rem;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.fm-preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--fm-muted);
    text-align: center;
    padding: 1rem;
}

.fm-preview-fallback i { font-size: 2.4rem; opacity: 0.55; }

.fm-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--fm-border);
    background: #fafbfc;
    font-size: 0.85rem;
    color: var(--fm-muted);
}

.fm-context-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 20;
    margin: 0.75rem auto 0;
    max-width: 720px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.9rem;
    background: #2c3e50;
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

.fm-context-bar .fm-btn {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}

.fm-context-bar .fm-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.16);
}

.fm-context-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.fm-context-bar #fm-context-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.fm-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    width: min(420px, calc(100vw - 2rem));
    background: #fff;
    color: var(--portal-text, #2c3e50);
    /* Same tokens as .fm so buttons look correct outside the manager shell */
    --fm-accent: var(--portal-orange, #e67e22);
    --fm-border: var(--portal-border, #e8eaed);
    --fm-hover: #f8f9fb;
}

.fm-dialog::backdrop { background: rgba(15, 23, 42, 0.4); }

.fm-dialog form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.35rem 1.15rem;
}

.fm-dialog h3 { margin: 0; font-size: 1.1rem; }

.fm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fm-dialog-actions .fm-btn-primary {
    min-width: 8.5rem;
}

.fm-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

/* Inside <dialog> top-layer — page toast is invisible over modal */
.fm-toast-host-inline {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    pointer-events: none;
}

.fm-toast {
    min-width: 220px;
    max-width: 360px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #2c3e50;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
    font-size: 0.92rem;
}

.fm-toast-host-inline .fm-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
}

.fm-toast.is-show { opacity: 1; transform: none; }
.fm-toast-success { background: #1e8449; }
.fm-toast-error { background: #c0392b; }

.fm-btn.is-copied,
.fm-btn.is-copied i {
    color: #1e8449 !important;
}



/* Cloud quota + shares */
.fm-quota {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 1rem 0.4rem;
    border-bottom: 1px solid var(--fm-border, #e8eaed);
    background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}
.fm-quota-text {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    color: var(--portal-muted, #7f8c8d);
}
.fm-quota-text i { color: var(--portal-orange, #e67e22); }
.fm-quota-bar {
    height: 8px;
    border-radius: 999px;
    background: #eef1f5;
    overflow: hidden;
}
.fm-quota-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.35s ease;
}
.fm-quota-fill.is-warn { background: linear-gradient(90deg, #f39c12, #e67e22); }
.fm-quota-fill.is-crit { background: linear-gradient(90deg, #e74c3c, #c0392b); }

.fm-share-dialog {
    width: min(560px, calc(100vw - 1.5rem));
    max-height: min(85vh, 720px);
    padding: 0;
    border: none;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
    background: #fff;
    color: var(--portal-text, #2c3e50);
    --fm-accent: var(--portal-orange, #e67e22);
    --fm-border: var(--portal-border, #e8eaed);
    --fm-hover: #f8f9fb;
}
.fm-share-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.fm-share-dialog-inner {
    padding: 1.1rem 1.2rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: min(85vh, 720px);
    overflow: auto;
    background: #fff;
}
.fm-share-dialog #fm-share-save,
.fm-dialog #fm-dialog-ok {
    background: #e67e22 !important;
    border-color: #e67e22 !important;
    color: #ffffff !important;
}
.fm-share-dialog #fm-share-save:hover,
.fm-dialog #fm-dialog-ok:hover {
    background: #d35400 !important;
    border-color: #d35400 !important;
    color: #ffffff !important;
}
.fm-share-dialog #fm-share-reset,
.fm-dialog #fm-dialog-cancel {
    background: #fff !important;
    border: 1px solid #d5d9e0 !important;
    color: #2c3e50 !important;
}
.fm-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.fm-share-header h3 { margin: 0; font-size: 1.1rem; }
.fm-share-subtitle { margin: 0; font-size: 0.95rem; font-weight: 700; }
.fm-share-hr { border: none; border-top: 1px solid #e8eaed; margin: 0.35rem 0; }
.fm-share-list { display: flex; flex-direction: column; gap: 0.55rem; }
.fm-share-item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    background: #fafbfc;
}
.fm-share-item-main { min-width: 0; flex: 1; }
.fm-share-url {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--portal-orange-dark, #d35400);
    word-break: break-all;
}
.fm-share-item-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.fm-share-form { display: flex; flex-direction: column; gap: 0.65rem; }
.fm-share-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.88rem; }
.fm-share-field span { color: var(--portal-muted, #7f8c8d); font-weight: 600; }
.fm-share-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
}
