/* Index — цэвэр, гэгээлэг Bootstrap портал (Bizagi-style) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&subset=cyrillic,cyrillic-ext,latin&display=swap');

.portal-light {
    min-height: 100vh;
    background: linear-gradient(145deg, #f0f4fc 0%, #faf8ff 45%, #f5f9ff 100%);
    font-family: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #1a1f36;
}

.portal-index-branded {
    position: relative;
    min-height: 100vh;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.14)),
        var(--portal-index-bg) center center / cover no-repeat fixed;
    overflow: hidden;
}

.portal-index-branded::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(247, 251, 255, 0.16);
    pointer-events: none;
    z-index: 0;
}

.portal-index-branded > * {
    position: relative;
    z-index: 1;
}

.portal-index-branded .portal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portal-index-branded .portal-shell {
    width: 100%;
    max-width: 920px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
    border: 1px solid rgba(255, 255, 255, 0.52) !important;
    backdrop-filter: blur(10px) saturate(1.08);
    -webkit-backdrop-filter: blur(10px) saturate(1.08);
    box-shadow:
        0 32px 90px rgba(8, 39, 67, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
}

.portal-index-branded .portal-greeting {
    color: #082943;
}

.portal-index-branded .portal-subtitle {
    color: rgba(8, 41, 67, 0.62) !important;
}

.portal-index-branded .app-tile-inner {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(248, 252, 253, 0.48));
    border: 1px solid rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(8px) saturate(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
    box-shadow:
        0 18px 45px rgba(8, 39, 67, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.portal-index-branded .app-tile:hover .app-tile-inner {
    border-color: rgba(41, 185, 178, 0.34);
    box-shadow:
        0 22px 54px rgba(8, 39, 67, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.portal-page {
    max-width: 1200px;
    margin: 0 auto;
}

.portal-shell .card-body {
    position: relative;
}

.portal-shell {
    position: relative;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow:
        0 4px 24px rgba(0, 26, 61, 0.06),
        0 1px 3px rgba(0, 26, 61, 0.04) !important;
    overflow: hidden;
}

.portal-brand img {
    height: 44px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.portal-brand:hover {
    opacity: 0.9;
}

.portal-back-link {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 2;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.portal-back-link:hover {
    color: #001a3d;
}

.portal-project-head {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -0.35rem;
    margin-bottom: clamp(1.6rem, 3.4vw, 2.6rem);
    text-align: center;
}

.portal-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: clamp(1rem, 2.2vw, 1.5rem);
    align-items: stretch;
    justify-content: center;
}

.portal-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1f36;
    line-height: 1.3;
}

.portal-user-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.portal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #001a3d 0%, #003366 100%);
    color: #e3c58e;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 26, 61, 0.15);
}

.portal-greeting {
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 700;
    color: #001a3d;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.portal-subtitle {
    font-size: 0.95rem;
    color: #6b7280 !important;
    margin-bottom: 0;
}

/* Апп карт */
.app-tile {
    display: block;
    height: 100%;
    color: inherit;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-tile:hover {
    color: inherit;
    transform: translateY(-4px);
}

.app-tile-inner {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem 1rem 1.35rem;
    text-align: center;
    height: 100%;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border: 1px solid rgba(0, 26, 61, 0.06);
    box-shadow: 0 2px 12px rgba(0, 26, 61, 0.05);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.app-tile:hover .app-tile-inner {
    box-shadow: 0 12px 32px rgba(0, 26, 61, 0.1);
    border-color: rgba(197, 160, 89, 0.25);
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.25s ease;
}

.app-tile:hover .app-icon {
    transform: scale(1.06);
}

.app-icon svg {
    width: 28px;
    height: 28px;
}

.app-icon-hr {
    background: linear-gradient(135deg, #f6a623 0%, #f7d794 100%);
    box-shadow: 0 6px 16px rgba(246, 166, 35, 0.35);
}

.app-icon-camp {
    background: linear-gradient(135deg, #005461 0%, #00b7b5 100%);
    box-shadow: 0 6px 16px rgba(0, 84, 97, 0.35);
}

.app-icon-dispatch {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.app-icon-project-module {
    background: linear-gradient(135deg, #213448 0%, #547792 100%);
    box-shadow: 0 6px 16px rgba(33, 52, 72, 0.35);
}

.app-icon-portal-custom {
    color: #fff;
}

.app-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1f36;
    line-height: 1.35;
    max-width: 140px;
}

.portal-footer-light {
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.portal-index-branded .portal-footer-light {
    color: #082943;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.portal-project-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.app-tile-project .app-icon {
    width: 108px;
    height: 108px;
    border-radius: 22px;
    margin-bottom: 0.85rem;
}

.app-tile-project .app-tile-inner {
    min-height: 210px;
    padding: 2rem 1.25rem 1.5rem;
}

.app-tile-project .app-icon-project {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.05em;
}

.app-icon-project-logo {
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    padding: 0.55rem;
}

.app-project-logo {
    width: 100%;
    height: 100%;
    max-height: 92px;
    object-fit: contain;
    display: block;
}

.portal-project-logo {
    height: 52px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.portal-branded,
.portal-tsant-uul {
    position: relative;
    min-height: 100vh;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.14)),
        var(--project-portal-bg, url('../images/projects/sant_uul-portal-bg.png')) center center / cover no-repeat fixed;
    overflow: hidden;
}

.portal-branded::before,
.portal-tsant-uul::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(247, 251, 255, 0.16);
    pointer-events: none;
    z-index: 0;
}

.portal-branded::after,
.portal-tsant-uul::after {
    content: "";
    position: fixed;
    right: -140px;
    bottom: -180px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(41, 185, 178, 0.1), rgba(14, 66, 112, 0.1));
    border: 1px solid rgba(14, 66, 112, 0.08);
    pointer-events: none;
    z-index: 0;
}

.portal-branded > *,
.portal-tsant-uul > * {
    position: relative;
    z-index: 1;
}

.portal-branded .portal-page ,
.portal-tsant-uul .portal-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-branded .portal-shell ,
.portal-tsant-uul .portal-shell {
    width: 100%;
    max-width: 1040px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34)) !important;
    border: 1px solid rgba(255, 255, 255, 0.52) !important;
    backdrop-filter: blur(10px) saturate(1.08);
    -webkit-backdrop-filter: blur(10px) saturate(1.08);
    box-shadow:
        0 32px 90px rgba(8, 39, 67, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
}

.portal-branded .portal-project-logo ,
.portal-tsant-uul .portal-project-logo {
    height: 96px;
    max-width: 320px;
}

.portal-branded .portal-back-link ,
.portal-tsant-uul .portal-back-link {
    top: 1.5rem;
    left: 1.5rem;
}

.portal-branded .portal-project-head ,
.portal-tsant-uul .portal-project-head {
    margin-top: -0.5rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.85rem);
}

.portal-branded .portal-module-grid ,
.portal-tsant-uul .portal-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.portal-branded .portal-project-badge ,
.portal-tsant-uul .portal-project-badge {
    background: rgba(255, 255, 255, 0.72);
    color: #08304b;
    border: 1px solid rgba(41, 185, 178, 0.18);
    box-shadow: 0 8px 22px rgba(8, 39, 67, 0.08);
}

.portal-branded .portal-back-link ,
.portal-tsant-uul .portal-back-link {
    color: rgba(8, 41, 67, 0.62);
}

.portal-branded .portal-back-link:hover ,
.portal-tsant-uul .portal-back-link:hover {
    color: #082943;
}

@media (min-width: 992px) {
    .portal-shell .card-body {
        padding: 3rem !important;
    }

    .portal-back-link {
        top: 1.5rem;
        left: 1.5rem;
    }
}

.portal-branded .portal-greeting ,
.portal-tsant-uul .portal-greeting {
    color: #082943;
}

.portal-branded .portal-subtitle,
.portal-tsant-uul .portal-subtitle a ,
.portal-tsant-uul .portal-subtitle,
.portal-branded,
.portal-tsant-uul .portal-subtitle a {
    color: rgba(8, 41, 67, 0.62) !important;
}

.portal-branded .app-tile-inner ,
.portal-tsant-uul .app-tile-inner {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(248, 252, 253, 0.48));
    border: 1px solid rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(8px) saturate(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
    box-shadow:
        0 18px 45px rgba(8, 39, 67, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.portal-branded .app-tile:hover .app-tile-inner ,
.portal-tsant-uul .app-tile:hover .app-tile-inner {
    border-color: rgba(41, 185, 178, 0.34);
    box-shadow:
        0 22px 54px rgba(8, 39, 67, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.portal-branded .app-icon-hr ,
.portal-tsant-uul .app-icon-hr {
    background: linear-gradient(135deg, #d9a23f 0%, #f5c96b 100%);
    box-shadow: 0 10px 24px rgba(217, 162, 63, 0.32);
}

.portal-branded .app-icon-camp ,
.portal-tsant-uul .app-icon-camp {
    background: linear-gradient(135deg, #0d7d86 0%, #29b9b2 100%);
    box-shadow: 0 10px 24px rgba(41, 185, 178, 0.3);
}

.portal-branded .app-icon-dispatch ,
.portal-tsant-uul .app-icon-dispatch {
    background: linear-gradient(135deg, #08304b 0%, #246c8d 100%);
    box-shadow: 0 10px 24px rgba(8, 48, 75, 0.26);
}

.portal-branded .app-icon-project-module ,
.portal-tsant-uul .app-icon-project-module {
    background: linear-gradient(135deg, #213448 0%, #547792 100%);
    box-shadow: 0 10px 24px rgba(33, 52, 72, 0.28);
}

.app-tile-project .app-title {
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .portal-shell .card-body {
        padding: 1.25rem !important;
    }

    .portal-brand img {
        height: 36px;
    }

    .portal-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.65rem;
    }

    .app-tile-inner {
        min-height: 140px;
        padding: 1.25rem 0.75rem 1rem;
    }

    .app-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .app-tile-project .app-icon {
        width: 88px;
        height: 88px;
        border-radius: 18px;
    }

    .app-project-logo {
        max-height: 72px;
    }

    .app-icon svg {
        width: 24px;
        height: 24px;
    }

    .app-title {
        font-size: 0.8rem;
    }

    .portal-back-link {
        top: 1rem;
        left: 1rem;
        font-size: 0.78rem;
    }

    .portal-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .portal-branded .portal-project-logo ,
.portal-tsant-uul .portal-project-logo {
        height: 68px;
        max-width: 220px;
    }

    .portal-branded .portal-shell ,
.portal-tsant-uul .portal-shell {
        border-radius: 22px !important;
    }
}

@media (min-width: 992px) {
    .app-tile-inner {
        min-height: 180px;
        padding: 2rem 1rem 1.5rem;
    }
}
