:root {
    --teams-blue-900: #153b75;
    --teams-blue-700: #1f5ea8;
    --teams-blue-500: #2f7ed1;
    --teams-blue-100: #e8f1ff;
    --teams-gray-900: #1f2937;
    --teams-gray-600: #4b5563;
    --teams-white: #ffffff;
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--teams-gray-900);
    background: linear-gradient(135deg, #95d4f5 0%, #addff8 55%, #c9ecfb 100%);
    min-height: 100vh;
}

.teams-header {
    background: linear-gradient(180deg, #009dff 0%, #8ae4ff 100%);
    color: var(--teams-blue-900);
    padding: 2rem 1.2rem;
    height: 220px;
    box-sizing: border-box;
    position: relative;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 24px rgba(21, 59, 117, 0.14);
}

.header-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.header-left-links {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    width: max-content;
    margin-left: calc(150px - (50vw - 50%));
}

.header-left-top,
.header-left-bottom {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-left-bottom {
    width: 100%;
}

.header-left-bottom .home-btn {
    flex: 1 1 0;
}

.nav-links {
    display: flex;
    gap: 0.8rem;
}

.header-main {
    max-width: 1200px;
    margin: 0 auto;
}

.header-title-stack {
    position: absolute;
    top: 50%;
    right: 200px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}

.header-title-stack .nav-links {
    justify-content: center;
    margin-bottom: 0.35rem;
}

.home-btn,
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--teams-blue-900);
    font-weight: 500;
    border: 1px solid rgba(47, 126, 209, 0.32);
    background: rgba(255, 255, 255, 0.72);
    height: 38px;
    min-height: 38px;
    padding: 0 1.2rem;
    font-size: 1rem;
    line-height: 1.1;
    border-radius: 999px;
    box-sizing: border-box;
    transition: 0.2s ease;
}

.home-btn:hover,
.nav-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.92);
}

.header-title-stack .nav-link {
    font-weight: 600;
}

.header-left-links .home-btn {
    font-weight: 500;
}

.teams-header .header-left-links > .a11y-toggle-btn {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--teams-blue-900);
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(47, 126, 209, 0.32);
    background: rgba(255, 255, 255, 0.72);
    height: 38px;
    min-height: 38px;
    padding: 0 1.2rem;
    border-radius: 999px;
    line-height: 1.1;
    transition: 0.2s ease;
}

.teams-header .header-left-links > .a11y-toggle-btn:hover,
.teams-header .header-left-links > .a11y-toggle-btn:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.92);
    outline: none;
}

.teams-header h1 {
    text-align: center;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    margin-bottom: 0.35rem;
}

.teams-header p {
    text-align: center;
    opacity: 0.95;
}

.teams-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem 2rem;
}

.teams-top-layout {
    display: grid;
    grid-template-columns: minmax(260px, 34%) minmax(0, 66%);
    gap: 1.2rem;
    align-items: start;
    margin-bottom: 1.4rem;
}

.teams-live-column {
    display: flex;
    flex-direction: column;
}

.teams-live-column .teams-intro {
    margin-bottom: 1rem;
}

.home-agenda {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #d9e8ff;
    box-shadow: 0 10px 24px rgba(47, 126, 209, 0.14);
    padding: 1rem;
    color: var(--teams-blue-900);
}

.home-agenda h3 {
    margin-bottom: 0.15rem;
}

.home-agenda-today {
    margin: 0 0 0.28rem;
    color: var(--teams-blue-700);
    font-size: 0.84rem;
    font-weight: 700;
}

.home-agenda-month-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    margin: 0 0 0.6rem;
}

.home-agenda-month-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #bfd8ff;
    background: rgba(255, 255, 255, 0.92);
    color: var(--teams-blue-900);
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.home-agenda-month-btn:hover {
    background: var(--teams-blue-700);
    border-color: var(--teams-blue-700);
    color: #ffffff;
}

.home-agenda-month {
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.home-agenda-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 5px;
}

.home-agenda-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teams-blue-900);
}

.home-agenda-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.agenda-day {
    min-height: 27px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--teams-blue-900);
    border: 1px solid #8fd3ff;
    background: rgba(143, 211, 255, 0.16);
    text-decoration: none;
}

.agenda-day.is-empty {
    opacity: 0.25;
}

.agenda-day.has-event {
    background: #1f5ea8;
    border-color: #174a85;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(31, 94, 168, 0.42);
    cursor: pointer;
}

.agenda-day.has-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 94, 168, 0.5);
}

.teams-intro {
    background: var(--teams-white);
    border: 1px solid #d9e8ff;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(47, 126, 209, 0.1);
    padding: 1.2rem 1.25rem;
    margin-bottom: 1.4rem;
}

.teams-intro h2 {
    color: var(--teams-blue-900);
    margin-bottom: 0.45rem;
}

.teams-intro p {
    color: var(--teams-gray-600);
}

.ime-live-section {
    background: var(--teams-white);
    border: 1px solid #d9e8ff;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(47, 126, 209, 0.12);
    padding: 1rem;
    margin-bottom: 1.4rem;
}

.ime-live-carousel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #cfe1ff;
    background: #f3f8ff;
    color: var(--teams-blue-900);
    cursor: pointer;
    transition: 0.2s ease;
}

.carousel-arrow:hover:not(:disabled) {
    background: #e4efff;
    transform: translateY(-1px);
}

.carousel-arrow:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ime-live-card {
    min-height: 260px;
    border: 1px solid #dce9ff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #f8fbff, #f2f8ff);
    display: grid;
    grid-template-columns: minmax(220px, 38%) 1fr;
    box-shadow: 0 8px 20px rgba(47, 126, 209, 0.08);
}

.ime-live-image {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    background: #dae9ff;
}

.ime-live-content {
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.7rem;
}

.ime-live-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--teams-blue-900);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ime-live-title {
    font-size: clamp(1.1rem, 2vw, 1.65rem);
    line-height: 1.25;
    color: var(--teams-blue-900);
}

.ime-live-meta {
    color: var(--teams-gray-600);
    font-size: 0.93rem;
}

.ime-live-counter {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--teams-gray-600);
    font-size: 0.88rem;
}

.ime-live-empty {
    margin-top: 0.75rem;
    text-align: center;
    color: var(--teams-gray-600);
}

.team-sections {
    display: grid;
    gap: 1rem;
}

.team-block {
    background: var(--teams-white);
    border: 1px solid #dce9ff;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(47, 126, 209, 0.08);
    overflow: hidden;
}

.team-block-header {
    background: linear-gradient(90deg, var(--teams-blue-700), var(--teams-blue-500));
    color: var(--teams-white);
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.team-block-header h3 {
    font-size: 1.08rem;
}

.member-count {
    font-size: 0.84rem;
    opacity: 0.95;
}

.team-cards {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}

.team-empty {
    grid-column: 1 / -1;
    border: 1px dashed #c8dbfb;
    border-radius: 12px;
    padding: 0.85rem;
    text-align: center;
    color: var(--teams-gray-600);
    background: #f8fbff;
}

.team-card {
    border: 1px solid #deebff;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff, #f2f8ff);
    padding: 0.85rem;
    text-align: center;
}

.member-photo-link {
    display: inline-block;
}

.member-photo {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--teams-blue-100);
    box-shadow: 0 6px 14px rgba(31, 94, 168, 0.15);
}

.member-name-link {
    display: inline-block;
    margin-top: 0.55rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--teams-blue-900);
}

.member-name-link:hover {
    text-decoration: underline;
}

.member-role {
    margin-top: 0.35rem;
    color: var(--teams-gray-600);
    font-size: 0.92rem;
}

.teams-footer {
    margin-top: 1.2rem;
    text-align: center;
    color: #ffffff;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #009dff, #3ec6ff);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.teams-footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 820px) {
    .teams-header {
        height: auto;
        min-height: 220px;
    }

    .teams-top-layout {
        grid-template-columns: 1fr;
    }

    .header-nav {
        flex-direction: column;
        gap: 0.6rem;
    }

    .header-left-links {
        margin-left: 0;
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    .header-left-top,
    .header-left-bottom {
        justify-content: center;
        flex-wrap: wrap;
    }

    .teams-header .header-left-links > .a11y-toggle-btn {
        width: auto;
    }

    .header-title-stack {
        position: static;
        transform: none;
        gap: 0.3rem;
    }

    .header-title-stack .nav-links {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 0.15rem;
    }

    .ime-live-card {
        grid-template-columns: 1fr;
    }

    .ime-live-image {
        min-height: 180px;
    }

    .ime-live-carousel {
        grid-template-columns: 1fr;
    }

    .carousel-arrow {
        width: 100%;
        border-radius: 10px;
        height: 40px;
    }
}
