*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ——— App shell ——— */
.coach-app {
    min-height: 100vh;
    min-height: 100dvh;
    background: #f0f4f8;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.coach-header {
    background: linear-gradient(135deg, #1a6b3c 0%, #2d9e5f 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-section .bi-trophy-fill {
    font-size: 1.5rem;
    color: #ffd700;
    flex-shrink: 0;
}

.logo-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.7rem;
    opacity: 0.85;
    letter-spacing: 0.3px;
}

.user-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.875rem;
    width: 100%;
    justify-content: flex-end;
}

.coach-name {
    font-weight: 600;
    min-width: 0;
}

.coach-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

@media (min-width: 576px) {
    .header-inner {
        padding: 14px 24px;
        flex-wrap: nowrap;
    }

    .logo-section .bi-trophy-fill {
        font-size: 1.6rem;
    }

    .logo-name {
        font-size: 1.2rem;
    }

    .logo-tagline {
        font-size: 0.75rem;
    }

    .user-section {
        width: auto;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .coach-main {
        padding: 24px;
    }

    .coach-name {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .coach-name {
        max-width: min(200px, 45vw);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-section .badge {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

/* ——— Login ——— */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
    padding: 16px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    padding: 28px 22px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a6b3c;
    margin-bottom: 6px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.88rem;
    margin-bottom: 22px;
    line-height: 1.45;
}

.btn-google {
    background: white;
    color: #3c4043;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    padding: 12px 16px;
    min-height: 44px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, background 0.2s;
}

.btn-google:hover {
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.18);
    background: #f8f9fa;
}

.login-note {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-bottom: 0;
}

@media (min-width: 576px) {
    .login-container {
        padding: 24px;
    }

    .login-card {
        padding: 40px 36px;
    }

    .login-logo {
        font-size: 3rem;
        margin-bottom: 12px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.92rem;
        margin-bottom: 28px;
    }
}

/* ——— Calendar page ——— */
.schedule-page-heading {
    font-size: clamp(1.15rem, 4.2vw, 1.65rem);
    font-weight: 600;
    line-height: 1.25;
}

/* ——— Mobile agenda (calendar list by day) ——— */
.coach-agenda-mobile {
    overflow: hidden;
}

.coach-agenda-mobile .card-header h6 {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.agenda-day {
    border-bottom: 1px solid #e9ecef;
}

.agenda-day:last-child {
    border-bottom: none;
}

.agenda-day-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 10px 14px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    background: #f8f9fa;
    border-left: 4px solid transparent;
}

.agenda-day-today .agenda-day-heading {
    background: #f0faf4;
    border-left-color: #1a6b3c;
}

.agenda-day-name {
    color: #212529;
}

.agenda-day-date {
    font-size: 0.8rem;
    font-weight: 500;
}

.agenda-day-list {
    padding: 0;
}

.agenda-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    padding-left: 12px;
    border-top: 1px solid #f1f3f5;
    margin: 0;
}

.agenda-item:first-child {
    border-top: none;
}

.agenda-item-accent {
    width: 4px;
    min-height: 2.75rem;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
}

.agenda-item-accent-outline {
    width: 4px;
    min-height: 2.75rem;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.agenda-item-body {
    flex: 1 1 auto;
}

.agenda-item-title {
    font-size: 0.9rem;
    line-height: 1.35;
}

.agenda-item-time {
    font-weight: 700;
    color: #212529;
}

.agenda-item-meta {
    margin-top: 4px;
    line-height: 1.4;
    word-break: break-word;
}

/* ——— Calendar ——— */
.month-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 10px;
    outline: 1px solid rgba(0, 0, 0, 0.06);
    outline-offset: -1px;
}

.month-calendar-scroll .month-calendar {
    min-width: 640px;
    margin-bottom: 0;
}

.month-calendar {
    border-radius: 10px;
    overflow: hidden;
}

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #1a6b3c;
}

.month-header-cell {
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.68rem;
    color: white;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

@media (min-width: 576px) {
    .month-header-cell {
        padding: 10px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
}

.month-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

.month-cell {
    background: white;
    min-height: 88px;
    padding: 4px;
    position: relative;
}

@media (min-width: 576px) {
    .month-cell {
        min-height: 100px;
        padding: 6px;
    }
}

.month-cell.today {
    background: #f0faf4;
}

.month-cell.other-month {
    background: #f8f9fa;
}

.cell-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

@media (min-width: 576px) {
    .cell-date {
        font-size: 0.82rem;
        width: 24px;
        height: 24px;
    }
}

.cell-date.today-badge {
    background: #1a6b3c;
    color: white;
}

.booking-chip,
.availability-chip {
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: flex;
    gap: 3px;
    overflow: hidden;
    cursor: default;
}

@media (min-width: 576px) {
    .booking-chip,
    .availability-chip {
        font-size: 0.72rem;
        padding: 2px 5px;
        gap: 4px;
    }
}

.booking-chip {
    color: white;
    border-left: 3px solid rgba(0, 0, 0, 0.2);
}

.availability-chip {
    background: #f8fffb;
    border: 1px dashed currentColor;
}

.booking-time {
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.booking-field {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

.field-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.no-bookings {
    min-height: 4px;
}

.session-list-meta {
    word-break: break-word;
}
