:root {
    color-scheme: light;

    --primary:       #E67814;
    --primary-dark:  #C8680F;
    --primary-light: #F5A040;
    --primary-rgb:   230, 120, 20;

    --success:      #28a745;   --success-rgb: 40, 167, 69;
    --success-dark: #1e7e34;
    --danger:       #dc3545;   --danger-rgb:  220, 53, 69;
    --danger-dark:  #bd2130;
    --warning:      #f59e0b;   --warning-rgb: 245, 158, 11;

    --gray-0: #ffffff;
    --gray-1: #f9fafb;
    --gray-2: #f0f0f0;
    --gray-3: #e0e0e0;
    --gray-4: #9ca3af;
    --gray-5: #6b7280;
    --gray-6: #374151;
    --gray-7: #111827;

    --surface-dark:     #1f2937;
    --surface-dark-rgb: 31, 41, 55;

    --white-rgb: 255, 255, 255;
    --black-rgb:  0, 0, 0;

    --on-color: #ffffff;
    --sidebar-width: 320px;
    --content-max-width: 1200px;

    --bg:           var(--gray-0);
    --card-bg:      var(--gray-0);
    --bg-secondary: var(--gray-1);
    --bg-tertiary:  var(--gray-2);
    --border-color: var(--gray-3);
    --border-light: var(--gray-2);
    --text-color:      var(--gray-7);
    --text-muted:      var(--gray-5);
    --text-secondary:  var(--gray-6);

    --gradient-orange: linear-gradient(135deg, #E67814 0%, #F5A040 100%);

    --shadow:    0 2px 4px rgba(var(--black-rgb), 0.08);
    --shadow-lg: 0 4px 12px rgba(var(--black-rgb), 0.12);

    --radius:    8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    --btn-h:    2.75rem;
    --btn-h-sm: 2.25rem;
    --btn-h-xs: 1.75rem;

    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl:      3rem;
    --presence-size:  12px;

    --font-2xs:  0.65rem;
    --font-xs:   0.75rem;
    --font-sm:   0.85rem;
    --font-base: 0.9375rem;
    --font-md:   1rem;
    --font-lg:   1.25rem;
    --font-xl:   1.5rem;
    --font-2xl:  2rem;

    --overlay-dark:  rgba(var(--black-rgb), 0.5);
    --overlay-light: rgba(var(--white-rgb), 0.9);
}

[data-theme="dark"] {
    color-scheme: dark;

    --gray-0: #1a1a1a;
    --gray-1: #252525;
    --gray-2: #2f2f2f;
    --gray-3: #404040;
    --gray-4: #6b7280;
    --gray-5: #9ca3af;
    --gray-6: #d1d5db;
    --gray-7: #f9fafb;

    --surface-dark:     #252525;
    --surface-dark-rgb: 37, 37, 37;

    --shadow:    0 2px 4px rgba(var(--black-rgb), 0.2);
    --shadow-lg: 0 4px 12px rgba(var(--black-rgb), 0.3);
}

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

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

a {
    text-decoration: none;
}

:where(a:visited) {
    color: inherit;
}

a:hover,
a:focus,
a:active {
    text-decoration: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    min-width: 250px;
}

html {
    min-width: 250px;
    scrollbar-color: var(--gray-3) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gray-3);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-4);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-3);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--gray-4);
}

body:has(.layout-sidebar) {
    overflow: hidden;
    height: 100vh;
}

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.page-wrapper > .main-content {
    display: flex;
    flex-direction: column;
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0;
    flex: 1;
}

.page-wrapper > .main-content:has(.settings-container) {
    padding: 0;
}

.header {
    background: var(--gray-0);
    color: var(--text-color);
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
    position: static;
}

[data-theme="dark"] .header {
    background: var(--surface-dark);
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.header-logo-link .logo-img {
    height: 48px;
    width: auto;
}

.header-auth .header-logo-link-hidden {
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
}

.header-auth {
    padding: 1rem 2rem;
    min-height: 60px;
}

.logo {
    font-size: var(--font-2xl);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--primary);
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 1550px) {
    .desktop-only {
        display: none !important;
    }
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--black-rgb), 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-0) 0%, var(--gray-1) 100%);
    color: var(--text-color);
    padding: 0;
    box-shadow: 2px 0 10px rgba(var(--black-rgb), 0.1);
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

[data-theme="dark"] .mobile-menu {
    background: linear-gradient(180deg, var(--surface-dark) 0%, var(--bg-secondary) 100%);
    color: var(--on-color);
    box-shadow: 2px 0 10px rgba(var(--black-rgb), 0.3);
}

.mobile-menu.active {
    transform: translateX(0);
}

body.mobile-menu-open {
    overflow: hidden;
}

.mobile-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.mobile-menu .nav-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: inherit;
}

[data-theme="dark"] .mobile-menu .nav-link {
    color: rgba(var(--white-rgb), 0.9);
}

.mobile-menu .nav-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.mobile-logout-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .mobile-logout-form {
    border-top-color: rgba(var(--white-rgb), 0.1);
}

.mobile-logout-btn {
    width: 100%;
    justify-content: center;
    margin: 0;
}

.mobile-menu .nav-link.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

[data-theme="dark"] .mobile-menu .nav-link.active {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary-light);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 0.5rem;
    background: var(--primary);
    color: var(--on-color);
    border-radius: var(--radius);
    font-size: var(--font-xs);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nav-badge.is-hidden {
    display: none;
}

.notifications-badge {
    min-width: 20px;
    padding: 0 8px;
    width: auto;
    max-width: none;
}

[data-theme="dark"] .nav-badge {
    background: var(--primary);
    color: var(--on-color);
}

.mobile-menu .nav-section {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.mobile-menu .nav-section-title {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: var(--font-xs);
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .mobile-menu .nav-section-title {
    color: rgba(var(--white-rgb), 0.5);
}

.mobile-menu-header {
    position: relative;
    margin-bottom: 1rem;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .mobile-menu-header {
    border-bottom-color: rgba(var(--white-rgb), 0.1);
}

.mobile-menu-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.mobile-menu-logo-link .logo-img {
    height: 36px;
    width: auto;
}

.mobile-menu-header h2 {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.mobile-menu-close-btn {
    position: static !important;
    color: var(--text-secondary);
    font-size: var(--font-xl);
    padding: 0;
    width: var(--btn-h);
    height: var(--btn-h);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-close-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: var(--radius);
}

[data-theme="dark"] .mobile-menu-close-btn {
    color: var(--on-color);
}

[data-theme="dark"] .mobile-menu-close-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

.mobile-menu-footer {
    margin-top: 0;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-theme="dark"] .mobile-menu-footer {
    border-top-color: rgba(var(--white-rgb), 0.1);
}

.mobile-menu-footer .theme-toggle {
    display: flex;
    justify-content: center;
}

.mobile-menu-footer .theme-toggle .btn-icon {
    width: 100%;
    height: var(--btn-h);
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--gray-0);
    color: var(--text-secondary);
    transition: all 0.2s;
}

[data-theme="dark"] .mobile-menu-footer .theme-toggle .btn-icon {
    background: var(--surface-dark);
    border-color: rgba(var(--white-rgb), 0.2);
    color: rgba(var(--white-rgb), 0.9);
}

.mobile-menu-footer .theme-toggle .btn-icon:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

[data-theme="dark"] .mobile-menu-footer .theme-toggle .btn-icon:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
}

.mobile-menu-footer .language-select {
    width: 100%;
}

.mobile-menu-footer .language-select select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--gray-0);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: var(--font-base);
    min-height: 2.75rem;
    line-height: 1.5;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E67814' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

[data-theme="dark"] .mobile-menu-footer .language-select select {
    background: var(--surface-dark);
    border-color: rgba(var(--white-rgb), 0.2);
    color: rgba(var(--white-rgb), 0.9);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.mobile-menu-footer .language-select select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

[data-theme="dark"] .mobile-menu-footer .language-select select:focus {
    background: rgba(var(--white-rgb), 0.1);
    border-color: var(--primary);
}

.mobile-menu-footer .nav-link {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding: 0.875rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--gray-0);
    color: var(--text-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    min-height: 2.75rem;
    height: 2.75rem;
    box-sizing: border-box;
}

[data-theme="dark"] .mobile-menu-footer .nav-link {
    background: var(--surface-dark);
    border-color: rgba(var(--white-rgb), 0.2);
    color: rgba(var(--white-rgb), 0.9);
}

.mobile-menu-footer .nav-link:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

[data-theme="dark"] .mobile-menu-footer .nav-link:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    color: rgba(var(--white-rgb), 0.9);
}

.mobile-menu-footer .nav-link.active {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .mobile-menu-footer .nav-link.active {
    background: rgba(var(--primary-rgb), 0.25);
    border-color: var(--primary);
    color: rgba(var(--white-rgb), 0.9);
}

.mobile-menu-footer .logout-form {
    margin: 0;
}

.mobile-menu-footer .logout-form button {
    width: 100%;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem;
}

.mobile-menu-nav .nav-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .mobile-menu-nav .nav-section {
    border-top-color: rgba(var(--white-rgb), 0.1);
}

.mobile-menu-nav .nav-section-title {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: var(--font-xs);
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .mobile-menu-nav .nav-section-title {
    color: rgba(var(--white-rgb), 0.5);
}

.layout-sidebar {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    }

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-0) 0%, var(--gray-1) 100%) !important;
    color: var(--text-color) !important;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 10px rgba(var(--black-rgb), 0.08);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
    position: relative;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--surface-dark) 0%, var(--bg-secondary) 100%) !important;
    color: var(--on-color) !important;
    border-right: 1px solid rgba(var(--white-rgb), 0.1);
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sidebar-header .logo-link {
    margin-bottom: 0;
}

.sidebar-header h1 {
    font-size: var(--font-xl);
    margin: 0;
    font-weight: 700;
    color: rgba(var(--primary-rgb), 0.95);
}

.sidebar-nav {
    padding-right: 0.25rem;
    overflow: visible;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 20000;
    background: var(--gradient-orange);
    color: var(--on-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus-visible {
    top: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: inherit;
}

[data-theme="dark"] .nav-link {
    color: rgba(var(--white-rgb), 0.9);
}

.nav-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--on-color);
}

.nav-link.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .nav-link.active {
    background: rgba(var(--primary-rgb), 0.25);
    color: var(--on-color);
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.nav-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-section {
    border-top: 1px solid rgba(var(--white-rgb), 0.1);
}

.nav-section-title {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: var(--font-xs);
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-muted);
}

.settings-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .nav-section-title {
    color: rgba(var(--white-rgb), 0.6);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-theme="dark"] .sidebar-footer {
    border-top: 1px solid rgba(var(--white-rgb), 0.1);
}

.sidebar-footer .theme-toggle {
    display: flex;
    justify-content: center;
}

.sidebar-footer .theme-toggle .btn-icon {
    width: 100%;
    height: var(--btn-h);
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--gray-0);
    color: var(--text-color);
    transition: all 0.2s;
}

[data-theme="dark"] .sidebar-footer .theme-toggle .btn-icon {
    background: var(--surface-dark);
    border-color: rgba(var(--white-rgb), 0.2);
    color: rgba(var(--white-rgb), 0.9);
}

.sidebar-footer .theme-toggle .btn-icon:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

[data-theme="dark"] .sidebar-footer .theme-toggle .btn-icon:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
}

.sidebar-footer .language-select {
    width: 100%;
}

.sidebar-footer .nav-link {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding: 0.875rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--gray-0);
    color: var(--text-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    min-height: 2.75rem;
    height: 2.75rem;
    box-sizing: border-box;
}

[data-theme="dark"] .sidebar-footer .nav-link {
    background: var(--surface-dark);
    border-color: rgba(var(--white-rgb), 0.2);
    color: rgba(var(--white-rgb), 0.9);
}

.sidebar-footer .nav-link:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

[data-theme="dark"] .sidebar-footer .nav-link:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar-footer .nav-link.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-footer .nav-link.active {
    background: rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
}

.sidebar-footer .logout-form {
    width: 100%;
    margin: 0;
}

.sidebar-footer .logout-form .btn {
    width: 100%;
    margin: 0;
}

.layout-sidebar .main-content {
    position: relative;
    flex: 1;
    min-width: 0;
    width: auto;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 2.5rem max(2.5rem, calc((100% - var(--sidebar-width) - var(--content-max-width)) / 2));
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
}

.layout-sidebar .main-content:has(.settings-container),
.layout-sidebar .main-content:has(.image-search-container) {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.mobile-header {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--gray-0);
    color: var(--text-color);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.mobile-notifications-badge-wrapper {
    position: relative;
}

.mobile-notifications-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-h);
    height: var(--btn-h);
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
}

.mobile-notifications-button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="dark"] .mobile-notifications-button {
    border-color: rgba(var(--white-rgb), 0.2);
}

[data-theme="dark"] .mobile-notifications-button:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
}

.mobile-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: var(--on-color);
    border-radius: var(--radius);
    font-size: var(--font-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--gray-0);
    white-space: nowrap;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    flex-shrink: 0;
}

[data-theme="dark"] .mobile-notifications-badge {
    border-color: var(--surface-dark);
}

.mobile-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.mobile-page-title {
    font-size: var(--font-lg);
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    line-height: 1.3;
    flex: 1;
}

.mobile-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.mobile-breadcrumb-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-breadcrumb-link:hover {
    color: var(--primary-dark);
}

.mobile-breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 300;
}

.mobile-breadcrumb-current {
    color: var(--text-muted);
}

[data-theme="dark"] .mobile-header {
    background: var(--surface-dark);
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .mobile-breadcrumb-link {
    color: var(--primary-light);
}

[data-theme="dark"] .mobile-breadcrumb-link:hover {
    color: var(--primary);
}

[data-theme="dark"] .mobile-breadcrumb,
[data-theme="dark"] .mobile-breadcrumb-current,
[data-theme="dark"] .mobile-breadcrumb-separator {
    color: var(--text-muted);
}

.footer {
    background: var(--gradient-orange);
    color: var(--on-color);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 -4px 6px rgba(var(--black-rgb), 0.1);
}

[data-theme="dark"] .footer {
    background: var(--surface-dark);
    box-shadow: 0 -4px 6px rgba(var(--black-rgb), 0.3);
}

.footer-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: rgba(var(--white-rgb), 0.9);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--on-color);
}

@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 1.25rem;
    }

    .footer p {
        font-size: var(--font-base);
        line-height: 1.4;
    }

    .footer-nav {
        margin-top: 0.75rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 1rem 1rem;
    }

    .footer p {
        font-size: var(--font-sm);
        line-height: 1.35;
    }

    .footer-nav {
        margin-top: 0.5rem;
        gap: 0.75rem;
    }

    .footer-nav a {
        font-size: var(--font-base);
    }
}

@media (max-height: 700px) and (max-width: 768px) {
    .footer {
        padding: 0.75rem 1rem;
    }

    .footer-nav {
        margin-top: 0.5rem;
    }
}

.form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.form-group label:not(.checkbox-label) {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--font-md);
    pointer-events: none;
    background: transparent;
    z-index: 1;
    transition: all 0.3s ease;
}

.form-group.checkbox-group {
    margin-top: 1rem;
}

.option-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.option-picker-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.option-picker-label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-color);
}
.option-picker-counter {
    margin-left: 0.4rem;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.12);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
}
[data-theme="dark"] .option-picker-counter {
    color: var(--primary-light);
    background: rgba(var(--primary-rgb), 0.2);
}
.option-picker-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.option-picker-search-icon {
    position: absolute;
    left: 0.75rem;
    width: 1.05rem;
    height: 1.05rem;
    color: var(--text-muted);
    pointer-events: none;
}
.option-picker-search-wrap:focus-within .option-picker-search-icon {
    color: var(--primary);
}
.option-picker-search-wrap .option-picker-search {
    padding-left: 2.4rem;
}
.option-picker-search {
    box-sizing: border-box;
    width: 100%;
    height: var(--btn-h);
    padding: 0 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-color);
    font: inherit;
    font-size: var(--font-base);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.option-picker-search::placeholder {
    color: var(--text-muted);
}
.option-picker-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}
[data-theme="dark"] .option-picker-search {
    background: var(--surface-dark);
}
.option-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    align-content: start;
    gap: 0.25rem;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 0.4rem;
}
.option-picker-list:empty {
    display: none;
}
.option-picker-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--btn-h-sm);
    padding: 0.35rem 0.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-base);
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-color);
    transition: background 0.12s ease, border-color 0.12s ease;
}
.option-picker-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
}
.option-picker-item:has(input:checked) {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.4);
    font-weight: 600;
}
.option-picker-item:focus-within {
    border-color: var(--primary);
}
.option-picker-item input[type="checkbox"] {
    flex: none;
    margin: 0;
    cursor: pointer;
}
.option-picker-item span {
    overflow-wrap: anywhere;
}
.option-picker-empty {
    margin: 0;
    font-size: var(--font-xs);
    color: var(--text-muted);
}
[data-theme="dark"] .option-picker-list {
    background: var(--surface-dark);
}
[data-theme="dark"] .option-picker-item:hover {
    background: rgba(var(--primary-rgb), 0.18);
}
[data-theme="dark"] .option-picker-item:has(input:checked) {
    background: rgba(var(--primary-rgb), 0.22);
}
.option-picker-wide .option-picker-list {
    max-height: 320px;
}
@media (max-width: 480px) {
    .option-picker-list {
        grid-template-columns: 1fr;
        max-height: 220px;
    }
    .option-picker-item {
        padding: 0.45rem 0.5rem;
    }
}

.form-group.form-group-checkboxes .checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.form-group.form-group-checkboxes .checkbox-row .checkbox-label {
    margin-bottom: 0;
}

.form-group label.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
    position: static;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
}

.form-group label.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-group label.checkbox-label span {
    flex: 1;
}

.form-group label.checkbox-label a {
    color: var(--primary);
}

.avatar-wrap {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: visible;
}

[data-level] {
    --level-color: #6b7280;
}

.avatar-img-wrap {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.avatar-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-wrap[data-level] > .avatar-img-wrap {
    border-color: var(--level-color) !important;
}

.profile-avatar-modern[data-level] img {
    border-color: var(--level-color) !important;
}

[data-level="1"],
[data-level="2"],
[data-level="3"],
[data-level="4"],
[data-level="5"],
[data-level="6"],
[data-level="7"],
[data-level="8"],
[data-level="9"] {
    --level-color: #6b7280;
}

[data-level^="1"]:not([data-level="1"]) {
    --level-color: #22c55e;
}

[data-level^="2"] { --level-color: #3b82f6; }
[data-level^="3"] { --level-color: #8b5cf6; }
[data-level^="4"] { --level-color: #E67814; }
[data-level^="5"] { --level-color: #ef4444; }
[data-level^="6"] { --level-color: #ec4899; }
[data-level^="7"] { --level-color: #06b6d4; }
[data-level^="8"] { --level-color: #f59e0b; }
[data-level^="9"] { --level-color: #fbbf24; }

.avatar-wrap[data-level^="9"]:not([data-level="9"]) > .avatar-img-wrap {
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.level-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--level-color);
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xs);
    font-weight: 700;
    color: #fff;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    box-sizing: content-box;
}

[data-theme="dark"] .level-badge {
    border-color: var(--gray-0);
}

.level-badge[data-digits="2"] {
    width: auto;
    min-width: 24px;
    padding: 0 4px;
    border-radius: 10px;
}

.avatar-small .level-badge {
    display: none;
}

.avatar-wrap > .presence-dot {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
}

.admin-online-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9000;
    font-size: 0.875rem;
}

.admin-online-panel {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.admin-online-history {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0.15rem;
    margin-left: auto;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}
.admin-online-history:hover {
    opacity: 1;
}
.admin-last-seen-content {
    max-width: 560px;
    width: 100%;
}
#admin-last-seen-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-color);
    font: inherit;
}
#admin-last-seen-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
[data-theme="dark"] #admin-last-seen-search {
    background: var(--surface-dark);
}

.admin-last-seen-hint {
    margin: 0.5rem 0 0.75rem;
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.admin-last-seen-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.admin-last-seen-item + .admin-last-seen-item {
    border-top: 1px solid var(--border-color);
}
.admin-last-seen-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    text-decoration: none;
    color: var(--text-color);
}
.admin-last-seen-user:hover {
    background: rgba(var(--primary-rgb), 0.08);
}
.admin-last-seen-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.admin-last-seen-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}
.admin-last-seen-badge {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-size: var(--font-xs);
    font-weight: 700;
    vertical-align: middle;
}
.admin-last-seen-when {
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.admin-last-seen-item.is-online .admin-last-seen-when {
    color: var(--success, #2e7d32);
    font-weight: 600;
}
.admin-last-seen-empty {
    padding: 1rem 0.75rem;
    color: var(--text-muted);
    font-size: var(--font-sm);
}
.admin-last-seen-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.admin-last-seen-page {
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.admin-last-seen-foot button[disabled] {
    opacity: 0.4;
    cursor: default;
}

.admin-online-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--gray-0);
}

.admin-online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}

.admin-online-title {
    font-weight: 600;
    flex: 1;
    line-height: 1;
}

.admin-online-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.admin-online-close:hover {
    background: var(--gray-1);
    color: var(--text-color);
}

.admin-online-body {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.625rem;
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.admin-online-body:hover {
    background: var(--gray-0);
}

.admin-online-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
}

.admin-online-label {
    color: var(--text-muted);
}

.admin-online-chevron {
    margin-left: auto;
    align-self: center;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.admin-online-widget.expanded .admin-online-chevron {
    transform: rotate(180deg);
}

.admin-online-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    max-height: 16rem;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.admin-online-widget.expanded .admin-online-list {
    display: block;
}

.admin-online-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--text-color);
    text-decoration: none;
}

.admin-online-user:hover {
    background: var(--gray-1);
}

.admin-online-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-online-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-online-empty {
    padding: 0.5rem 0.4rem;
    color: var(--text-muted);
}

.admin-online-reopen {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-weight: 700;
}

.admin-online-reopen:hover {
    background: var(--gray-0);
}

.admin-online-reopen-count {
    line-height: 1;
}

.admin-online-widget.collapsed {
    right: 0;
    bottom: 1.5rem;
}

.admin-online-widget.collapsed .admin-online-panel {
    display: none;
}

.admin-online-widget.collapsed .admin-online-reopen {
    display: inline-flex;
}
