/* ============================================
   Global brand token
   ============================================ */
:root {
    --primary: #e78f08;
}

/* ============================================
   Page headers
   ============================================ */

/* Oldalcím (h1) */
.fi-header-heading {
    color: #e78f08 !important;
}

/* Topbar – vékony accent csík alul */
.fi-topbar {
    border-bottom: 2px solid rgba(231, 143, 8, 0.18) !important;
}

/* Section / card csoport fejlécek (form szekciók, table above-content) */
.fi-section-header-heading {
    color: #b87400 !important;
    border-left: 3px solid #e78f08 !important;
    padding-left: 0.5rem !important;
}

/* ============================================
   CRM Sidebar – Custom Design
   ============================================ */

/* Sidebar alap – finoman elválasztott háttér */
.fi-sidebar {
    background: linear-gradient(160deg, #f8f9fb 0%, #f1f3f7 100%) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.07) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04) !important;
}

/* Nav terület – kevesebb padding felül/alul */
.fi-sidebar-nav {
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Csoportok közt: tömörebb rés + vizuális elválasztó */
.fi-sidebar-nav-groups {
    gap: 0.25rem !important;
    margin: 0 !important;
}

.fi-sidebar-group {
    gap: 0.125rem !important;
}

/* Szeparátor csoportok közt */
.fi-sidebar-group + .fi-sidebar-group {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Csoportnév – uppercase + tracked betűk */
.fi-sidebar-group-btn {
    padding: 0.25rem 0.5rem 0.375rem !important;
    cursor: default;
}

.fi-sidebar-group-label {
    text-transform: uppercase !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.1em !important;
    font-weight: 700 !important;
    color: #a3aabf !important;
}

/* Csoporton belüli itemek */
.fi-sidebar-group-items {
    gap: 0.1rem !important;
}

/* Nav item alap */
.fi-sidebar-item-btn {
    padding: 0.45rem 0.6rem !important;
    border-radius: 0.45rem !important;
    transition: background-color 0.12s ease, transform 0.08s ease !important;
}

.fi-sidebar-item-label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
}

.fi-sidebar-item-btn > .fi-icon {
    color: #9ca3af !important;
    flex-shrink: 0;
}

/* Hover */
.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover .fi-icon {
    color: #6b7280 !important;
}

/* Aktív item – bal oldali accent sáv */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: rgba(231, 143, 8, 0.1) !important;
    box-shadow: inset 3px 0 0 #e78f08 !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: #92400e !important;
    font-weight: 600 !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-icon {
    color: #e78f08 !important;
}

/* Collapse gomb a csoportfejléc mellé */
.fi-sidebar-group-collapse-btn {
    opacity: 0.4;
    scale: 0.85;
}

.fi-sidebar-group:hover .fi-sidebar-group-collapse-btn {
    opacity: 0.7;
}

/* Logo terület */
.fi-sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 0.25rem;
}

/* Footer szeparátor */
.fi-sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    margin: 0 0.25rem 0.5rem !important;
    padding-top: 0.5rem;
}

/* Dark mode kiegészítések */
.dark .fi-sidebar {
    background: linear-gradient(160deg, #1a1d23 0%, #141720 100%) !important;
    border-right-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2) !important;
}

.dark .fi-sidebar-group + .fi-sidebar-group {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.dark .fi-sidebar-group-label {
    color: #4b5563 !important;
}

.dark .fi-sidebar-item-label {
    color: #d1d5db !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background-color: rgba(231, 143, 8, 0.15) !important;
    box-shadow: inset 3px 0 0 #e78f08 !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label {
    color: #f5b730 !important;
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-icon {
    color: #e78f08 !important;
}

.dark .fi-sidebar-header {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.dark .fi-sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

/* TinyMCE modal z-index fix — dropdownok, dialógok megjelennek modal felett */
.tox-tinymce-aux {
    z-index: 99999 !important;
}

/* x-cloak helper (globálisan szükséges az Alpine-hoz) */
[x-cloak] { display: none !important; }

/* ============================================
   Globális scroll-to-top gomb
   ============================================ */

.crm-scroll-top-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}

.crm-scroll-top-btn:hover  { opacity: 0.85; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); transform: translateY(-1px); }
.crm-scroll-top-btn:active { transform: translateY(0); }

.crm-scroll-top-btn svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

/* ============================================
   Topbar user menu – monogram + név + nyíl
   ============================================ */

.crm-user-menu-trigger-topbar {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.5rem !important;
    transition: background-color 0.12s ease !important;
}

.crm-user-menu-trigger-topbar:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.crm-user-menu-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-user-menu-chevron {
    width: 0.875rem;
    height: 0.875rem;
    color: #9ca3af;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .crm-user-menu-name {
        display: none;
    }
}
