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

/* Import zunifikowanych komponentów CSS */
@import 'css/main.css';

:root {
    color-scheme: light;
    /* ===========================================
       KOLORY PODSTAWOWE (Primary)
       Nadpisywane przez ThemeCssGenerator z EstateTheme.PrimaryColor
       =========================================== */
    --color-primary: #2A6F67;
    --color-primary-light: #3A8B82;
    --color-primary-dark: #1E524C;
    --color-primary-soft: rgba(42, 111, 103, 0.1);
    --color-on-primary: #FFFFFF;
    /* Alias dla kompatybilności wstecznej */
    --color-primary-hover: var(--color-primary-light);
    /* ===========================================
       KOLORY DRUGORZĘDNE (Secondary)
       Nadpisywane przez ThemeCssGenerator z EstateTheme.SecondaryColor
       =========================================== */
    --color-secondary: #4A9B92;
    --color-secondary-light: #6BB5AC;
    --color-secondary-dark: #357A72;
    --color-secondary-soft: rgba(74, 155, 146, 0.1);
    /* ===========================================
       KOLORY AKCENTOWE (Accent)
       Nadpisywane przez ThemeCssGenerator z EstateTheme.AccentColor
       =========================================== */
    --color-accent: #F59E0B;
    --color-accent-soft: rgba(245, 158, 11, 0.1);
    /* Aliasy dla kompatybilności - delikatne tło akcentowe */
    --color-accent-bg: #EAF3F1;
    /* ===========================================
       KOLORY SEMANTYCZNE
       Nadpisywane przez ThemeCssGenerator jeśli ustawione w EstateTheme
       =========================================== */
    --color-success: #10B981;
    --color-success-soft: rgba(16, 185, 129, 0.1);
    --color-warning: #F59E0B;
    --color-warning-soft: rgba(245, 158, 11, 0.1);
    --color-error: #EF4444;
    --color-error-soft: rgba(239, 68, 68, 0.1);
    --color-info: #3B82F6;
    --color-info-soft: rgba(59, 130, 246, 0.1);
    /* ===========================================
       POWIERZCHNIE I TŁA
       =========================================== */
    --color-surface: #FFFFFF;
    --color-surface-variant: #F8FAFC;
    --color-surface-hover: #F1F5F9;
    --color-surface-strong: rgba(255, 255, 255, 0.94);
    --color-background: #F7F6F2;
    /* Alias dla kompatybilności wstecznej */
    --color-bg: var(--color-background);
    /* ===========================================
       KOLORY TEKSTU
       =========================================== */
    --color-text: #1c2142;
    --color-text-heading: #1c2142;
    --color-text-body: #334155;
    --color-text-primary: #1c2142;
    --color-text-secondary: #4d5379;
    --color-text-muted: #6B7280;
    --color-text-on-primary: var(--color-on-primary);
    /* ===========================================
       OBRAMOWANIA
       =========================================== */
    --color-border: #E3E8E2;
    --color-border-light: #F3F4F6;
    --color-border-focus: var(--color-primary);
    /* ===========================================
       TYPOGRAFIA
       Nadpisywane przez ThemeCssGenerator z EstateTheme.FontFamily
       =========================================== */
    --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-family-heading: var(--font-family);
    /* Alias dla kompatybilności wstecznej */
    --font-sans: var(--font-family);
    /* ===========================================
       ZAOKRĄGLENIA (Border Radius)
       Nadpisywane przez ThemeCssGenerator z EstateTheme.BorderRadius
       =========================================== */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    /* ===========================================
       CIENIE
       =========================================== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 14px rgba(42, 111, 103, 0.25);
    /* Aliasy dla kompatybilności wstecznej */
    --shadow-soft: var(--shadow-md);
    --shadow-hard: var(--shadow-lg);
    /* ===========================================
       PRZEJŚCIA (Transitions)
       =========================================== */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
    /* Alias dla kompatybilności wstecznej */
    --transition: var(--transition-normal);
    /* ===========================================
       SPECJALNE - Landing Page
       =========================================== */
    --landing-container-max-width: 1200px;
    --landing-section-spacing: 2rem;
    --landing-text-secondary: var(--color-text-secondary);
    /* ===========================================
       LAYOUT - Spaces Pages
       =========================================== */
    --header-height: 4.5rem;
    --space-max-width: 1400px;
    --space-padding: 0.75rem;
    --space-padding-mobile: 1rem;
    --space-gap: 2.4rem;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    font-family: var(--font-sans);
    background: #eef1ff;
    color: var(--color-text);
    margin: 0;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: clip;
}

a {
    color: var(--color-primary);
    cursor: pointer;
}

    a:hover,
    a:focus {
        color: #354dff;
    }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--color-text);
}

p {
    color: var(--color-text-muted);
    line-height: 1.65;
}

button {
    font-family: inherit;
}

/* ===========================================
   WSPÓLNE KOMPONENTY FORMULARZY
   Te klasy można używać globalnie zamiast
   definiować je w każdym pliku .razor.css
   =========================================== */

/* Grupa formularza - podstawowy kontener */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label,
.form-group > span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
    border-color: var(--color-error);
    background: var(--color-error-soft);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Etykieta formularza */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* Wiersz formularza - poziomy układ */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-row--two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row--two-cols {
        grid-template-columns: 1fr;
    }
}

/* Grid formularza */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Podpowiedź pod polem */
.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Błąd walidacji */
.field-error {
    font-size: 0.8rem;
    color: var(--color-error);
}

/* Akcje formularza */
.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* Sekcja formularza */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: var(--border-color, #ccc);
    border-radius: 28px;
    transition: 0.3s;
}

    .toggle-slider::before {
        content: "";
        position: absolute;
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        border-radius: 50%;
        transition: 0.3s;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color, #4CAF50);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body, #334155);
}

.content {
    padding-top: 0;
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
}

.validation-summary {
    color: #d62839;
}

.validation-message {
    color: #d62839;
}

#blazor-error-ui {
    color-scheme: light only;
    background: rgba(255, 173, 214, 0.2);
    bottom: 1rem;
    border-radius: 14px;
    border: 1px solid rgba(233, 112, 169, 0.4);
    box-shadow: 0 18px 40px rgba(233, 112, 169, 0.22);
    box-sizing: border-box;
    display: none;
    left: 1rem;
    right: 1rem;
    padding: 0.9rem 1.1rem 1rem 1.2rem;
    position: fixed;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.6rem;
    }

.blazor-error-boundary {
    background: rgba(233, 112, 169, 0.12);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(233, 112, 169, 0.35);
}

    .blazor-error-boundary::after {
        content: "Sorry, something went wrong.";
        font-weight: 600;
        color: #b32656;
    }

a, button, input, textarea {
    transition: all var(--transition);
}

::selection {
    background: rgba(76, 110, 245, 0.25);
}


/* Image Upload Area */
.image-upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--color-surface-variant);
    cursor: pointer;
    transition: all var(--transition);
}

    .image-upload-area:hover {
        border-color: var(--color-primary);
        background: var(--color-primary-soft);
    }

.image-upload-area--avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.image-upload-area .upload-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.image-upload-area ::deep input[type="file"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    pointer-events: none;
}

    .image-upload-placeholder span {
        font-size: 0.875rem;
        color: var(--color-text-muted, #718096);
    }

.space-view {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: var(--space-max-width, 1400px);
    margin: 0 auto;
    padding: var(--space-padding, 0.75rem);
    overflow-x: clip;
    min-width: 0;
}


    @media (max-width: 720px) {
        .space-view {
            padding: 0.75rem;
        }
    }

    /* Boot screen — centrowanie i tło */
    #app {
        min-height: 100svh; /* lepsze na mobile niż 100vh */
        display: grid;
        background: linear-gradient(180deg, var(--color-bg) 0%, #FFFFFF 140%)
    }

    .boot {
        display: grid;
        place-items: center;
        padding: 2rem;
    }

    .loading-surface {
        display: grid;
        place-items: center;
        gap: 1rem;
        width: clamp(220px, 40vw, 360px);
        padding: 2rem;
        border-radius: 24px;
        background: var(--color-surface-strong);
        border: 1px solid rgba(151,163,221,0.35);
        box-shadow: var(--shadow-md);
        text-align: center;
    }

    .loading-progress {
        width: clamp(64px, 12vw, 88px);
        height: auto;
        display: block;
    }

        .loading-progress .track {
            fill: none;
            stroke: rgba(76,110,245,.12);
            stroke-width: 8;
        }

        .loading-progress .indicator {
            fill: none;
            stroke: var(--color-primary);
            stroke-width: 8;
            stroke-linecap: round;
            /* dzięki pathLength=100 możemy sterować dashami w procentach */
            stroke-dasharray: 24 100;
            animation: lp-rotate 1.1s linear infinite, lp-dash 1.6s ease-in-out infinite;
            transform-origin: 50% 50%;
        }

    /* Tekst postępu (Blazor nadpisuje ten element procentami w trakcie ładowania) */
    .loading-progress-text {
        font-weight: 600;
        color: var(--color-text);
        opacity: .9;
    }

    /* Animacje */
    @keyframes lp-rotate {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes lp-dash {
        0% {
            stroke-dasharray: 10 100;
        }

        50% {
            stroke-dasharray: 60 100;
        }

        100% {
            stroke-dasharray: 10 100;
        }
    }

    /* Mniej ruchu, jeśli użytkownik tego chce */
    @media (prefers-reduced-motion: reduce) {
        .loading-progress .indicator {
            animation: none;
        }
    }


    /* ========================================
       CTA BUTTONS
       Hierarchia: .cta (base) → warianty (.ghost, .danger, .success, .warning)
                                → rozmiary (.small, .large)
                                → specjalne (.link-button, .icon-button)
       ======================================== */

    .cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        padding: 0.75rem 1.5rem;
        background: var(--color-primary, #2A6F67);
        color: var(--color-on-primary, white);
        border: 2px solid transparent;
        border-radius: var(--radius-md, 8px);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: background var(--transition, 0.2s),
                    color var(--transition, 0.2s),
                    border-color var(--transition, 0.2s),
                    box-shadow var(--transition, 0.2s),
                    transform var(--transition, 0.2s),
                    opacity var(--transition, 0.2s);
        text-decoration: none;
    }

    .cta:hover:not(:disabled) {
        background: var(--color-primary-dark, #1E524C);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(42, 111, 103, 0.3);
    }

    .cta:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

    .cta:disabled {
        background: var(--color-text-muted, #9ca3af);
        cursor: not-allowed;
        opacity: 0.6;
    }

    /* --- Rozmiary --- */

    .cta.small {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .cta.large {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* --- Wariant: Ghost (outline) --- */

    .cta.ghost {
        background: transparent;
        color: var(--color-primary, #2A6F67);
        border-color: var(--color-primary, #2A6F67);
    }

    .cta.ghost:hover:not(:disabled) {
        background: var(--color-primary-soft, rgba(42, 111, 103, 0.1));
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(42, 111, 103, 0.15);
    }

    .cta.ghost:active:not(:disabled) {
        background: var(--color-primary-soft, rgba(42, 111, 103, 0.15));
        transform: translateY(0);
    }

    .cta.ghost:disabled {
        background: transparent;
        border-color: var(--color-text-muted, #9ca3af);
        color: var(--color-text-muted, #9ca3af);
    }

    /* --- Wariant: Secondary (primary z cieniem) --- */

    .cta.secondary {
        box-shadow: var(--shadow-primary);
        background: var(--color-secondary);
    }

    .cta.secondary:hover:not(:disabled) {
        box-shadow: var(--shadow-xl);
    }

    .cta.secondary:disabled {
        box-shadow: none;
    }

    /* --- Wariant: Danger --- */

    .cta.danger {
        background: var(--color-error, #dc2626);
        border-color: transparent;
    }

    .cta.danger:hover:not(:disabled) {
        background: #b91c1c;
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    }

    .cta.danger:active:not(:disabled) {
        background: #991b1b;
    }

    /* Danger + Ghost = outline czerwony */
    .cta.ghost.danger {
        background: transparent;
        color: var(--color-error, #dc2626);
        border-color: var(--color-error, #dc2626);
    }

    .cta.ghost.danger:hover:not(:disabled) {
        background: var(--color-error-soft, rgba(239, 68, 68, 0.1));
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
    }

    /* --- Wariant: Success --- */

    .cta.success {
        background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
        border-color: transparent;
        box-shadow: var(--shadow-sm);
    }

    .cta.success:hover:not(:disabled) {
        box-shadow: var(--shadow-md);
        filter: brightness(1.05);
    }

    .cta.success:active:not(:disabled) {
        filter: brightness(0.95);
    }

    /* --- Wariant: Warning --- */

    .cta.warning {
        background: var(--color-warning);
        border-color: transparent;
    }

    .cta.warning:hover:not(:disabled) {
        filter: brightness(0.9);
    }

    .cta.warning:active:not(:disabled) {
        filter: brightness(0.85);
    }

    /* --- Specjalny: Link Button (wygląda jak link) --- */

    .cta.link-button {
        background: none;
        border-color: transparent;
        color: var(--color-primary);
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: var(--radius-sm);
    }

    .cta.link-button:hover:not(:disabled) {
        background: var(--color-primary-soft);
        box-shadow: none;
    }

    .cta.link-button:active:not(:disabled) {
        background: rgba(42, 111, 103, 0.15);
    }

    .cta.link-button:disabled {
        background: none;
        color: var(--color-text-muted);
        opacity: 0.5;
    }

    .cta.link-button.danger {
        color: var(--color-error);
    }

    .cta.link-button.danger:hover:not(:disabled) {
        background: var(--color-error-soft);
        color: var(--color-error);
    }

    .cta.link-button.success {
        background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
        color: white;
        box-shadow: var(--shadow-sm);
    }

    .cta.link-button.success:hover:not(:disabled) {
        box-shadow: var(--shadow-md);
    }

    /* --- Specjalny: Icon Button (kwadratowy, ikonowy) --- */

    .cta.icon-button {
        background: none;
        border-color: transparent;
        color: var(--color-text-muted);
        padding: 0.5rem;
        font-size: 1.25rem;
        line-height: 1;
        border-radius: var(--radius-sm);
        width: 36px;
        height: 36px;
    }

    .cta.icon-button:hover:not(:disabled) {
        background: var(--color-surface-hover, #f1f5f9);
        color: var(--color-text);
        box-shadow: none;
    }

    .cta.icon-button:disabled {
        background: none;
        color: var(--color-text-muted);
        opacity: 0.5;
    }

    .cta.icon-button.danger {
        color: var(--color-error);
    }

    .cta.icon-button.danger:hover:not(:disabled) {
        background: var(--color-error-soft);
        color: var(--color-error);
    }

    /* --- Responsywność CTA --- */

    @media (max-width: 640px) {
        .cta {
            padding: 0.625rem 1rem;
            font-size: 0.875rem;
            gap: 0.25rem;
        }

        .cta.small {
            padding: 0.4375rem 0.75rem;
            font-size: 0.8125rem;
        }

        .cta.large {
            padding: 0.75rem 1.25rem;
            font-size: 0.9375rem;
        }

        .cta.icon-button {
            width: 32px;
            height: 32px;
            font-size: 1rem;
            padding: 0.375rem;
        }

        .cta.icon-button.small {
            width: 28px;
            height: 28px;
            font-size: 0.875rem;
            padding: 0.25rem;
        }

        .cta.link-button {
            padding: 0.375rem 0.5rem;
            font-size: 0.75rem;
        }
    }


/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group > span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-body, #374151);
}

.input-group input,
.input-group textarea,
.input-group select {
    padding: 0.75rem;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 8px);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition, 0.2s);
    background: var(--color-surface, white);
    color: var(--color-text, #1c2142);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-primary, #2A6F67);
    box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(42, 111, 103, 0.1));
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--color-text-muted, #9ca3af);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-error {
    font-size: 0.75rem;
    color: var(--color-error, #dc2626);
    margin-top: 0.25rem;
}

.input-group input[type="date"] {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    max-width: 250px;
}
    /* ========================================
   SECTION EDITOR STYLES
   Ujednolicone style dla wszystkich komponentów sekcji w trybie edycji
   ======================================== */

    /* Section Container */
    .editor-section {
        background: var(--color-surface, #fff);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: var(--radius-md, 14px);
        padding: 0.75rem;
        margin-bottom: 1.5rem;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--color-border, #e2e8f0);
    }

        .section-header h3 {
            margin: 0;
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--color-text, #1c2142);
        }

    .section-header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .section-hint {
        font-size: 0.875rem;
        color: var(--color-text-muted, #4d5379);
        margin-bottom: 1rem;
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 2rem;
        color: var(--color-text-muted, #4d5379);
        background: var(--color-surface-variant);
        border-radius: var(--radius-sm, 10px);
        border: 2px dashed var(--color-border, #e2e8f0);
        margin-bottom: 1rem;
    }

    /* Section Items List */
    .section-items-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        min-width: 0;
        overflow: hidden;
    }

    .section-item {
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem;
        background: var(--color-bg, #f8fafc);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: var(--radius-sm, 10px);
        transition: all var(--transition, 0.18s ease);
        flex-wrap: wrap;
        min-width: 0;
        overflow: hidden;
    }

        .section-item:hover {
            border-color: var(--color-primary, #2A6F67);
            box-shadow: 0 2px 8px rgba(42, 111, 103, 0.1);
        }

    .section-item-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-surface, #fff);
        border-radius: var(--radius-sm, 10px);
        flex-shrink: 0;
    }

    .section-item-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
    }

        .section-item-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .section-item-thumbnail {
        width: 64px;
        height: 48px;
        border-radius: var(--radius-sm, 10px);
        overflow: hidden;
        flex-shrink: 0;
    }

        .section-item-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .section-item-content {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .section-item-title {
        font-weight: 600;
        color: var(--color-text, #1c2142);
        margin-bottom: 0.25rem;
    }

    .section-item-subtitle {
        font-size: 0.875rem;
        color: var(--color-text-muted, #4d5379);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .section-item-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-left: auto;
    }
    
    /* Expand/Collapse List Button */
    
.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

    .btn-expand-list {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
        font-weight: 500;
        color: var(--color-text-muted, #4d5379);
        background: transparent;
        border: 1px dashed var(--color-border, #e2e8f0);
        border-radius: var(--radius-sm, 10px);
        cursor: pointer;
        transition: all var(--transition, 0.18s ease);
    }

        .btn-expand-list:hover {
            color: var(--color-primary, #2A6F67);
            border-color: var(--color-primary, #2A6F67);
            background: var(--color-accent, #EAF3F1);
        }

        .btn-expand-list span {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

    /* Collapsed item indicator */
    .section-items-collapsed-info {
        font-size: 0.75rem;
        color: var(--color-text-muted, #94a3b8);
        text-align: center;
        padding: 0.5rem;
    }

    /* Form Styles */
    .section-form {
        background: var(--color-bg, #f8fafc);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: var(--radius-sm, 10px);
        padding: 1.25rem;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .form-title {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--color-text, #1c2142);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--color-border, #e2e8f0);
    }

    .form-row {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }

        .form-group:last-child {
            margin-bottom: 0;
        }

    .form-group--icon {
        flex: 0 0 80px;
    }

    .form-group--grow {
        flex: 1;
    }

    .form-group--half {
        flex: 1;
    }

    .form-group label {
        font-size: 0.813rem;
        font-weight: 500;
        color: var(--color-text-muted, #4d5379);
    }

    .form-input {
        width: 100%;
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        color: var(--color-text, #1c2142);
        background: var(--color-surface, #fff);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: 6px;
        transition: all var(--transition, 0.18s ease);
    }

        .form-input:focus {
            outline: none;
            border-color: var(--color-primary, #2A6F67);
            box-shadow: 0 0 0 3px rgba(42, 111, 103, 0.1);
        }

        .form-input:disabled {
            background: var(--color-bg, #f1f5f9);
            cursor: not-allowed;
        }

    .form-textarea {
        width: 100%;
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        color: var(--color-text, #1c2142);
        background: var(--color-surface, #fff);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: 6px;
        transition: all var(--transition, 0.18s ease);
        resize: vertical;
        min-height: 80px;
        font-family: inherit;
    }

        .form-textarea:focus {
            outline: none;
            border-color: var(--color-primary, #2A6F67);
            box-shadow: 0 0 0 3px rgba(42, 111, 103, 0.1);
        }

    .form-hint {
        font-size: 0.75rem;
        color: var(--color-text-muted, #94a3b8);
    }

    .form-actions {
        display: flex;
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--color-border, #e2e8f0);
    }

    .form-image-preview {
        margin-bottom: 1rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

        .form-image-preview img {
            max-width: 200px;
            max-height: 150px;
            object-fit: cover;
            border-radius: var(--radius-sm, 10px);
            margin-bottom: 0.5rem;
        }

    .checkbox-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
    }

        .checkbox-label input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--color-primary, #2A6F67);
        }

    .reservations-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: var(--color-surface, #fff);
        border: 1px solid var(--color-border, #e2e8f0);
        border-radius: 8px;
        cursor: pointer;
        transition: all var(--transition, 0.18s ease);
        font-size: 0.875rem;
        user-select: none;
    }

        .reservations-toggle:hover {
            border-color: var(--color-primary, #2A6F67);
            background: var(--color-accent, #EAF3F1);
        }

        .reservations-toggle input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--color-primary, #2A6F67);
            cursor: pointer;
            margin: 0;
        }

    .reservations-toggle-label {
        color: var(--color-text-muted, #4d5379);
        font-weight: 500;
        white-space: nowrap;
    }

    .reservations-toggle:has(input:checked) .reservations-toggle-label {
        color: var(--color-text, #1c2142);
    }

    /* Responsive - na małych ekranach ukryj tekst, zostaw tylko ikonę */
    @media (max-width: 640px) {
        .reservations-toggle-label {
            display: none;
        }

        .reservations-toggle {
            padding: 0.5rem;
        }

            .reservations-toggle::after {
                content: "🎫";
                font-size: 1rem;
            }
    }

    /* ========================================
   SPACES PAGE HEADER
   Ujednolicony nagłówek dla wszystkich stron Spaces
   ======================================== */

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        background: var(--color-surface, #fff);
        border-radius: var(--radius-lg, 12px);
        border: 1px solid var(--color-border, #e2e8f0);
        margin-bottom: 1.5rem;
        box-shadow: var(--shadow-sm);
    }

        .page-header h1 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--color-text, #1c2142);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

    .page-header-info {
        flex: 1;
    }

        .page-header-info h1 {
            margin: 0 0 0.25rem 0;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--color-text, #1c2142);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .page-header-info p {
            margin: 0;
            font-size: 0.875rem;
            color: var(--color-text-muted, #6b7280);
            line-height: 1.4;
        }

    .page-header-actions {
        display: flex;
        gap: 0.75rem;
        align-items: center;
        flex-shrink: 0;
    }

    /* Responsive - na małych ekranach układ pionowy */
    @media (max-width: 640px) {
        .page-header {
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
            padding: 1rem;
        }

            .page-header h1,
            .page-header-info h1 {
                font-size: 1.25rem;
            }

        .page-header-actions {
            justify-content: flex-end;
        }
    }

/* ========================================
   TIME SLOTS
   Globalne style dla wyboru godzin/slotów czasowych
   ======================================== */

/* Kontener slotów czasowych - flexbox wrap */
.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Kontener slotów czasowych - grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

/* Pojedynczy slot czasowy - wersja podstawowa (button w .time-slots) */
.time-slot {
    padding: 0.5rem 0.875rem;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-heading, #1c2142);
    cursor: pointer;
    transition: all var(--transition, 0.15s);
}

.time-slot:hover {
    border-color: var(--color-primary, #2A6F67);
    background: var(--color-primary-soft, rgba(42, 111, 103, 0.1));
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.time-slot.selected {
    border-color: var(--color-primary, #2A6F67);
    background: var(--color-primary, #2A6F67);
    color: var(--color-on-primary, #fff);
    box-shadow: var(--shadow-primary);
}

/* Pojedynczy slot czasowy - wersja grid (button w .time-slots-grid) */
.time-slot-btn {
    padding: 0.625rem 0.75rem;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-heading, #1c2142);
    cursor: pointer;
    transition: all var(--transition, 0.15s);
    text-align: center;
}

.time-slot-btn:hover {
    border-color: var(--color-primary, #2A6F67);
    background: var(--color-primary-soft, rgba(42, 111, 103, 0.1));
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.time-slot-btn.selected {
    border-color: var(--color-primary, #2A6F67);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-on-primary, #fff);
    box-shadow: var(--shadow-primary);
}

/* Responsywność dla time-slots */
@media (max-width: 640px) {
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-slot,
    .time-slot-btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
