:root {
    --primary-green: #36b35f;
    --primary-green-hover: #2d964f;
    --bg-dark: #121212;
    --panel-dark: #1e1e1e;
    --text-light: #f5f5f5;
    --text-muted: #a0a0a0;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* --- LOGIN FELÜLET --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at top left, #1e1e1e, #121212);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: var(--panel-dark);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.login-box h2 {
    margin-bottom: 10px;
    text-align: center;
}

.login-box p {
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
    font-size: 0.9em;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-green);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1em;
}

.btn-primary:hover {
    background-color: var(--primary-green-hover);
}

.error {
    color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85em;
    text-align: center;
    border: 1px solid #ff4d4d;
}

/* --- DASHBOARD FELÜLET --- */
.dashboard-body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: var(--panel-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;            /* Teljes magasság */
    overflow: hidden;         /* A sidebar maga ne görögjön, a nav-menu igen */
    padding: 20px;
}

/* --- ÚJ LOGÓ STÍLUS (Egysoros) --- */
.logo {
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
}

.logo-title {
    font-size: 1.25em; /* Kicsit kisebb, hogy biztosan kiférjen 250px-en */
    font-weight: bold;
    color: var(--text-light);
    white-space: nowrap; /* Ez akadályozza meg, hogy 2 sorba törjön! */
}

.logo-title span {
    color: var(--primary-green);
}

.logo-subtitle {
    font-size: 0.6em;
    font-weight: normal;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* --- CHECKBOX STÍLUSOK A JOGOSULTSÁGOKHOZ --- */
.checkbox-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 0.9em;
    cursor: pointer;
}


.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;             /* Kitölti a rendelkezésre álló helyet */
    overflow-y: auto;         /* Görgethető, ha túl hosszú a menü */
    padding-right: 5px;       /* Kis hely a görgetősávnak */
}
/* Görgetősáv stílusolása (opcionális, de szebb) */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}
.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}
.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
.nav-menu a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    background-color: rgba(54, 179, 95, 0.1);
    color: var(--primary-green);
}

.bottom-nav {
    margin-top: auto;
}

.logout-btn {
    text-decoration: none;
    color: #ff4d4d;
    padding: 12px 15px;
    display: block;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 77, 77, 0.1);
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-bar input {
    background-color: var(--panel-dark);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 20px;
    color: var(--text-light);
    width: 300px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary-green);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-green);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background-color: var(--panel-dark);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.card h3 {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 15px;
    font-weight: normal;
}

.card .value {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.card .trend {
    font-size: 0.85em;
}

.trend.positive {
    color: var(--primary-green);
}

.trend.negative {
    color: #ff4d4d;
}

.chart-container {
    background-color: var(--panel-dark);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.chart-container h2 {
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: normal;
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}
/* --- ÚJ LOGÓ ALCÍM --- */
.logo {
    display: flex;
    flex-direction: column;
}
.logo-subtitle {
    font-size: 0.5em;
    font-weight: normal;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* --- TÁBLÁZAT ÉS GOMBOK --- */
.table-container {
    background-color: var(--panel-dark);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.table-header h2 {
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 16px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

.data-table tbody tr {
    transition: background-color 0.3s;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.data-table td {
    color: var(--text-light);
    vertical-align: middle;
}

/* Kisebb akciógombok a táblázatban */
.btn-sm {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-sm:active {
    transform: translateY(0);
}

.btn-edit { background-color: #2c3e50; border: 1px solid #34495e; }
.btn-edit:hover { background-color: #34495e; }

.btn-password { background-color: rgba(54, 179, 95, 0.2); color: var(--primary-green); border: 1px solid var(--primary-green); }
.btn-password:hover { background-color: var(--primary-green); color: white; }

.btn-delete { background-color: rgba(255, 77, 77, 0.1); color: #ff4d4d; border: 1px solid rgba(255, 77, 77, 0.3); }
.btn-delete:hover { background-color: #ff4d4d; color: white; }

.btn-add {
    background-color: var(--primary-green);
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 8px;
    width: auto;
}

/* --- MODÁLIS ABLAKOK (Popups) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px); /* Üveges homályosítás a háttéren */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--panel-dark);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    color: var(--text-muted);
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover { color: #ff4d4d; }

.modal-content h3 {
    margin-bottom: 25px;
    font-size: 1.3em;
    font-weight: 500;
}

.flex-row { display: flex; gap: 15px; }
.flex-row .input-group { flex: 1; }

/* --- FELHASZNÁLÓI MENÜ ÉS AVATAR --- */
.user-profile {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-green);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background-color: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: background 0.3s;
    font-size: 0.9em;
}

.profile-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-green);
}

.profile-dropdown a svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.file-input-wrapper {
    margin-bottom: 20px;
}
.file-input-wrapper input[type="file"] {
    background: var(--bg-dark);
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    color: var(--text-light);
    border: 1px dashed var(--border-color);
}
/* --- FEJLÉC ÉS KÖZÉPRE IGAZÍTOTT KERESŐ --- */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-bar-container {
    flex: 1; /* Bal oldali üres tér a tökéletes középre igazításhoz */
}

.search-bar {
    flex: 2; /* Középső rész */
    display: flex;
    justify-content: center;
}

.search-bar input {
    background-color: var(--panel-dark);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 20px;
    color: var(--text-light);
    width: 100%;
    max-width: 600px; /* Szélesebb keresősáv */
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary-green);
}

.profile-container {
    flex: 1; /* Jobb oldali rész */
    display: flex;
    justify-content: flex-end;
}

/* --- TARTALOM ÉS LÁBLÉC --- */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column; /* Egymás alá rendezi a tartalmat és a footert */
}

.page-wrapper {
    flex-grow: 1; /* Ez a rész kitölti az üres teret a footer felett */
}

.footer {
    text-align: center;
    padding-top: 20px;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.85em;
    border-top: 1px solid var(--border-color);
}
/* --- ALMENÜK A SIDEBARBAN (Designos, vonalas elrendezés) --- */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

/* Csak a közvetlen A tagekre vonatkozzon a főmenü stílus, a sub-menu-ben lévőkre NE! */
.nav-menu > a,
.nav-item > a {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-menu > a:hover,
.nav-menu > a.active,
.nav-item > a:hover,
.nav-item > a.active {
    background-color: rgba(54, 179, 95, 0.1);
    color: var(--primary-green);
}

.nav-item {
    display: flex;
    flex-direction: column;
}

/* Almenü konténer */
.sub-menu {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    margin-bottom: 6px;
    margin-left: 18px;
    padding-left: 12px;
    border-left: 2px solid rgba(54, 179, 95, 0.3); /* Zöldes vezetővonal */
    gap: 4px;
}

/* Almenü linkek pontos felülírása */
.sub-menu a {
    display: block;
    font-size: 0.85em !important;
    padding: 8px 12px !important;
    color: var(--text-muted) !important;
    position: relative;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent !important;
}

/* Hover állapot az almenüben */
.sub-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-light) !important;
    transform: translateX(4px);
}

/* Aktív almenüpont */
.sub-menu a.active-sub {
    background-color: rgba(54, 179, 95, 0.15) !important;
    color: var(--primary-green) !important;
    font-weight: 600;
}
/* --- HIBAJEGY OLDAL ELRENDEZÉSE --- */
.ticket-layout {
    display: flex;
    gap: 25px;
    margin-top: 20px;
}

.ticket-filters {
    width: 250px;
    background-color: var(--panel-dark);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: fit-content;
}

.ticket-filters h3 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.ticket-list-container {
    flex: 1;
}

/* --- STÁTUSZ ÉS PRIORITÁS JELVÉNYEK --- */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    color: white;
    display: inline-block;
}

/* Prioritások */
.prio-magas { background-color: #ff4d4d; }
.prio-kozepes { background-color: #f39c12; }
.prio-alacsony { background-color: #36b35f; }

/* Státuszok */
.stat-nyitott { border: 1px solid #3498db; color: #3498db; background: rgba(52, 152, 219, 0.1); }
.stat-lezart { border: 1px solid var(--text-muted); color: var(--text-muted); background: rgba(160, 160, 160, 0.1); }
.stat-felfuggesztett { border: 1px solid #f39c12; color: #f39c12; background: rgba(243, 156, 18, 0.1); }

/* --- FÜLES (TABS) NAVIGÁCIÓ --- */
.tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
    margin-top: 20px;
}

.tab-btn {
    padding: 10px 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.05em;
    cursor: pointer;
    position: relative;
    bottom: -1px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-light);
}

.tab-btn.active {
    color: var(--primary-green);
    border-bottom: 2px solid var(--primary-green);
    font-weight: 500;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}
/* Jobb oldalra igazított, zöld színátmenetes munkalap gomb */
.btn-action-sheet {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(54, 179, 95, 0.15) 0%, rgba(30, 30, 30, 0.8) 100%);
    border: 1px solid rgba(54, 179, 95, 0.4);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 0;
    cursor: pointer;
}

.btn-action-sheet:hover {
    background: linear-gradient(135deg, rgba(54, 179, 95, 0.3) 0%, rgba(40, 40, 40, 0.9) 100%);
    border-color: var(--primary-green);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 179, 95, 0.25);
}

.btn-action-sheet svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-green);
    transition: fill 0.25s ease, transform 0.25s ease;
}

.btn-action-sheet:hover svg {
    fill: #ffffff;
    transform: scale(1.1);
}
/* =========================================================
   MOBIL ÉS TABLET (RESZPONZÍV) MEGJELENÉS
   ========================================================= */

/* Hamburger menü ikon (Alapból rejtve van, csak mobilon látszik) */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    margin-right: 15px;
    transition: 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.05);
}

/* Sötétítő réteg a menü mögé mobilon */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 9998;
}

.sidebar-overlay.active {
    display: block;
    animation: fadeIn 0.3s;
}

@media (max-width: 992px) {
    /* 1. Bal oldali menü becsúsztatása */
    .sidebar {
        position: fixed;
        left: -280px; /* Eltoljuk balra a képernyőn kívülre */
        top: 0;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        left: 0; /* Gombnyomásra visszacsúszik */
    }

    /* 2. Felső sáv (Header) átrendezése */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        padding: 15px; /* Kisebb belső margók telefonon */
    }

    .top-header {
        flex-wrap: wrap; /* Engedjük, hogy 2 sorba törjön */
        margin-bottom: 20px;
        gap: 15px;
    }

    .search-bar-container {
        display: none; /* Üres helyfoglalót eltüntetjük */
    }

    .search-bar {
        order: 3; /* A kereső sáv ugorjon a legalsó sorba */
        flex: 100%;
        max-width: 100%;
    }

    .search-bar form {
        max-width: 100% !important;
    }

    .profile-container {
        flex: 1;
        justify-content: flex-end;
    }

    /* 3. Kártyák és Rácsok egymás alá rendezése */
    .dashboard-cards {
        grid-template-columns: 1fr; /* 1 oszlopos kártyák */
    }

    .ticket-layout, .details-grid, .form-grid, .budget-dashboard, .flex-row, .settings-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .ticket-filters, .details-wrapper, .stat-card, .settings-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important; /* Kicsit kevesebb belső tér mobilon */
    }

    /* 4. Fülek (Tabs) és Modális ablakok */
    .tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-btn {
        flex: 1 1 100%; /* Minden gomb külön sorba */
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-content {
        width: 95% !important;
        max-width: 100% !important;
        padding: 20px;
        margin: 10px auto;
        max-height: 90vh; /* Ne lógjon ki a képernyőből */
        overflow-y: auto; /* Ha túl hosszú az űrlap, belül lehessen görgetni */
    }

    /* 5. Táblázatok finomhangolása */
    .data-table th, .data-table td, .sub-table th, .sub-table td {
        padding: 10px 8px; /* Tömörebb táblázat */
        font-size: 0.85em; /* Kisebb betűk */
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .budget-chart-wrapper {
        width: 180px;
        height: 180px;
    }
}
