/* Első lépésként beemeljük az Inter / Montserrat betűtípust */
@import url("../fonts/montserrat/montserrat.css");

/* ==========================================
   GLOBÁLIS MODERNEBB ALAPOK (Fuchs-Office)
   ========================================== */
:root {
    --font-main: "Montserrat", sans-serif;
    
    --color-primary: #005cb2;
    --color-primary-hover: #1d4ed8;
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-bg-main: #f8fafc;
    --color-text-dark: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
}

/* ==========================================
   LAYOUT STRUCTURE (Sidebar & Sticky Footer Fix)
   ========================================== */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-main);
    color: var(--color-text-dark);
}

/* 1. Az app-wrapper kifeszül a teljes magasságra */
.app-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
}

/* 2. A jobb oldali oszlop (Header -> Content -> Footer) */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px 24px 0 24px;
    box-sizing: border-box;
    min-width: 0; /* Megakadályozza a táblázatok túlfolyását */
}

/* 3. Fejléc konténer elrendezése */
.tenant-top-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

/* 4. A tartalom kitölti a fennmaradó helyet (letolja a footert) */
.content-body {
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 24px;
}

/* 5. Sticky Footer az alján */
.main-footer {
    flex-shrink: 0;
    background-color: #ffffff;
    border-top: 1px solid var(--color-border);
    padding: 15px 24px;
    font-size: 13px;
    color: var(--color-text-muted);
    box-sizing: border-box;
    margin-left: -24px;
    margin-right: -24px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-right a {
    color: var(--color-text-muted);
    text-decoration: none;
    margin-left: 15px;
}

.footer-right a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.badge-version {
    background-color: #f1f5f9;
    color: var(--color-text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   TENANT SIDEBAR (Bal oldali navigáció)
   ========================================== */
.tenant-sidebar {
    width: 260px;
    background-color: #1e293b;
    color: #f8fafc;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: stretch; 
    padding: 20px 0;
    box-sizing: border-box;
}

.tenant-sidebar .top-section {
    padding: 0 15px;
}

.tenant-sidebar h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    padding: 0 10px;
}

.tenant-badge {
    display: inline-block;
    font-size: 11px;
    background-color: #334155;
    color: #cbd5e1;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 0 10px 20px 10px;
}

/* Navigáció linkjei */
.tenant-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tenant-nav a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tenant-nav a:hover {
    background-color: #334155;
    color: #ffffff;
}

.tenant-nav a.active {
    background-color: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
}

/* Alsó felhasználói blokk */
.tenant-sidebar .user-box {
    padding: 15px;
    border-top: 1px solid #334155;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tenant-sidebar .user-email {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.btn-logout {
    display: inline-block;
    text-align: center;
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
}

/* Címsorok a sidebarban */
.tenant-nav .nav-section-title {
    margin: 18px 0 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 700;
}

/* Superadmin egyedi stílusok */
.superadmin-title {
    color: #ef4444 !important;
    margin-bottom: 4px !important;
}

.badge-superadmin {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.superadmin-theme .tenant-nav a.active {
    background-color: #dc2626;
    color: #ffffff;
}

/* ==========================================
   TENANT TOP HEADER STÍLUSOK
   ========================================== */

/* Superadmin megszemélyesítő (impersonate) sáv */
.superadmin-impersonate-bar {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.superadmin-impersonate-bar strong {
    color: #7f1d1d;
    font-weight: 700;
}

.superadmin-impersonate-bar a {
    background-color: #dc2626;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.superadmin-impersonate-bar a:hover {
    background-color: #b91c1c;
}

/* Tenant oldali Nyelvválasztó gombok */
.tenant-lang-switcher {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.tenant-lang-switcher a {
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    background-color: #ffffff;
    color: var(--color-text-muted, #64748b);
    border: 1px solid var(--color-border, #e2e8f0);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tenant-lang-switcher a:hover {
    color: var(--color-text-dark, #0f172a);
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.tenant-lang-switcher a.active {
    background-color: var(--color-primary, #2563eb);
    color: #ffffff;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
}

/* ==========================================
   ÚJRAFELHASZNÁLHATÓ KOMPONENSEK
   ========================================== */

/* Egységes gomb alapok */
.btn {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn:active {
    transform: scale(0.99);
}

/* Kártyák / Konténerek */
.card, .admin-card {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Űrlapok */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-sizing: border-box;
    font-family: var(--font-main);
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* Sidebar Kedvencek Blokkszerkezet */
.sidebar-bookmarks-section {
    margin-top: 20px;
    padding: 12px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.btn-add-bookmark {
    background: transparent;
    border: none;
    color: #3b82f6;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.btn-add-bookmark:hover { color: #60a5fa; }

.sidebar-bookmarks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 220px; /* Görgethetőség ha sok a link */
    overflow-y: auto;
}

.bookmark-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bookmark-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.88rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-grow: 1;
}
.bookmark-link:hover { color: #ffffff; }

.bookmark-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete-bookmark {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.bookmark-item:hover .btn-delete-bookmark {
    opacity: 1;
}

.bookmark-empty {
    color: #64748b;
    font-size: 0.8rem;
    font-style: italic;
    padding: 4px 8px;
}

/* Modal Stílusok */
.bm-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
}
.bm-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 380px;
    padding: 20px;
    color: #333;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.bm-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.bm-modal-header h5 { margin: 0; font-size: 1.1rem; color: #1e293b; }
.bm-modal-close { cursor: pointer; font-size: 1.4rem; color: #888; }
.bm-form-group { margin-bottom: 12px; }
.bm-form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: #475569; }
.bm-control { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }
.bm-checkbox-group label { font-weight: normal; font-size: 0.85rem; cursor: pointer; color: #334155; }
.bm-modal-footer { text-align: right; margin-top: 15px; }