:root {
    --primary-color: #1565c0;
    --primary-light: #1e88e5;
    --primary-dark: #0d47a1;
    --accent-color: #10b981;
    --accent-hover: #059669;
    --bg-light: #f4f6f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --header-bg: var(--primary-color);
    --header-text: #ffffff;
}

[data-bs-theme="dark"] {
    /* Material 3 Dark Theme Tokens */
    --primary-color: #A8C7FA;
    --primary-light: #D3E3FD;
    --primary-dark: #0842A0;
    --accent-color: #6DD58C;
    --bg-light: #141218;         /* M3 Surface */
    --bg-card: #1D1B20;          /* M3 Surface Container */
    --border-color: #44474E;     /* M3 Outline */
    --border-hover: #8E9099;     /* M3 Outline Variant */
    --text-primary: #E3E2E6;     /* M3 On-Surface */
    --text-secondary: #C4C6D0;   /* M3 On-Surface Variant */
    --text-muted: #8E9099;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.8);
    --header-bg: #1D1B20;        /* Surface Container for Header */
    --header-text: #E3E2E6;
}

/* Bootstrap Overrides for Dark Mode */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bg-card) !important;
}

[data-bs-theme="dark"] .btn-light {
    background-color: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-bs-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .text-primary {
    color: var(--primary-color) !important;
}

[data-bs-theme="dark"] .bg-primary {
    background-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

[data-bs-theme="dark"] [style*="background-color: #0d47a1"] {
    background-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

[data-bs-theme="dark"] .add-ticket-btn {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

/* Custom Backgrounds for Layouts and Banners */
.login-layout-bg {
    background: linear-gradient(135deg, #e0e7ff 0%, #f4f6f9 100%);
}

.hero-banner {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

[data-bs-theme="dark"] .login-layout-bg {
    background: var(--bg-light); /* Üres/Login layout sötétben az alap sötét háttér */
}

[data-bs-theme="dark"] .hero-banner {
    background: var(--bg-card); /* Főoldali banner sötétben a kártya háttér */
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, .brand-title {
    font-family: 'Outfit', 'Inter', sans-serif;
}

a {
    color: #1565c0;
    text-decoration: none;
}

a:hover {
    color: #0d47a1;
}

.nav-link {
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.extra-small {
    font-size: 0.75rem;
}

/* Material Design 3 Card */
.material-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.material-card:hover {
    box-shadow: var(--shadow-lg);
}

/* App Layout & Header */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 70px;
}

@media (min-width: 768px) {
    .app-layout {
        padding-bottom: 0;
    }
}

.app-header {
    background: var(--header-bg);
    color: var(--header-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
}

.app-body {
    display: flex;
    flex: 1;
    position: relative;
}

/* Drawer Menu (MobileSuerfacePlan.png) */
.app-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1050;
    transition: left 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.app-drawer.open {
    left: 0;
}

@media (min-width: 992px) {
    .app-drawer {
        position: sticky;
        top: 80px;
        left: 0 !important;
        height: calc(100vh - 80px);
        z-index: 900;
        box-shadow: none !important;
    }
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
}

.drawer-header {
    background: var(--header-bg);
    color: var(--header-text);
}

.app-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Mobile Bottom Navigation Bar (MobileSuerfacePlan.png) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1020;
    padding: 0 4px;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
    padding: 6px 0;
    transition: color 0.15s ease;
}

.mobile-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: #1565c0;
    font-weight: 600;
}

/* Material 3 Status Pills (MobileSuerfacePlan.png) */
.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill.aktiv {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.status-pill.karbantartas {
    background: #fef7e0;
    color: #b06000;
    border: 1px solid #feefc3;
}

.status-pill.hiba {
    background-color: #fce8e6;
    color: #c5221f;
    border-color: #fad2cf;
}
.status-pill.inaktiv {
    background-color: #f1f3f4;
    color: #5f6368;
    border-color: #dadce0;
}

[data-bs-theme="dark"] .status-pill.aktiv {
    background: rgba(25, 135, 84, 0.15);
    color: #47b274;
    border-color: rgba(25, 135, 84, 0.3);
}

[data-bs-theme="dark"] .status-pill.karbantartas {
    background: rgba(255, 193, 7, 0.15);
    color: #ffca2c;
    border-color: rgba(255, 193, 7, 0.3);
}

[data-bs-theme="dark"] .status-pill.hiba {
    background-color: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.2);
}
[data-bs-theme="dark"] .status-pill.inaktiv {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e8eaed;
    border-color: rgba(255, 255, 255, 0.2);
}

.cursor-pointer {
    cursor: pointer;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-pill.aktiv .pulse-dot { background-color: #137333; }
.status-pill.karbantartas .pulse-dot { background-color: #b06000; }
.status-pill.hiba .pulse-dot { background-color: #c5221f; }
.status-pill.inaktiv .pulse-dot { background-color: #5f6368; }

/* Quick Access Cards Grid */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 576px) {
    .quick-access-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }
}

.quick-access-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 0.5rem;
    text-align: center;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-access-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: #0d47a1;
}

.quick-access-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Material Form Controls */
.form-control-material {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.form-control-material:focus {
    background: var(--bg-card);
    border-color: var(--primary-light);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.btn-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-header-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Active Nav Link Styling */
.nav-link.active {
    background-color: rgba(13, 71, 161, 0.1);
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color);
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

[data-bs-theme="dark"] .nav-link.active {
    background-color: rgba(144, 202, 249, 0.15);
}