/* Main CSS - Core styles and layout */

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

/* Global utility class */
.hidden {
    display: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    color: var(--app-primary);
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--app-primary);
    letter-spacing: 0.05em;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

.nav-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

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

.nav-btn.active {
    background-color: var(--accent-primary);
    color: white;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

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

/* Theme Toggle Icons */
[data-theme="light"] .icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sections */
.section {
    animation: fadeIn 0.3s ease;
}

.section.hidden {
    display: none;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.filter-group select:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 59, 130, 246), 0.15);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 59, 130, 246), 0.15);
}

.search-box:focus-within svg {
    color: var(--accent-primary);
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    caret-color: var(--accent-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
}

.pagination button {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--bg-hover);
}

.pagination button.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Configuration Section */
/* Override accent color to use app primary color in config section */
#config-section {
    --accent-primary: var(--app-primary);
    --accent-primary-hover: var(--app-primary-hover);
    --accent-primary-light: var(--app-primary-light);
}

.config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
}

.config-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.config-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.config-card h3 svg {
    width: 24px;
    height: 24px;
    color: var(--app-primary);
}

.config-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.config-description a {
    color: var(--app-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.config-description a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.config-description-slogan {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.5rem 0;
    font-style: italic;
}

.config-version {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

.config-version a {
    color: var(--text-muted);
    text-decoration: underline;
}

.config-version a:hover {
    color: var(--primary-color);
}

.config-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-height: 50px;
}

.config-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.config-tag-item button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.config-tag-item button:hover {
    opacity: 1;
}

.config-tag-item button svg {
    width: 14px;
    height: 14px;
}

/* Color Picker */
.color-picker-input {
    width: 50px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background-color: var(--bg-secondary);
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker-input::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Logo Preview */
.logo-preview {
    transition: border-color 0.2s ease;
}

.logo-preview:hover {
    border-color: var(--accent-primary);
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Storage Mode Styles */
.storage-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.storage-mode-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.storage-mode-badge.local {
    background: var(--color-warning-light, #fef3c7);
    color: var(--color-warning-dark, #92400e);
}

.storage-mode-badge.server {
    background: var(--color-success-light, #d1fae5);
    color: var(--color-success-dark, #065f46);
}

.storage-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#serverTestResult {
    font-size: 0.875rem;
}

#serverTestResult.success {
    color: var(--color-success, #10b981);
}

#serverTestResult.error {
    color: var(--color-danger, #ef4444);
}

/* Users Management Styles */
.config-card {
    position: relative;
}

.config-card-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.9);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-lg);
    z-index: 10;
}

.config-card-disabled-overlay.hidden {
    display: none;
}

.config-card-disabled-overlay svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.config-card-disabled-overlay p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 280px;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.user-item-info {
    flex: 1;
    min-width: 0;
}

.user-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-item-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-item-role {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.user-item-role.admin {
    background: var(--color-warning-light, #fef3c7);
    color: var(--color-warning-dark, #92400e);
}

.user-item-role.user {
    background: var(--bg-tertiary, #e5e7eb);
    color: var(--text-secondary);
}

.user-item-actions {
    display: flex;
    gap: 0.25rem;
}

.user-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.user-form .btn {
    grid-column: span 2;
}

/* Login Overlay */
/* Override accent color to use app primary color in login */
.login-overlay {
    --accent-primary: var(--app-primary);
    --accent-primary-hover: var(--app-primary-hover);
    --accent-primary-light: var(--app-primary-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-overlay.hidden {
    display: none;
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header svg {
    width: 48px;
    height: 48px;
    color: var(--app-primary);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-error {
    padding: 0.75rem;
    background: var(--color-danger-light, #fee2e2);
    color: var(--color-danger, #ef4444);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
}

.login-error.hidden {
    display: none;
}

/* Profile Menu */
.profile-menu-container {
    position: relative;
}

.profile-menu-container.hidden {
    display: none;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown.hidden {
    display: none;
}

.profile-dropdown-header {
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.profile-username {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-role {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-role.admin {
    background: var(--color-warning-light, #fef3c7);
    color: var(--color-warning-dark, #92400e);
}

.profile-role.user {
    background: var(--bg-tertiary, #e5e7eb);
    color: var(--text-secondary);
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s;
    text-align: left;
}

.profile-dropdown-item:hover {
    background: var(--bg-secondary);
}

.profile-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.profile-dropdown-item.text-danger {
    color: var(--color-danger, #ef4444);
}

.profile-dropdown-item.text-danger:hover {
    background: var(--color-danger-light, #fee2e2);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
    z-index: 1000;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    min-height: 48px;
}

.mobile-nav-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-btn span {
    font-size: 0.625rem;
    font-weight: 500;
}

.mobile-nav-btn:hover,
.mobile-nav-btn:active {
    color: var(--accent-primary);
}

.mobile-nav-btn.active {
    color: var(--accent-primary);
}

.mobile-nav-btn.active svg {
    stroke-width: 2.5;
}

/* Mobile More Menu Overlay */
.mobile-more-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-more-menu.active {
    opacity: 1;
}

.mobile-more-menu-content {
    position: absolute;
    bottom: 70px;
    left: 1rem;
    right: 1rem;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.mobile-more-menu.active .mobile-more-menu-content {
    transform: translateY(0);
}

.mobile-more-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1rem;
}

.mobile-more-item svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.mobile-more-item:hover,
.mobile-more-item:active {
    background-color: var(--bg-hover);
}

.mobile-more-item.active {
    background-color: var(--accent-primary);
    color: white;
}

.mobile-more-item.active svg {
    color: white;
}

/* Hide logo menu button and dropdown on desktop (mobile only) */
.logo-menu-btn {
    display: none;
}

.logo-menu-dropdown {
    display: none;
}

/* Desktop logo is visible by default */
.brand-icon-desktop {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .search-card,
    .preparations-card {
        grid-column: span 1;
    }
    
    .preparations-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Show mobile bottom nav */
    .mobile-bottom-nav {
        display: flex;
    }
    
    .mobile-more-menu {
        display: block;
        pointer-events: none;
    }
    
    .mobile-more-menu.active {
        pointer-events: auto;
    }
    
    /* Hide desktop nav on mobile */
    .main-nav {
        display: none;
    }
    
    /* Mobile header: single row layout */
    .main-header {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Header brand: manager switch first, then logo at right */
    .header-brand {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
        position: relative;
        justify-content: space-between;
    }
    
    /* Hide brand title and desktop logo on mobile */
    .brand-title,
    .brand-icon-desktop {
        display: none;
    }
    
    /* Manager switch comes first (left side) */
    .manager-switch {
        order: 1;
    }
    
    /* Logo menu button at right */
    .logo-menu-btn {
        order: 2;
        display: flex;
        align-items: center;
        gap: 0.125rem;
        padding: 0.25rem;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        color: var(--text-primary);
        transition: all 0.2s ease;
        position: relative;
        z-index: 100;
    }
    
    .logo-menu-btn:hover,
    .logo-menu-btn:active {
        background: var(--bg-hover);
    }
    
    .logo-menu-btn .brand-icon {
        width: 20px;
        height: 20px;
    }
    
    .logo-menu-btn .logo-chevron {
        width: 12px;
        height: 12px;
        color: var(--text-muted);
        transition: transform 0.2s ease;
    }
    
    .logo-menu-btn.active .logo-chevron {
        transform: rotate(180deg);
    }
    
    /* Logo menu dropdown - positioned below logo button */
    .logo-menu-dropdown {
        display: block;
        position: fixed;
        top: 50px;
        right: 0.5rem;
        left: auto;
        min-width: 200px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        z-index: 1001;
        overflow: hidden;
    }
    
    .logo-menu-dropdown.hidden {
        display: none !important;
    }
    
    /* Profile dropdown: fixed position on mobile for visibility */
    .profile-dropdown {
        position: fixed;
        top: 50px;
        right: 0.5rem;
        left: auto;
        z-index: 1002;
    }
    
    .logo-menu-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.75rem 1rem;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 0.875rem;
        cursor: pointer;
        transition: background-color 0.15s ease;
        text-align: left;
    }
    
    .logo-menu-item:hover {
        background: var(--bg-hover);
    }
    
    .logo-menu-item svg {
        width: 18px;
        height: 18px;
        color: var(--text-secondary);
        flex-shrink: 0;
    }
    
    /* Manager switch: inline with logo, styled pills */
    .manager-switch {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
    }
    
    .manager-switch .manager-switch-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        padding: 0.375rem 0.75rem;
        border-radius: 1.5rem;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        transition: all 0.2s ease;
        color: var(--text-secondary);
    }
    
    .manager-switch .manager-switch-btn:hover {
        background: var(--bg-hover);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
    }
    
    .manager-switch .manager-switch-btn.active {
        background: var(--accent-primary);
        border-color: var(--accent-primary);
        color: white;
    }
    
    .manager-switch .manager-switch-btn.active svg {
        color: white;
    }
    
    .manager-switch .manager-switch-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    /* Hide header actions buttons on mobile (moved to logo menu) but keep container for dropdown */
    .header-actions {
        position: absolute;
        width: 0;
        height: 0;
        overflow: visible;
        pointer-events: none;
    }
    
    .header-actions > *:not(.profile-menu-container) {
        display: none;
    }
    
    /* Profile menu container: keep visible for dropdown but hide button */
    .header-actions .profile-menu-container {
        display: block !important;
        position: static;
    }
    
    .header-actions .profile-menu-container #profileBtn {
        display: none;
    }
    
    /* Keep profile dropdown visible and clickable */
    .header-actions .profile-dropdown {
        display: block;
        pointer-events: auto;
    }
    
    .header-actions .profile-dropdown.hidden {
        display: none;
    }
    
    /* Hide fullscreen button on mobile (not useful) */
    #fullscreenBtn {
        display: none;
    }
    
    /* Reduced padding for main content on mobile */
    .main-content {
        padding: 0.75rem;
        padding-bottom: 80px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .search-box {
        max-width: 100%;
        min-width: unset;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .filter-group select {
        flex: 1;
        min-width: 0;
    }
    
    .filter-group label {
        display: none;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    /* Config page: single column, prevent overflow */
    .config-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
    }
    
    .config-card {
        padding: 1rem;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .config-card h3 {
        font-size: 1rem;
        padding-top: 2.25rem;
    }
    
    /* Config card module badge: position above title on mobile */
    .config-card-module-badge {
        position: absolute;
        top: 0.75rem;
        left: 1rem;
        right: auto;
    }
    
    /* Config tabs: scrollable on mobile */
    .config-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    
    .config-tabs .tab-btn {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Module filter: convert to select on mobile */
    .module-filter-buttons {
        display: none !important;
    }
    
    .module-filter-select {
        display: block !important;
    }
}

/* Touch Optimization */
@media (pointer: coarse) {
    .nav-btn,
    .btn,
    .action-btn {
        min-height: 48px;
    }
    
    input,
    select {
        min-height: 48px;
        font-size: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
