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

:root {
    --bg-dark-sidebar: #0b0f19;
    --bg-light-sidebar: #fcfcfc;
    --bg-main: rgb(245, 245, 245);
    --text-dark: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --bg-card: #ffffff;
    
    --accent-purple: #7c3aed;
    --accent-purple-light: #f5f3ff;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-orange: #f97316;
    --accent-blue: #60a5fa;
    
    --bg-sidebar: #FEFEFE;
    --sidebar-text: #0b0f19;
    --sidebar-text-muted: #64748b;
    --sidebar-hover: rgba(0, 0, 0, 0.05);
    --sidebar-active: rgba(0, 0, 0, 0.08);
    --sidebar-border: #e2e8f0;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --modal-overlay-bg: rgba(15, 23, 42, 0.4);
}

/* Dark Mode Overrides - Premium 'Midnight Luxe' Palette */
body.dark-mode {
    --bg-dark-sidebar: #020617; /* Deep Slate */
    --bg-light-sidebar: #09090b; /* Zinc 950 */
    --bg-main: #09090b; /* Total Black/Zinc */
    --text-dark: #fafafa;
    --text-muted: #a1a1aa;
    --text-light: #71717a;
    --border-color: #27272a; /* Zinc 800 */
    --bg-card: #121216;
    
    --accent-purple-light: rgba(124, 58, 237, 0.15);
    --accent-blue: #60a5fa;
    --modal-overlay-bg: rgba(0, 0, 0, 0.85);

    --bg-sidebar: #020617;
    --sidebar-text: #fafafa;
    --sidebar-text-muted: #71717a;
    --sidebar-hover: rgba(255, 255, 255, 0.04);
    --sidebar-active: rgba(255, 255, 255, 0.08);
    --sidebar-border: #1e293b;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="time"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"] {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    color-scheme: dark;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

* { box-sizing: border-box; }

.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* 1. App Sidebar (Combined) */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 20;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

.app-sidebar.collapsed {
    width: 76px;
    padding: 24px 10px;
}

.app-sidebar .logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-left: 8px;
}

.app-sidebar .logo {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: var(--radius-sm);
}

.app-sidebar .logo-text {
    color: var(--sidebar-text);
    font-size: 20px;
    font-weight: 800;
    margin-left: 12px;
    letter-spacing: -0.5px;
    transition: opacity 0.2s;
}

.app-sidebar.collapsed .brand-logo {
    display: none !important;
}
.app-sidebar.collapsed .mini-logo.logo-light {
    display: block !important;
}
body.dark-mode .app-sidebar.collapsed .mini-logo.logo-light {
    display: none !important;
}
body.dark-mode .app-sidebar.collapsed .mini-logo.logo-dark {
    display: block !important;
}

/* Sidebar Logo Theme Switching */
/* Light Mode (Default Sidebar) */
.app-sidebar .logo-dark { display: none; }
.app-sidebar .logo-light { display: block; }

/* Dark Mode Sidebar */
body.dark-mode .app-sidebar .logo-light { display: none; }
body.dark-mode .app-sidebar .logo-dark { display: block; }

.app-sidebar.collapsed .logo-text {
    display: none;
}


/* Kategória feliratok */
.app-sidebar .category-title {
    color: var(--sidebar-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px 0 5px 12px;
}
.app-sidebar.collapsed .category-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text-muted);
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 14.5px;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    min-width: 24px;
    font-size: 18px;
    margin-right: 12px;
    text-align: center;
    transition: margin 0.3s ease;
}

.app-sidebar.collapsed .nav-item i {
    margin-right: 0;
}

.nav-item .nav-text {
    transition: opacity 0.2s;
}

.app-sidebar.collapsed .nav-item .nav-text {
    display: none;
}

.nav-item:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text);
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 12px 0;
}

/* 3. Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    overflow-y: auto; /* Javítva: görgethető tartalom */
    transition: background-color 0.3s ease;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid var(--border-color);
}

.top-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

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

.alert-pill {
    background: var(--text-dark);
    color: var(--bg-main);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-container {
    display: flex;
    flex: 1;
    overflow: visible;
}

.data-section {
    flex: 1;
    padding: 32px 40px;
    /* overflow-y: auto; */
}


.right-panel {
    width: 360px;
    min-width: 360px;
    border-left: 1px solid var(--border-color);
    padding: 32px;
    overflow-y: auto;
    background-color: var(--bg-light-sidebar);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.list-group {
    border-top: 1px solid var(--border-color);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.list-item:hover, .list-item.selected {
    background-color: var(--accent-purple-light);
}

.floating-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-purple);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.4);
    font-size: 13px;
    font-weight: 500;
    z-index: 100;
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.floating-bar .action {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.floating-bar .action:hover {
    opacity: 1;
}

.insight-metric { margin-bottom: 40px; }
.insight-metric h3 { font-size: 15px; margin: 0 0 16px 0; font-weight: 700; color: var(--text-dark); transition: color 0.3s ease; }
.big-number { font-size: 34px; font-weight: 800; margin: 0 0 4px 0; letter-spacing: -1px; }

.progress-bar-container { margin-bottom: 14px; }
.progress-bar-container .header { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark); transition: color 0.3s ease;}
.progress-track { height: 6px; background: var(--border-color); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-pill); }

/* Help Module (Súgó) Stílusok */
.help-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.2s ease;
}
.help-section summary {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    outline: none;
    list-style: none; /* Modern browsers */
}
.help-section summary::-webkit-details-marker {
    display: none; /* Safari */
}
.help-section summary:hover {
    background: rgba(124, 58, 237, 0.05); /* Halvány lila hover */
}
.help-section[open] summary {
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-purple);
}
.help-content {
    padding: 20px 20px 20px 45px;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 14.5px;
}
.help-content ul {
    margin-left: 20px;
    margin-top: 10px;
}
.help-content li {
    margin-bottom: 8px;
}
.help-content code {
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    color: var(--accent-purple);
}

/* 4. Common Components & Standardized Headers */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 24px;
    margin-bottom: 24px;
}

.header-card {
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approver-badge {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
body.dark-mode .approver-badge { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.header-card h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.header-card .subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-card strong {
    color: var(--text-dark);
    font-weight: 700;
}

body.dark-mode .glass-card {
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content, .card.glass {
    background: var(--bg-card);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .card.glass {
    background: #18181b;
    border-color: #27272a;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* SweetAlert2 Dark Mode */
.dark-mode .swal2-popup {
    background: var(--bg-card);
    color: var(--text-dark);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.dark-mode .swal2-title,
.dark-mode .swal2-html-container,
.dark-mode .swal2-content {
    color: var(--text-dark) !important;
}
.dark-mode .swal2-footer {
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}
.dark-mode .swal2-close:hover {
    color: var(--accent-purple);
}
.dark-mode .swal2-timer-progress-bar {
    background: var(--accent-purple);
}
.dark-mode .swal2-success-circular-line-left,
.dark-mode .swal2-success-circular-line-right,
.dark-mode .swal2-success-fix {
    background-color: var(--bg-card) !important;
}
