/**
 * Layout Styles for Rentivo Application
 * Shared styles for app-layout component
 */

/* Critical: prevent content flash before layout hydrates */
app-layout:not(.hydrated) > * { display: none !important; }
.main-wrapper { opacity: 0; visibility: hidden; }
body.content-ready .main-wrapper { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #0C314A;
    background-color: #FBFBFB;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .sidebar {
    background: #2d2d2d;
    border-right-color: #404040;
}

body.dark-mode .org-switcher-section {
    background: #2d2d2d;
    border-bottom-color: #404040;
}

body.dark-mode .org-selected {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #505050;
}

body.dark-mode .org-selected:hover {
    background: #404040;
}

body.dark-mode .org-dropdown {
    background: #3a3a3a;
    border-color: #505050;
}

body.dark-mode .org-option {
    color: #e0e0e0;
}

body.dark-mode .org-option:hover {
    background: #454545;
}

body.dark-mode .org-option.active {
    background: #2d4a4a;
    border-color: #0EBFC1;
}

body.dark-mode .org-option .role-badge {
    color: #e0e0e0;
    background: #2d4a4a;
    border-color: #0EBFC1;
}

body.dark-mode .org-selected .role-badge {
    color: #e0e0e0;
    background: #2d4a4a;
    border-color: #0EBFC1;
}

body.dark-mode .logo-section {
    border-bottom-color: #404040;
}

/* Skrýt/zobrazit správné logo pro light/dark mode */
.brand-logo-light {
    display: block !important;
}

.brand-logo-dark {
    display: none !important;
}

body.dark-mode .brand-logo-light {
    display: none !important;
}

body.dark-mode .brand-logo-dark {
    display: block !important;
}

.mobile-logo-light {
    display: block !important;
}

.mobile-logo-dark {
    display: none !important;
}

body.dark-mode .mobile-logo-light {
    display: none !important;
}

body.dark-mode .mobile-logo-dark {
    display: block !important;
}

body.dark-mode .nav-item {
    color: #e0e0e0;
}

body.dark-mode .nav-item:hover {
    background: #3a3a3a;
    color: #0EBFC1;
}

body.dark-mode .nav-item.active {
    background: #2d4a4a;
    color: #0EBFC1;
}

body.dark-mode .nav-submenu {
    background: #252525;
}

body.dark-mode .nav-subitem {
    color: #b0b0b0;
}

body.dark-mode .nav-subitem:hover {
    background: #3a3a3a;
    color: #0EBFC1;
}

body.dark-mode .nav-subitem.active {
    background: #2d4a4a;
    color: #0EBFC1;
}

body.dark-mode .main-content {
    background-color: #1a1a1a;
}

body.dark-mode .page-title {
    color: #e0e0e0;
}

body.dark-mode .page-subtitle {
    color: #b0b0b0;
}

/* Generic dark-mode surfaces */
body.dark-mode .card {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tab controls (shared across detail pages) */
body.dark-mode .tab-buttons {
    background: #252525;
    border-bottom-color: #404040;
}

body.dark-mode .tab-button {
    color: #b0b0b0;
}

body.dark-mode .tab-button:hover {
    background: #333333;
    color: #e0e0e0;
}

body.dark-mode .tab-button.active {
    background: #2d2d2d;
    color: #8aa4ff; /* keep highlight readable */
}

/* Tables */
body.dark-mode table {
    background: transparent;
}

body.dark-mode th {
    background: #2d2d2d !important; /* override inline light headers */
    color: #e0e0e0 !important;
    border-bottom-color: #404040 !important;
}

body.dark-mode td {
    color: #e0e0e0 !important; /* some cells set inline gray text */
    border-bottom-color: #404040 !important; /* override inline borders from modules */
}

/* Inputs and form controls */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1f1f1f;
    color: #e0e0e0;
    border-color: #404040;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #888888;
}

/* Alerts (generic) */
body.dark-mode .alert {
    background: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Notification popovers */
body.dark-mode .notification {
    background: #2d2d2d;
    border-color: #404040;
}
body.dark-mode .notification-title {
    color: #e0e0e0;
}
body.dark-mode .notification-message {
    color: #b0b0b0;
}

/* Generic confirmation dialogs */
body.dark-mode .confirmation-dialog,
body.dark-mode .lease-confirmation-dialog {
    background: #2d2d2d;
    border: 1px solid #404040;
}

body.dark-mode .header-user-info {
    background: rgba(45, 45, 45, 0.95);
    border-color: #505050;
}

body.dark-mode .user-expanded {
    background: rgba(45, 45, 45, 0.98);
    border-color: #505050;
}

body.dark-mode .user-name,
body.dark-mode .user-initials {
    color: #e0e0e0;
}

body.dark-mode .theme-switcher {
    background: rgba(45, 45, 45, 0.95);
    border-color: #505050;
}

body.dark-mode .mobile-header {
    background: #2d2d2d;
    border-bottom-color: #404040;
}

body.dark-mode .mobile-user-profile {
    background: #252525;
    border-bottom-color: #404040;
}

body.dark-mode .mobile-user-name {
    color: #e0e0e0;
}

body.dark-mode .mobile-user-email {
    color: #b0b0b0;
}

body.dark-mode .mobile-controls .theme-switcher {
    background: rgba(45, 45, 45, 0.95);
    border-color: #505050;
}

body.dark-mode .mobile-theme-toggle .theme-switcher-slider {
    background: linear-gradient(135deg, #0EBFC1 0%, #505050 100%);
}

body.dark-mode .notification-icon-container {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .notification-icon-container:hover {
    background: #3a3a3a;
    border-color: #0EBFC1;
}

body.dark-mode .notification-dropdown {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .notification-dropdown-header {
    background: #252525;
    border-bottom-color: #404040;
}

body.dark-mode .notification-dropdown-header h3 {
    color: #e0e0e0;
}

body.dark-mode .notification-item {
    border-bottom-color: #404040;
}

body.dark-mode .notification-item:hover {
    background: #3a3a3a;
}

body.dark-mode .notification-item.unread {
    background: #2d4a4a;
}

body.dark-mode .notification-title {
    color: #e0e0e0;
}

body.dark-mode .notification-message {
    color: #b0b0b0;
}

body.dark-mode .notification-dropdown-footer {
    background: #252525;
    border-top-color: #404040;
}

body.dark-mode .app-footer {
    background: #2d2d2d;
    border-top-color: #404040;
}

body.dark-mode .footer-section h4 {
    color: #e0e0e0;
}

body.dark-mode .footer-link {
    color: #b0b0b0;
}

body.dark-mode .footer-link:hover {
    color: #0EBFC1;
}

body.dark-mode .footer-text {
    color: #b0b0b0;
}

body.dark-mode .footer-bottom {
    border-top-color: #404040;
    color: #b0b0b0;
}

body.dark-mode .footer-modal {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .footer-modal-header {
    background: #252525;
    border-bottom-color: #404040;
}

body.dark-mode .footer-modal-header h3 {
    color: #e0e0e0;
}

body.dark-mode .footer-modal-close {
    color: #b0b0b0;
}

body.dark-mode .footer-form label,
body.dark-mode .cookie-title {
    color: #e0e0e0;
}

body.dark-mode .footer-form input,
body.dark-mode .footer-form textarea,
body.dark-mode .footer-form select {
    background: #252525;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .footer-help-text,
body.dark-mode .cookie-desc {
    color: #b0b0b0;
}

body.dark-mode .cookie-row {
    border-bottom-color: #404040;
}

body.dark-mode .cookie-pill {
    background: #3a3a3a;
    color: #e0e0e0;
}

/* Detail pages: fix light utility surfaces */
body.dark-mode .back-button {
    background: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .back-button:hover {
    background: #333333 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .click-card {
    background: #2d2d2d !important;
    border-color: #404040 !important;
}
body.dark-mode .click-card:hover {
    border-color: #0EBFC1 !important;
    box-shadow: 0 2px 8px rgba(14, 191, 193, 0.15);
}

/* Documents module (templates and detail pages) */
/* Upload modal panel */
body.dark-mode #docMultiOverlay > div {
    background: #2d2d2d !important;
    color: #e0e0e0;
}
/* Modal header and footer bars */
body.dark-mode #docMultiOverlay > div > div:first-child {
    background: #252525 !important;
    border-bottom-color: #404040 !important;
}
body.dark-mode #docMultiOverlay > div > div:last-child {
    background: #252525 !important;
    border-top-color: #404040 !important;
}
body.dark-mode #docMultiCloseBtn { color: #b0b0b0; }

/* Drag & drop area */
body.dark-mode #dropArea {
    background: #2a2a2a !important;
    color: #b0b0b0;
}

/* Documents tables inside module */
body.dark-mode #docsList thead tr,
body.dark-mode #uploadQueue thead tr {
    background: #2d2d2d !important;
}

/* Attribute-level fallbacks for inline-styled light boxes on detail pages */
body.dark-mode .main-content [style*="background:#fff"],
body.dark-mode .main-content [style*="background: #fff"] {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}
body.dark-mode .main-content [style*="background:#f8f9fa"],
body.dark-mode .main-content [style*="background: #f8f9fa"] {
    background: #252525 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .main-content [style*="border:1px solid #e9ecef"],
body.dark-mode .main-content [style*="border: 1px solid #e9ecef"] {
    border-color: #404040 !important;
}

/* Main Layout */
.app-container {
    display: flex;
    flex-direction: row;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* No min-height here - let content determine total height */
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #EBF2F2;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Sidebar is always full height */
}

/* Organization switcher block in sidebar */
.org-switcher-section {
    padding: 0.75rem 1rem 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #EBF2F2;
}

#org-select { 
    display: none; 
}

.org-custom-select {
    position: relative;
    width: 100%;
    user-select: none;
}

.org-selected {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0C314A;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.org-selected:hover { 
    background: #fdfdfd; 
}

.org-selected:focus,
.org-custom-select[aria-expanded="true"] .org-selected {
    border-color: #0EBFC1;
    box-shadow: 0 0 0 3px rgba(14, 191, 193, 0.15);
}

.org-selected::after {
    content: '▾';
    color: #597586;
    font-size: 0.9rem;
    margin-left: 8px;
}

.org-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(12, 49, 74, 0.08);
    z-index: 2000;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    display: none;
}

.org-custom-select[aria-expanded="true"] .org-dropdown { 
    display: block; 
}

.org-option {
    padding: 10px 10px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #0C314A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.org-option:hover { 
    background: #F5FBFB; 
}

.org-option.active {
    background: #E8F6F6;
    border: 1px solid #CDEEEE;
}

.org-option .role-badge {
    font-size: 0.75rem;
    color: #0C314A;
    background: #E6F2F3;
    border: 1px solid #CDEEEE;
    border-radius: 999px;
    padding: 2px 8px;
    margin-left: 10px;
}

.org-selected {
    display: flex;
    align-items: center;
    gap: 8px;
}

.org-selected .org-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-selected .role-badge {
    font-size: 0.75rem;
    color: #0C314A;
    background: #E6F2F3;
    border: 1px solid #CDEEEE;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Logo Section */
.logo-section {
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    width: 100%;
    height: auto;
    max-width: 200px;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

/* Logo click animation */
.brand-logo {
    will-change: transform, filter;
    transform-origin: center;
}

.brand-logo.logo-animate {
    animation: logoSpinPop 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes logoSpinPop {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 0 rgba(14, 191, 193, 0));
    }
    20% {
        transform: scale(1.08) rotate(8deg);
        filter: drop-shadow(0 0 10px rgba(14, 191, 193, 0.35));
    }
    60% {
        transform: scale(1.02) rotate(360deg);
        filter: drop-shadow(0 0 16px rgba(14, 191, 193, 0.5));
    }
    100% {
        transform: scale(1) rotate(360deg);
        filter: drop-shadow(0 0 0 rgba(14, 191, 193, 0));
    }
}

/* Mobile User Profile */
.mobile-user-profile {
    display: none;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-user-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0EBFC1;
    background: rgba(14, 191, 193, 0.1);
    border-radius: 50%;
    padding: 8px;
}

.mobile-user-details {
    flex: 1;
    min-width: 0;
}

.mobile-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #0C314A;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-email {
    font-size: 14px;
    color: #718096;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-logout-btn {
    background: none;
    border: 1px solid rgba(14, 191, 193, 0.3);
    color: #718096;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logout-btn:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: scale(1.05);
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 0;
    margin-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #0C314A;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    cursor: pointer;
}

.nav-item:hover {
    background: #f5f5f5;
    color: #0EBFC1;
}

.nav-item.active {
    background: #E9EBF8;
    color: #0EBFC1;
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #0EBFC1;
}

.nav-icon {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Submenu */
.nav-submenu {
    display: none;
    background: #fafafa;
}

.nav-submenu.show {
    display: block;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem 0.65rem 3.5rem;
    color: #0C314A;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    cursor: pointer;
}

.nav-subitem:hover {
    background: #f0f0f0;
    color: #0EBFC1;
}

.nav-subitem.active {
    background: #E9EBF8;
    color: #0EBFC1;
    font-weight: 500;
}

.nav-expand {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-expand.expanded {
    transform: rotate(90deg);
}

/* Main Content Area */
.main-content {
    flex: 1 0 auto; /* Grow to fill space, don't shrink, auto basis */
    padding: 2rem;
    overflow-y: auto;
    min-height: 100vh; /* Content is always at least full viewport height */
}

/* Page Header with User Info */
.page-header-with-user {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 0;
    gap: 1.5rem;
}

/* Ensure the controls group sits completely at the right edge */
.page-header-with-user .header-controls {
    margin-left: auto;
}

.page-header-left {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.page-title-section {
    flex: 1;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #0C314A;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #0C314A;
    font-size: 0.95rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
}

/* Two-row header controls when action buttons are supplied */
.header-controls.has-header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    row-gap: 0.75rem;
}
.header-controls.has-header-actions .header-actions-wrapper {
    flex-basis: 100%; /* force second row */
    display: flex;
    justify-content: flex-end;
    margin-top: 2.5rem; /* increased spacing below icon row */
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 191, 193, 0.25);
}

.theme-switcher-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0EBFC1 0%, #0C314A 100%);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.theme-switcher[data-theme="dark"] .theme-switcher-slider {
    transform: translateX(30px);
}

/* Mobile theme switcher - centered icon without animation */
.mobile-theme-toggle .theme-switcher-slider {
    position: static;
    width: 24px;
    height: 24px;
    transform: none !important;
}

/* Notification Icon */
.notification-icon-container {
    position: relative;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c314a;
    z-index: 100;
}

.notification-icon-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 191, 193, 0.25);
    background: rgba(14, 191, 193, 0.05);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-badge:empty {
    display: none;
}

/* Notification Dropdown */
.notification-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.notification-dropdown-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0C314A;
}

.notification-dropdown-header .mark-all-read {
    font-size: 0.85rem;
    color: #0EBFC1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-dropdown-header .mark-all-read:hover {
    background: rgba(14, 191, 193, 0.1);
}

.notification-dropdown-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 0.75rem;
    position: relative;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0f9ff;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #0EBFC1;
    border-radius: 0 4px 4px 0;
}

.notification-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.notification-icon-circle.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon-circle.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-icon-circle.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon-circle.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: #0C314A;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-message {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.notification-dropdown-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    text-align: center;
}

.notification-dropdown-footer a {
    color: #0EBFC1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-dropdown-footer a:hover {
    background: rgba(14, 191, 193, 0.1);
}

.notification-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #9ca3af;
}

.notification-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* User Profile */
.header-user-info {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    overflow: visible;
    width: auto;
    min-width: 80px;
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.user-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    opacity: 1;
    transform: scale(1);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.user-expanded {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 6px 20px rgba(14, 191, 193, 0.25);
    white-space: nowrap;
    width: auto;
    min-width: 200px;
    z-index: 1006;
    transform: translateY(-50%) scale(0.85);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.header-user-info:hover .user-compact {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    display: none;
}

.header-user-info:hover .user-expanded {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.header-user-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 191, 193, 0.3);
    background: transparent;
    border-color: transparent;
    z-index: 1005;
}

.user-avatar-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c314a;
    background: rgba(14, 191, 193, 0.1);
    border-radius: 8px;
    padding: 6px;
}

.user-avatar-icon svg {
    width: 18px;
    height: 18px;
}

.user-initials {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    white-space: nowrap;
    line-height: 1.3;
    opacity: 1;
    transition: all 0.3s ease;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(14, 191, 193, 0.3);
    color: #718096;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: scale(1.05);
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.app-footer {
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 2rem 2rem 1rem 2rem;
    /* Removed margin-top: auto - footer comes after content naturally */
    flex-shrink: 0; /* Never shrink */
    width: 100%;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0C314A;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-link:hover {
    color: #0EBFC1;
}

.footer-text {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Footer modals */
.footer-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 49, 74, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
}

.footer-modal-overlay.active {
    display: flex;
}

.footer-modal {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.footer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.footer-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0C314A;
}

.footer-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #6c757d;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-modal-body {
    padding: 1.25rem;
    max-height: 70vh;
    overflow: auto;
}

.footer-form .form-group {
    margin-bottom: 1rem;
}

.footer-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #0C314A;
}

.footer-form input,
.footer-form textarea,
.footer-form select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Raleway', sans-serif;
    transition: border-color 0.2s ease;
}

.footer-form input:focus,
.footer-form textarea:focus,
.footer-form select:focus {
    outline: none;
    border-color: #0EBFC1;
}

.footer-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.footer-help-text {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .footer-modal {
        max-width: 90%;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }
    .footer-modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

.cookie-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.cookie-row:last-of-type {
    border-bottom: none;
}

.cookie-row input {
    width: 44px;
    height: 22px;
    accent-color: #0EBFC1;
}

.cookie-title {
    font-weight: 600;
    color: #0C314A;
}

.cookie-desc {
    font-size: 0.85rem;
    color: #6c757d;
}

.cookie-pill {
    background: #e9ecef;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #495057;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #EBF2F2;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1002;
    padding: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    height: 80px;
    width: auto;
    padding: 0.75rem 0 0.5rem 0;
}

.mobile-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    background: #0EBFC1;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.mobile-theme-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: #0C314A;
    transform: scale(1.05);
}

.mobile-menu-toggle.active {
    background: #0C314A;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
    display: block;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .page-header-with-user {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        margin-bottom: 0.3rem;
    }
    
    .header-controls {
        margin-left: 0;
        justify-content: center;
    }
    
    .header-user-info {
        padding: 8px 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .app-footer {
        padding: 1.5rem 1rem 1rem 1rem;
    }
}

@media (max-width: 640px) {
    /* Hide desktop user profile on mobile */
    .header-user-info {
        display: none !important;
    }
    
    /* Hide desktop theme switcher on mobile */
    .header-controls .theme-switcher:not(.mobile-theme-toggle) {
        display: none !important;
    }
    
    /* Hide notification icon on mobile */
    .notification-icon-container {
        display: none;
    }
    
    /* Show mobile user profile in sidebar */
    .mobile-user-profile {
        display: block;
    }
    
    /* Show mobile menu toggle and header */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    /* Transform sidebar to slide-out menu */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: -100%;
        width: 280px;
        height: auto;
        z-index: 1004;
        border-right: none;
        border-left: 1px solid #e0e0e0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
    }
    
    .sidebar.mobile-open {
        right: 0;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: column;
        padding: 1rem 0;
        overflow-x: visible;
    }
    
    .nav-item {
        white-space: normal;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-submenu {
        display: none;
        background: #f8f9fa;
        margin: 0;
    }
    
    .nav-submenu.show {
        display: block;
    }
    
    .nav-subitem {
        padding: 0.75rem 1.5rem 0.75rem 3rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* Add padding to main content to account for mobile header */
    .main-content {
        padding: 6rem 1rem 1rem 1rem;
    }
    
    /* Dynamic viewport units support */
    @supports (height: 100dvh) {
        .sidebar {
            top: 0;
            height: 100dvh;
            bottom: auto;
        }
    }
}

/* ===========================
   Shared Button Styles
   =========================== */

/* Base button styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary button - teal outline */
.btn-primary {
    background: transparent;
    color: #0EBFC1;
    border: 1.5px solid #0EBFC1;
}

.btn-primary:hover:not(:disabled) {
    background: #0EBFC1;
    color: white;
}

/* Danger button - red outline */
.btn-danger {
    background: transparent;
    color: #dc3545;
    border: 1.5px solid #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #dc3545;
    color: white;
}

/* Secondary button - gray outline */
.btn-secondary {
    background: transparent;
    color: #6c757d;
    border: 1.5px solid #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #6c757d;
    color: white;
}

/* Success button - gradient */
.btn-success {
    background: linear-gradient(135deg, #0EBFC1 0%, #0a9799 100%);
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #0a9799 0%, #087577 100%);
}

/* Print button - icon button with gray outline */
.btn-print {
    background: transparent;
    border: 1.5px solid #6c757d;
    color: #6c757d;
    padding: 0.5rem;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-print:hover {
    background: #6c757d;
    color: white;
}

/* Small button variant */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

/* Header actions wrapper */
.header-actions-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-basis: 100%;
    margin-top: 2.5rem;
}

@media (max-width: 640px) {
    .header-actions-wrapper {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions-wrapper .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode button styles */
body.dark-mode .btn-primary {
    color: #0EBFC1;
    border-color: #0EBFC1;
}

body.dark-mode .btn-primary:hover:not(:disabled) {
    background: #0EBFC1;
    color: #1a1a1a;
}

body.dark-mode .btn-danger {
    color: #ff6b7a;
    border-color: #ff6b7a;
}

body.dark-mode .btn-danger:hover:not(:disabled) {
    background: #ff6b7a;
    color: #1a1a1a;
}

body.dark-mode .btn-secondary {
    color: #a0a0a0;
    border-color: #a0a0a0;
}

body.dark-mode .btn-secondary:hover:not(:disabled) {
    background: #a0a0a0;
    color: #1a1a1a;
}

body.dark-mode .btn-print {
    color: #a0a0a0;
    border-color: #a0a0a0;
}

body.dark-mode .btn-print:hover {
    background: #a0a0a0;
    color: #1a1a1a;
}

/* ============================================================================
   Beta Banner
   ============================================================================ */

.beta-banner {
    background: linear-gradient(135deg, #0EBFC1 0%, #0C314A 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(14, 191, 193, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.beta-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.beta-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.beta-banner-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.beta-banner-text strong {
    font-weight: 600;
}

.beta-banner-text a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.beta-banner-text a:hover {
    color: #f0f0f0;
}

.beta-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.beta-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.beta-banner-close:active {
    transform: scale(0.95);
}

/* Dark mode adjustments for beta banner */
body.dark-mode .beta-banner {
    box-shadow: 0 4px 12px rgba(14, 191, 193, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .beta-banner {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .beta-banner-content {
        gap: 0.75rem;
    }
    
    .beta-banner-icon {
        font-size: 1.25rem;
    }
    
    .beta-banner-text {
        font-size: 0.875rem;
    }
    
    .beta-banner-close {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
}
