﻿:root {
    --font-base: "Figtree", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Newsreader", "Figtree", "Times New Roman", serif;
    --app-background: linear-gradient(180deg, #f6f4ef 0%, #eef2f7 100%);
    --surface-1: #ffffff;
    --surface-2: #f4f6f8;
    --surface-3: #e9edf2;
    --border-1: #d9e0e7;
    --text-1: #1f2a36;
    --text-2: #4b5b6b;
    --text-3: #738092;
    --brand-600: #0b7285;
    --brand-700: #085c6a;
    --accent-500: #e07a5f;
    --focus-ring: #0b7285;
    --focus-background: #0b7285;
    --focus-foreground: #ffffff;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
    --shadow-raised: 0 10px 24px rgba(15, 23, 42, 0.18);
    --sidebar-background: linear-gradient(165deg, #0f2e3a 0%, #123946 60%, #153f4b 100%);
    --sidebar-foreground: #e4eef3;
    --sidebar-muted: rgba(228, 238, 243, 0.6);
    --sidebar-mark: #f6c453;
    --sidebar-mark-foreground: #1f2a36;
    --sidebar-active: rgba(246, 196, 83, 0.22);
    --sidebar-active-foreground: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-base);
    color: var(--text-1);
    background: var(--app-background);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
}

a {
    color: var(--brand-600);
}

a:hover,
a:focus-visible {
    color: var(--brand-700);
}

::selection {
    background: rgba(11, 114, 133, 0.18);
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: clamp(1.8rem, 2vw + 1.2rem, 2.6rem);
    margin: 0;
}

.page-subtitle {
    color: var(--text-2);
    margin: 0;
}

.section-card {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    margin: 0;
    font-size: 1.2rem;
}

.section-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.compact-section {
    padding-bottom: 1.25rem;
}

.club-picker {
    min-width: min(100%, 320px);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.metric-grid div {
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-2);
    padding: 0.8rem 0.9rem;
}

.metric-grid dt {
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-grid dd {
    margin: 0.15rem 0 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.tab-strip {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

.tab-button {
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-2);
    padding: 0.55rem 0.9rem;
    font-weight: 700;
}

.tab-button.active {
    background: var(--brand-600);
    border-color: var(--brand-700);
    color: #fff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.span-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.details-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
}

.details-list div {
    padding: 0.75rem;
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-2);
}

.details-list dt {
    color: var(--text-3);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.details-list dd {
    margin: 0.2rem 0 0;
    color: var(--text-1);
    word-break: break-word;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.toolbar-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip-button {
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 600;
}

.chip-button.active {
    background: var(--brand-600);
    color: #fff;
    border-color: var(--brand-700);
}

.table-card {
    background: var(--surface-2);
    border-radius: 14px;
    padding: 0.75rem;
    border: 1px solid var(--border-1);
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table-modern th,
.table-modern td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-1);
    text-align: left;
    vertical-align: middle;
}

.table-modern th {
    color: var(--text-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-modern tbody tr:hover {
    background: rgba(11, 114, 133, 0.06);
}

.event-card {
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    border-radius: 14px;
    padding: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-card-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-3);
    font-size: 0.9rem;
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-1);
    font-weight: 600;
    color: var(--text-2);
}

.badge-muted {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 600;
}

.eyebrow-label {
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 0.2rem;
    text-transform: uppercase;
}

.training-detail-card,
.training-diary-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.training-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.training-detail-title {
    font-size: 1.45rem;
    margin: 0;
}

.training-detail-meta {
    margin: 0;
}

.training-content-panel {
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-2);
    padding: 1rem;
}

.panel-title {
    color: var(--text-2);
    font-family: var(--font-base);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
}

.training-content-body {
    color: var(--text-1);
    overflow-wrap: anywhere;
}

.training-content-body > :last-child {
    margin-bottom: 0;
}

.training-diary-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 1rem;
    align-items: start;
}

.training-diary-layout.single-column {
    grid-template-columns: 1fr;
}

.diary-editor-panel,
.diary-entry-panel {
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-2);
    padding: 1rem;
}

.diary-textarea {
    min-height: 220px;
    resize: vertical;
}

.diary-actions {
    justify-content: flex-end;
}

.diary-entry-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.diary-entry {
    border: 1px solid var(--border-1);
    border-radius: 8px;
    background: var(--surface-1);
    padding: 0.9rem;
}

.diary-entry-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.diary-entry-header h3 {
    font-family: var(--font-base);
    font-size: 0.98rem;
    font-weight: 800;
    margin: 0;
}

.diary-entry-header span {
    color: var(--text-3);
    font-size: 0.78rem;
    white-space: nowrap;
}

.diary-entry p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.empty-state {
    color: var(--text-3);
    padding: 0.75rem;
    text-align: center;
}

.rich-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rich-editor-image-input {
    display: none;
}

.rich-editor-surface {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: 12px;
    padding: 0.75rem;
    overflow-y: auto;
}

.rich-editor-surface:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 1px;
}

.rich-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--text-3);
}

.btn-primary {
    color: #fff;
    background-color: var(--brand-600);
    border-color: var(--brand-700);
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}

.btn-link {
    color: var(--brand-600);
}

.btn-outline-secondary,
.btn-outline-primary {
    border-radius: 999px;
    font-weight: 600;
}

.btn-outline-secondary {
    color: var(--text-2);
    border-color: var(--border-1);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    color: var(--text-1);
    border-color: var(--brand-600);
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: var(--brand-600);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: #fff;
    background: var(--brand-600);
    border-color: var(--brand-700);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus,
textarea:focus {
    box-shadow: 0 0 0 0.15rem rgba(11, 114, 133, 0.25);
}

.form-control,
.form-select,
textarea {
    border-radius: 12px;
    border-color: var(--border-1);
    background-color: var(--surface-1);
}

.form-control::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

.content {
    padding-top: 1.1rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #0b9d67;
}

.invalid {
    outline: 1px solid #c81e1e;
}

.validation-message {
    color: #c81e1e;
}

.blazor-error-boundary {
    background: #fffbeb;
    color: #7a4b00;
    padding: 1rem 1rem 1rem 3.2rem;
    border-radius: 12px;
    position: relative;
    border: 1px solid #f3d68a;
}

.blazor-error-boundary::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #f6c453;
}

.darker-border-checkbox.form-check-input {
    border-color: #8b97a5;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-3);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.calendar {
    display: grid;
    gap: 0.6rem;
    background: var(--surface-1);
    padding: 1rem;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.calendar-header,
.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.calendar-cell {
    border: 1px solid var(--border-1);
    min-height: 100px;
    padding: 0.6rem;
    border-radius: 14px;
    background: var(--surface-2);
}

.today-cell {
    border-color: rgba(11, 114, 133, 0.6);
    background: linear-gradient(180deg, rgba(11, 114, 133, 0.2) 0%, rgba(255, 255, 255, 0.9) 100%);
    box-shadow: 0 12px 28px rgba(11, 114, 133, 0.2);
}

.today-cell .day-number {
    color: var(--brand-700);
    font-weight: 800;
}

.header {
    font-weight: 700;
    text-align: center;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.other-month {
    background-color: var(--surface-3);
    color: var(--text-3);
}

.day-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-1);
}

.event-month {
    margin-top: 0.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background-color: var(--surface-1);
    color: var(--text-1);
    font-size: 0.75rem;
    line-height: 1.2;
    cursor: pointer;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid var(--border-1);
}

.event-month {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.event-month:hover {
    border-color: var(--brand-600);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.event-more {
    background: var(--surface-3);
    color: var(--text-2);
    box-shadow: none;
}

.event-more-button {
    width: 100%;
    text-align: left;
    border: 1px dashed var(--border-1);
    padding: 0.3rem 0.55rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

.event-more-button:hover {
    border-color: var(--brand-600);
    color: var(--brand-700);
}

.event-week {
    margin-top: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    line-height: 1.2;
    cursor: pointer;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 6px 14px rgba(11, 114, 133, 0.25);
    border: none;
}

.event-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    overflow: hidden;
}

.event-time {
    font-size: 0.7rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-right: 0.4rem;
    background: rgba(255, 255, 255, 0.2);
}

.event-pill-compact {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    margin-right: 0;
    background: var(--surface-3);
    color: var(--text-2);
}

.event-assigned {
    border-left: 4px solid var(--brand-600);
}

.event-trainer {
    border-left: 4px solid var(--accent-500);
}

.event-competition {
    border-left: 4px solid #6f42c1;
}

.event-week.event-assigned {
    background-color: var(--brand-600);
}

.event-week.event-trainer {
    background-color: var(--accent-500);
}

.event-week.event-competition {
    background-color: #6f42c1;
}

.event-month.event-assigned .event-pill-compact {
    background: rgba(11, 114, 133, 0.12);
    color: var(--brand-700);
}

.event-month.event-trainer .event-pill-compact {
    background: rgba(224, 122, 95, 0.18);
    color: #a7533d;
}

.event-month.event-competition .event-pill-compact {
    background: rgba(111, 66, 193, 0.16);
    color: #59359a;
}

.event-button {
    border: none;
    font: inherit;
    display: block;
    text-align: left;
    width: 100%;
}

.event-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.week-calendar {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 800px;
    background: var(--surface-1);
    padding: 1rem;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, minmax(0, 1fr));
    gap: 0.4rem;
    font-weight: 600;
}

.week-body {
    display: grid;
    grid-template-columns: 40px repeat(7, minmax(0, 1fr));
    overflow-y: auto;
    gap: 0.4rem;
}

.time-column {
    display: flex;
    flex-direction: column;
}

.time-slot {
    height: 40px;
    font-size: 0.7rem;
    color: var(--text-3);
    border-bottom: 1px solid var(--border-1);
    padding-top: 0.4rem;
}

.day-column {
    position: relative;
    border-left: 1px solid var(--border-1);
}

.day-column::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(to bottom, transparent, transparent 39px, var(--border-1) 40px);
    pointer-events: none;
}

@media (max-width: 760px) {
    .training-detail-heading,
    .diary-entry-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .training-diary-layout {
        grid-template-columns: 1fr;
    }

    .diary-actions {
        justify-content: flex-start;
    }
}
