/* === PORTAL HEADER === */
:root {
    --portal-header-height: 56px;
}

.portal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--portal-header-height);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

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

.portal-logo img {
    height: 32px;
    max-width: 140px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: opacity 0.2s;
}

.portal-logo:hover img {
    opacity: 1;
}

.portal-nav {
    display: flex;
    gap: 4px;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.portal-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.portal-nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

.portal-nav-item.tenders-nav.active {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

.portal-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* === NOTIFICATION BELL in portal header === */
.portal-bell-wrapper {
    position: relative;
}

.portal-bell-wrapper .notification-bell {
    width: auto;
    padding: 8px;
    background: transparent;
    border-radius: 8px;
}

.portal-bell-wrapper .notification-bell:hover {
    background: rgba(255,255,255,0.08);
}

/* Hide "Напоминания" text - direct child span of .notification-bell */
.portal-bell-wrapper .notification-bell > span {
    display: none !important;
}

.portal-bell-wrapper .notification-bell {
    gap: 0;
}

.portal-bell-wrapper .notification-bell svg {
    color: rgba(255,255,255,0.6);
    width: 20px;
    height: 20px;
}

.portal-bell-wrapper .notification-bell:hover svg {
    color: rgba(255,255,255,0.9);
}

.portal-bell-wrapper .notification-bell.has-unread svg {
    color: #fbbf24;
}

.portal-bell-wrapper .notification-dropdown {
    position: absolute;
    top: 100%;
    bottom: auto;
    right: 0;
    left: auto;
    width: 380px;
    margin-top: 8px;
    margin-bottom: 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.portal-bell-wrapper .notification-badge {
    top: 2px;
    right: 2px;
}

/* === USER MENU in portal header === */
.portal-user-wrapper {
    position: relative;
}

.portal-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.portal-user-btn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.portal-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.portal-user-name {
    font-size: 13px;
    font-weight: 500;
}

.portal-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    min-width: 240px;
    overflow: hidden;
    z-index: 300;
}

.portal-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.portal-user-avatar-lg {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #7c3aed 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.portal-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    text-align: left;
}

.portal-user-dropdown-item:hover {
    background: #f8fafc;
}

.portal-user-dropdown-item.logout {
    border-top: 1px solid #f1f5f9;
    color: #dc2626;
}

.portal-user-dropdown-item.logout:hover {
    background: #fef2f2;
}

/* === APP LAYOUT MODES === */
.app-full-width {
    padding-top: var(--portal-header-height);
}

.app-full-width .main,
.app-full-width .main-full-width {
    margin-left: 0 !important;
    max-width: 100%;
    padding: 28px 40px;
    min-height: calc(100vh - var(--portal-header-height));
}

.app-with-sidebar {
    padding-top: var(--portal-header-height);
}

.app-with-sidebar .sidebar {
    top: var(--portal-header-height);
    height: calc(100vh - var(--portal-header-height));
    padding-top: 0;
}

.app-with-sidebar .sidebar .sidebar-header {
    padding-top: 0;
}

.app-with-sidebar .main,
.app-with-sidebar .main-with-sidebar {
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--portal-header-height));
}

/* Hide logo area in sidebar (moved to portal header) */
.app-with-sidebar .sidebar-logo {
    display: none;
}

/* Hide sidebar user-menu (moved to portal header) */
.app-with-sidebar .sidebar .user-menu {
    display: none;
}

/* Hide sidebar notification-bell-wrapper (moved to portal header) */
.app-with-sidebar .sidebar .notification-bell-wrapper {
    display: none;
}

/* Mobile menu button position adjustment */
.mobile-menu-btn {
    top: calc(var(--portal-header-height) + 12px) !important;
}

/* === MAIN PAGE === */
.main-page {
    max-width: 1600px;
    margin: 0 auto;
}

/* Welcome section */
.mp-welcome {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 40%, #3b82f6 100%);
    color: white;
    padding: 32px 36px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

.mp-welcome-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.mp-welcome-sub {
    font-size: 15px;
    opacity: 0.75;
    margin: 6px 0 0;
}

.mp-welcome-date {
    font-size: 13px;
    opacity: 0.55;
    white-space: nowrap;
    text-transform: capitalize;
}

/* Section panels */
.mp-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.mp-section-panel {
    background: white;
    border-radius: 14px;
    padding: 24px 28px;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.mp-section-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.mp-section-blue::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.mp-section-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.mp-section-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.mp-section-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.mp-section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.mp-section-desc {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0;
}

.mp-section-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mp-section-stats {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 16px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.mp-stat {
    flex: 1;
    text-align: center;
}

.mp-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.mp-stat-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mp-stat-divider {
    width: 1px;
    height: 32px;
    background: #f1f5f9;
    flex-shrink: 0;
}

.mp-section-go {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    display: flex;
    align-items: center;
}

/* === NEWS FEED === */
.mp-news-section {
    margin-top: 8px;
    padding-bottom: 40px;
}

.mp-news-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.mp-news-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.mp-news-count {
    font-size: 13px;
    color: #94a3b8;
}

.mp-news-loading,
.mp-news-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Shared meta styles */
.mp-news-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mp-news-source {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.mp-news-date {
    font-size: 12px;
    color: #94a3b8;
}

/* Featured (first) news - big horizontal card */
.mp-news-featured {
    display: flex;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    margin-bottom: 20px;
    transition: all 0.25s;
    min-height: 220px;
}

.mp-news-featured:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.mp-news-featured-img {
    width: 380px;
    min-height: 220px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    overflow: hidden;
}

.mp-news-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-news-featured-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.mp-news-featured-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: #1e293b;
}

.mp-news-featured:hover .mp-news-featured-title {
    color: #2563eb;
}

.mp-news-featured-summary {
    font-size: 14px;
    color: #64748b;
    margin: 10px 0 0;
    line-height: 1.6;
}

.mp-news-read-more {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
}

/* News grid - cards with images */
.mp-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mp-news-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.mp-news-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.mp-news-card-img {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    overflow: hidden;
    flex-shrink: 0;
}

.mp-news-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.mp-news-card:hover .mp-news-card-img img {
    transform: scale(1.05);
}

.mp-news-card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mp-news-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-news-card:hover .mp-news-card-title {
    color: #2563eb;
}

.mp-news-card-summary {
    font-size: 13px;
    color: #64748b;
    margin: 8px 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .mp-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .mp-sections {
        grid-template-columns: 1fr;
    }
    .mp-news-featured {
        flex-direction: column;
    }
    .mp-news-featured-img {
        width: 100%;
        height: 200px;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .mp-news-grid {
        grid-template-columns: 1fr;
    }
    .portal-header {
        padding: 0 12px;
    }
    .portal-header-left {
        gap: 12px;
    }
    .portal-nav-item {
        padding: 6px 10px;
        font-size: 13px;
    }
    .portal-nav-item span {
        display: none;
    }
    .portal-nav-item .portal-nav-icon {
        width: 20px;
        height: 20px;
    }
    .portal-user-name {
        display: none;
    }
    .app-full-width .main,
    .app-full-width .main-full-width {
        padding: 16px;
    }
    .app-with-sidebar .main-with-sidebar {
        margin-left: 0;
        padding: 16px;
    }
    .mp-welcome {
        flex-direction: column;
        padding: 24px 20px;
    }
    .mp-welcome-title {
        font-size: 22px;
    }
    .mp-section-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    .mp-stat-divider {
        display: none;
    }
    .mp-stat {
        min-width: 70px;
    }
    .mp-news-featured-title {
        font-size: 17px;
    }
    .portal-bell-wrapper .notification-dropdown {
        width: calc(100vw - 24px);
        right: -60px;
    }
}
