html, body {
    font-family: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f4f7f2;
    color: #2c3e35;
    margin: 0;
    padding: 0;
    height: 100%;
}

a, .btn-link {
    color: #2d6a4f;
}

.btn-primary {
    color: #fff;
    background-color: #52b788;
    border-color: #52b788;
}

    .btn-primary:hover {
        background-color: #74c69d;
        border-color: #74c69d;
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #52b788;
}

/* Alap admin wrapper és flexbox elrendezés */
.admin-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f4f7f2;
    color: #2c3e35;
    overflow-x: hidden;
}

/* Oldalsáv (Sidebar) - Fix zöld alappal és teljes rejtéssel */
.admin-sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #1b4332 !important;
    color: #d8ede1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow: hidden; /* FONTOS: Ez vágja le a háttérkép kilógó részeit */
    box-shadow: 4px 0 15px rgba(44, 62, 53, 0.05);
    z-index: 100;
}

/* Oldalsáv fix zöld motívumos háttérrel és éles lehatárolással */
.admin-sidebar-container {
    width: 280px;
    min-width: 280px;
    background-color: #1b4332 !important; /* Fix alapszín, hogy ne üssön át semmi */
    color: #d8ede1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-shadow: 4px 0 15px rgba(44, 62, 53, 0.05);
    z-index: 100;
}

/* Zöld motívumos háttérkép, szigorúan csak a sidebar-on belül */
.sidebar-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1518531933037-91b2f5f229cc?q=80&w=600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    opacity: 0.12; /* Finom, diszkrét zöld textúra */
    z-index: 1;
    pointer-events: none;
}

.sidebar-content-wrapper {
    width: 100%;
    height: 100%;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .sidebar-header h4 {
        color: #ffffff;
        font-weight: 800;
        letter-spacing: 0.5px;
        margin-bottom: 0;
    }

.admin-sidebar .nav-link {
    color: #d8ede1;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    margin: 4px 12px;
}

    .admin-sidebar .nav-link:hover,
    .admin-sidebar .nav-link.active {
        background-color: #2d6a4f;
        color: #ffffff;
        transform: translateX(4px);
    }

/* Fő tartalom terület */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: #f4f7f2;
}

.admin-header {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid #e9f5ed;
    box-shadow: 0 4px 15px rgba(44, 62, 53, 0.03);
}

    .admin-header h5 {
        font-weight: 700;
        color: #1b4332;
        margin-bottom: 0;
    }

.admin-content {
    flex: 1;
    background-color: #f4f7f2;
    padding: 30px;
}

/* Admin kártyák és elemek illesztése */
.admin-wrapper .card {
    background: #ffffff;
    border: 1px solid #e9f5ed;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(44, 62, 53, 0.04);
}

.admin-wrapper .btn-primary,
.admin-wrapper .btn-success {
    background-color: #52b788;
    border-color: #52b788;
    color: #ffffff;
    font-weight: 700;
    border-radius: 30px;
    padding: 8px 20px;
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.2);
    transition: all 0.2s ease-in-out;
}

    .admin-wrapper .btn-primary:hover,
    .admin-wrapper .btn-success:hover {
        background-color: #74c69d;
        border-color: #74c69d;
        transform: translateY(-2px);
    }

.admin-wrapper .table {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9f5ed;
}

    .admin-wrapper .table th {
        background-color: #e9f5ed;
        color: #1b4332;
        font-weight: 700;
        border-bottom: 1px solid #d8ede1;
    }

.mobile-toggle-btn, .mobile-close-btn {
    display: none;
    background: none;
    border: none;
    color: #1b4332;
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
}

.mobile-close-btn {
    color: #d8ede1;
}

/* Oldalsáv lábléc stílusa (logó, kijelentkezés, verzió) */
.sidebar-footer {
    margin-top: auto; /* Ez tolja le fixen a sidebar aljára */
    background-color: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

    .sidebar-footer img {
        transition: opacity 0.2s ease-in-out;
    }

        .sidebar-footer img:hover {
            opacity: 1 !important;
        }

/* Mobil optimalizálás (768px alatt) */
@media (max-width: 768px) {
    .admin-wrapper {
        font-size: 11px !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .admin-main {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .admin-content {
        padding: 10px !important;
        overflow-x: hidden !important;
    }

    .admin-wrapper .card, .card {
        padding: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    /* Input mezők, selectek és gombok belső méreteinek igazítása mobilon */
    .admin-wrapper input,
    .admin-wrapper select,
    .admin-wrapper textarea,
    .admin-wrapper .form-control,
    .admin-wrapper .form-select {
        font-size: 11px !important;
        padding: 4px 8px !important;
        min-height: 28px !important;
        height: auto !important;
    }

    /* Kisebb gombok mérete mobilon, hogy ne lógjanak ki */
    .admin-wrapper .btn-sm {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

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

    .mobile-toggle-btn, .mobile-close-btn {
        display: block;
    }

    .admin-header {
        height: auto;
        min-height: 60px;
        padding: 10px 15px !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    }

        .admin-sidebar.open {
            transform: translateX(0);
        }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

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

.validation-message {
    color: #e50000;
}

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

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

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

#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;
    }

/* Alapértelmezésben rejtve van, amíg minden rendben van a kapcsolattal */
#components-reconnect-modal {
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 0;
}

    /* Amikor a Blazor aktiválja a kapcsolatvesztés miatt, megjelenik */
    #components-reconnect-modal.components-reconnect-show {
        display: flex;
    }

/* A kártya stílusa marad a régi */
.reconnect-card-wrapper {
    background: #ffffff;
    border: 1px solid #e9f5ed;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(44, 62, 53, 0.15);
    max-width: 420px;
    width: 90%;
    overflow: hidden;
}