* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 64, 175, 0.78)),
        url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80");
    background-position: center;
    background-size: cover;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-shell {
    width: min(1040px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.34);
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.02));
}

.login-logo-lockup {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 26px;
}

.login-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.login-product {
    margin-bottom: 4px;
    color: #1d4ed8;
    font-size: 22px;
    font-weight: 900;
}

.login-product-subtitle {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-brand-panel h1 {
    max-width: 540px;
    margin: 0;
    color: #0f172a;
    font-size: 46px;
    line-height: 1.04;
}

.login-brand-panel p {
    max-width: 500px;
    margin: 18px 0 0;
    color: #475569;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.55;
}

.login-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.login-feature-list div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 54px 48px;
    background: white;
}

.login-card-header {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
}

.login-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
}

.login-icon-badge .ui-icon {
    width: 24px;
    height: 24px;
}

.login-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
}

.login-card p {
    margin: 5px 0 0;
    color: #64748b;
    font-weight: 700;
}

.login-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-input-group {
    margin-bottom: 0;
}

.login-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.login-input-wrap:focus-within {
    background: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.login-input-wrap input {
    max-width: none;
    width: 100%;
    border: none;
    background: transparent;
    padding: 13px 0;
    outline: none;
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 800;
}

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

.header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    padding: 8px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 190px;
}

.header-logo {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: contain;
}

.header-brand-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.header-title {
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.header-school-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    object-fit: contain;
    border-radius: 8px;
}

.header-school {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav a {
    border-radius: 999px;
    margin-left: 15px;
    padding: 9px 12px;
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ui-icon {
    display: inline-block;
    flex: 0 0 auto;
    max-width: 17px;
    max-height: 17px;
    min-width: 17px;
    min-height: 17px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vertical-align: -3px;
}

svg.ui-icon,
.btn svg.ui-icon,
.link svg.ui-icon,
.nav svg.ui-icon,
.nav-dropdown-button svg.ui-icon,
.nav-dropdown-menu svg.ui-icon {
    display: inline-block;
    flex: 0 0 17px;
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
}

.nav a,
.nav-dropdown-button,
.btn,
.link {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-toggle {
    display: none;
}

.nav a {
    margin-left: 0;
}

.nav > a:hover,
.nav-dropdown:hover .nav-dropdown-button,
.nav-dropdown:focus-within .nav-dropdown-button {
    background: #eff6ff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    transform: translateY(-1px);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown::after {
    content: "";
    display: block;
    height: 12px;
    left: 0;
    position: absolute;
    right: 0;
    top: 100%;
}

.nav-dropdown-button {
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    padding: 9px 12px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-dropdown-button::after {
    content: "⌄";
    font-size: 15px;
    margin-left: 7px;
    transform: translateY(-1px);
    transition: transform 0.18s ease;
}

.nav-dropdown:hover .nav-dropdown-button::after,
.nav-dropdown:focus-within .nav-dropdown-button::after {
    transform: translateY(1px);
}

.nav-dropdown-menu {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 260px;
    padding: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 10;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    border-radius: 10px;
    padding: 10px 12px;
    color: #334155;
    font-size: 14px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: #f8fafc;
    color: #1d4ed8;
    text-decoration: none;
    transform: translateX(2px);
    box-shadow: none;
}

.nav-dropdown-section {
    padding: 4px 0;
}

.nav-dropdown-section + .nav-dropdown-section {
    border-top: 1px solid #e5e7eb;
    margin-top: 6px;
    padding-top: 10px;
}

.nav-dropdown-heading {
    padding: 6px 12px 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.nav-dropdown-disabled {
    display: block;
    padding: 8px 14px;
    color: #9ca3af;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.accounting-payments-card {
    max-width: 1380px;
    overflow-x: auto;
}

.accounting-payments-page {
    max-width: 1680px;
}

.refund-summary {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.refund-summary div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.refund-summary span {
    text-align: right;
}

h1 {
    margin-top: 0;
    font-size: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #16a34a;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

input,
select,
textarea {
    width: 100%;
    max-width: 420px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

label {
    font-weight: bold;
    display: inline-block;
    margin-bottom: 6px;
}

/* Tables classiques du site, sauf FullCalendar */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 22px;
}

.data-table th,
.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.data-table th {
    background: #f9fafb;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f9fafb;
}

.form-group {
    margin-bottom: 18px;
}

.form-group > input,
.form-group > select,
.form-group > textarea {
    display: block;
}

.form-card {
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

.form-card-wide {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 820px;
}

.stage-wide-card {
    max-width: 1180px;
}

.stage-full-width-card {
    margin-left: calc(50% - 50vw + 16px);
    margin-right: calc(50% - 50vw + 16px);
    width: calc(100vw - 32px);
}

.form-card-wide .form-group > input,
.form-card-wide .form-group > select,
.form-card-wide .form-group > textarea {
    max-width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    max-width: 100%;
}

.checkbox-label input {
    flex: 0 0 auto;
    width: auto;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-form {
    margin: 0;
}

.link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    overflow-wrap: anywhere;
}

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

details summary {
    cursor: pointer;
    font-weight: 700;
}

details div {
    margin-top: 6px;
}

.alert-error {
    color: #b91c1c;
    font-weight: 500;
}

.alert-success {
    color: #047857;
    font-weight: 500;
}

.platform-support-banner {
    padding: 10px 24px;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 14px;
}

.muted-text {
    color: #6b7280;
}

.readonly-value {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

.weekday-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 420px;
}

.weekday-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-weight: 600;
}

.weekday-option input {
    width: auto;
}

.accounting-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
    margin: 20px 0;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.payment-form,
.period-filter {
    margin-bottom: 24px;
}

.mark-completed-form {
    margin: 0 0 24px;
}

.delete-form {
    margin: 16px 0 28px;
    padding-top: 16px;
    border-top: 1px solid #fee2e2;
}

.history-panel {
    margin: 18px 0 24px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.collapsible-panel {
    margin: 18px 0;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.collapsible-panel summary {
    cursor: pointer;
    font-weight: bold;
}

.collapsible-panel[open] summary {
    margin-bottom: 18px;
}

.gift-voucher-results {
    margin-top: 10px;
    max-width: 420px;
}

.gift-voucher-result {
    width: 100%;
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e3a8a;
    cursor: pointer;
    text-align: left;
}

.gift-voucher-result:hover {
    background: #dbeafe;
}

.gift-voucher-result span,
.gift-voucher-result small {
    color: #374151;
}

.gift-voucher-result.is-disabled {
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.slot-main-actions {
    align-items: center;
    flex-wrap: wrap;
}

.validate-actions {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.payment-progress {
    min-width: 180px;
}

.payment-progress-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.payment-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.payment-progress-fill.is-missing {
    background: #dc2626;
}

.payment-progress-fill.is-paid {
    background: #16a34a;
}

.payment-progress-fill.is-overpaid {
    background: #2563eb;
}

.payment-progress-label {
    margin-top: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.stage-event-content {
    display: grid;
    gap: 2px;
    line-height: 1.2;
}

.stage-event-title {
    font-weight: bold;
}

.stage-event-meta {
    font-size: 12px;
    opacity: 0.95;
}

.stage-half-days-table-wrap {
    overflow-x: auto;
}

.stage-half-days-table th,
.stage-half-days-table td {
    min-width: 90px;
    text-align: center;
    vertical-align: middle;
}

.stage-half-days-table th:first-child,
.stage-half-days-table td:first-child {
    left: 0;
    min-width: 180px;
    position: sticky;
    text-align: left;
    z-index: 1;
}

.stage-half-days-table th:first-child {
    z-index: 2;
}

.stage-half-days-table td:first-child {
    background: white;
}

.stage-half-days-table input[type="checkbox"] {
    width: auto;
}

.equipment-settings-form {
    margin-bottom: 24px;
}

.equipment-assignment-table select {
    max-width: 260px;
}

.equipment-personal-wing-fields {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.equipment-personal-wing-fields[hidden] {
    display: none;
}

.equipment-ptv-warning {
    background: #fff7ed;
}

.equipment-ptv-warning select {
    border-color: #f59e0b;
    background: #fffbeb;
}

.equipment-ptv-danger {
    background: #fef2f2;
}

.equipment-ptv-danger select {
    border-color: #dc2626;
    background: #fff1f2;
}

.equipment-flights-input {
    max-width: 90px;
}

.half-day-column-toggle {
    display: block;
    margin: 6px auto 0;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.half-day-column-toggle:hover {
    background: #eff6ff;
}

.participant-hover {
    border-bottom: 1px dotted #2563eb;
    color: #1f2937;
    display: inline-block;
}

.participant-info-row {
    cursor: help;
}

.participant-info-row:hover td {
    background: #eff6ff;
}

.participant-info-row:hover .participant-hover {
    color: #2563eb;
}

.minor-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 999px;
    background: #f59e0b;
    color: white;
    cursor: help;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.status-stage-pending {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.status-stage-confirmed {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.status-stage-waiting_list {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.status-stage-cancelled {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.status-stage-completed {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
}

.participant-floating-tooltip {
    min-width: 260px;
    max-width: 360px;
    opacity: 0;
    padding: 10px 12px;
    pointer-events: none;
    position: fixed;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 9999;
    background: #111827;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    color: white;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    white-space: pre-line;
}

.participant-floating-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 700px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .login-page {
        padding: 16px;
    }

    .login-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        width: calc(100vw - 32px);
        max-width: 100%;
        min-width: 0;
    }

    .login-brand-panel {
        padding: 32px 26px;
        gap: 28px;
        min-width: 0;
        width: 100%;
    }

    .login-logo {
        width: 72px;
        height: 72px;
    }

    .login-brand-panel h1 {
        font-size: 34px;
        overflow-wrap: break-word;
    }

    .login-brand-panel p {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .login-card {
        padding: 32px 26px;
        min-width: 0;
        width: 100%;
    }

    .login-input-wrap,
    .login-input-wrap input {
        min-width: 0;
    }

    .header {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
        padding: 10px 16px;
    }

    .header-brand {
        flex: 1 1 0;
        min-width: 0;
    }

    .header-logo {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .header-school-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .header-title {
        font-size: 21px;
    }

    .header-school {
        max-width: 100%;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 40px;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: white;
        color: #334155;
        cursor: pointer;
        font: inherit;
        font-size: 14px;
        font-weight: 800;
    }

    .nav-toggle:hover,
    .header.is-nav-open .nav-toggle {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .nav {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        flex: 0 0 100%;
        width: 100%;
        gap: 8px;
    }

    .header.is-nav-open .nav {
        display: grid;
    }

    .nav a,
    .nav-dropdown-button {
        justify-content: center;
        min-height: 40px;
        width: 100%;
        padding: 10px 12px;
        text-align: center;
    }

    .nav-dropdown {
        grid-column: 1 / -1;
        position: static;
    }

    .nav-dropdown::after {
        display: none;
    }

    .nav-dropdown-menu {
        display: none;
        left: 0;
        position: static;
        right: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        transform: none;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        white-space: normal;
    }

    .page {
        max-width: 100%;
        padding: 16px;
    }

    .card {
        padding: 18px;
        border-radius: 10px;
    }

    h1 {
        font-size: 24px;
        line-height: 1.2;
    }

    h2 {
        font-size: 20px;
        line-height: 1.25;
    }

    input,
    select,
    textarea,
    .form-card-wide .form-group > input,
    .form-card-wide .form-group > select,
    .form-card-wide .form-group > textarea {
        max-width: 100%;
        min-width: 0;
    }

    input[type="color"] {
        min-height: 44px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .weekday-picker {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .weekday-option {
        width: 100%;
    }

    .accounting-summary {
        grid-template-columns: 1fr;
    }

    .refund-summary div {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .refund-summary span {
        text-align: left;
    }

    .page-title-row,
    .form-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-actions,
    .page-title-actions,
    .slot-main-actions {
        width: 100%;
    }

    .page-title-actions {
        justify-content: flex-start;
    }

    .page-title-row > strong,
    .page-title-actions > strong {
        width: 100%;
    }

    .btn,
    .page-title-actions .btn,
    .form-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .inline-form,
    .inline-form .btn {
        width: 100%;
    }

    .period-filter .form-actions .btn {
        width: 100%;
    }

    .data-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
        white-space: nowrap;
    }

    .data-table td {
        vertical-align: top;
    }

    .data-table details {
        min-width: 190px;
    }

    .gift-voucher-results,
    .gift-voucher-result,
    .payment-progress {
        max-width: 100%;
        min-width: 0;
    }

    .collapsible-panel,
    .history-panel {
        padding: 14px;
    }

    .voucher-print {
        margin: 16px !important;
        padding: 24px 18px !important;
        max-width: calc(100vw - 32px) !important;
        border-radius: 10px !important;
    }

    .voucher-title {
        font-size: 30px !important;
        line-height: 1.15;
    }

    .voucher-code {
        font-size: 22px !important;
        overflow-wrap: anywhere;
    }

    .stage-full-width-card {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .stage-half-days-table-wrap {
        margin-left: -18px;
        margin-right: -18px;
        padding: 0 18px;
    }

    .stage-half-days-table th,
    .stage-half-days-table td {
        min-width: 76px;
    }

    .stage-half-days-table th:first-child,
    .stage-half-days-table td:first-child {
        min-width: 150px;
    }

    .equipment-assignment-table select {
        min-width: 220px;
    }

    .participant-floating-tooltip {
        display: none;
    }

    .fc {
        font-size: 12px;
    }

    .fc .fc-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .fc .fc-button-group {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 4px;
    }

    .fc .fc-button {
        padding: 7px 9px;
        font-size: 12px;
    }

    .fc .fc-toolbar-title {
        font-size: 18px;
        text-align: center;
    }

    .fc .fc-view-harness {
        min-height: 620px;
    }

    .fc .fc-timegrid-axis,
    .fc .fc-timegrid-slot-label {
        font-size: 11px;
    }
}

@media (max-width: 900px) {
    .header {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
        padding: 10px 16px;
    }

    .header-brand {
        flex: 1 1 0;
        min-width: 0;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 40px;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: white;
        color: #334155;
        cursor: pointer;
        font: inherit;
        font-size: 14px;
        font-weight: 800;
    }

    .nav-toggle:hover,
    .header.is-nav-open .nav-toggle {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .nav {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        flex: 0 0 100%;
        width: 100%;
        gap: 8px;
    }

    .header.is-nav-open .nav {
        display: grid;
    }

    .nav a,
    .nav-dropdown-button {
        justify-content: center;
        min-height: 40px;
        width: 100%;
        padding: 10px 12px;
        text-align: center;
    }

    .nav-dropdown {
        grid-column: 1 / -1;
        position: static;
    }

    .nav-dropdown::after {
        display: none;
    }

    .nav-dropdown-menu {
        display: none;
        left: 0;
        position: static;
        right: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
        transform: none;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        white-space: normal;
    }

    .table-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-scroll > .data-table {
        display: table;
        width: max-content;
        min-width: 100%;
        max-width: none;
    }

    .table-scroll > .data-table th,
    .table-scroll > .data-table td {
        white-space: nowrap;
    }
}
