/* ==========================================================================
   LERWS Portal Navigation - CSS v2.0.0 - Top Header Navigation
   ========================================================================== */

/* CSS Variables */
.lerws-portal {
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --lerws-viewport-height: 100vh;
    
    /* Dark theme (default) */
    --bg-primary: #050508;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --border-light: #21262d;
    
    /* Accent colors */
    --accent-primary: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-active-bg: rgba(88, 166, 255, 0.15);
    --accent-active-text: #58a6ff;
    
    /* Status colors */
    --color-success: #3fb950;
    --color-warning: #d29922;
    --color-danger: #f85149;
    --color-info: #58a6ff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
}

/* Light theme */
.lerws-portal[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --bg-elevated: #ffffff;
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-muted: #8c959f;
    --border-color: #d0d7de;
    --border-light: #eaeef2;
    
    --accent-primary: #0969da;
    --accent-hover: #0550ae;
    --accent-active-bg: rgba(9, 105, 218, 0.1);
    --accent-active-text: #0969da;
    
    --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(31, 35, 40, 0.08);
    --shadow-lg: 0 8px 24px rgba(31, 35, 40, 0.12);
}

/* Base Layout - No sidebar, header-based */
.lerws-portal {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--lerws-viewport-height, 100svh);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.lerws-portal *, .lerws-portal *::before, .lerws-portal *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Desktop Header Navigation
   ========================================================================== */
.lerws-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    gap: 24px;
}

/* Header Left - Logo */
.lerws-topbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.lerws-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.lerws-logo-img {
    max-height: 32px;
    width: auto;
    object-fit: contain;
}

/* Logo visibility based on theme */
.lerws-logo-light {
    display: block;
}

.lerws-logo-dark {
    display: none;
}

.lerws-portal[data-theme="dark"] .lerws-logo-light {
    display: none;
}

.lerws-portal[data-theme="dark"] .lerws-logo-dark {
    display: block;
}

.lerws-logo-single {
    display: block;
    filter: brightness(0) invert(0);
}

.lerws-portal[data-theme="dark"] .lerws-logo-single {
    filter: brightness(0) invert(1);
}

.lerws-logo-invert {
    filter: brightness(0) invert(1);
}

.lerws-portal[data-theme="dark"] .lerws-logo-light.lerws-logo-invert {
    filter: brightness(0) invert(1);
}

.lerws-portal[data-theme="dark"] .lerws-logo-dark.lerws-logo-invert {
    filter: none;
}

.lerws-logo-fallback {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Header Center - Navigation */
.lerws-topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lerws-topbar-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.lerws-topbar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lerws-topbar-nav-item.active {
    background: var(--accent-active-bg);
    color: var(--accent-active-text);
}

.lerws-topbar-nav-item svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.lerws-topbar-nav-item.active svg,
.lerws-topbar-nav-item:hover svg {
    opacity: 1;
}

/* Header Right - Utilities */
.lerws-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lerws-topbar-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none;
}

.lerws-topbar-icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lerws-topbar-icon-btn.active {
    color: var(--accent-primary);
}

.lerws-topbar-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Header Search Bar */
.lerws-topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
    max-width: 280px;
    transition: all var(--transition-fast);
}

.lerws-topbar-search:focus-within {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-active-bg);
}

.lerws-topbar-search svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.lerws-topbar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.lerws-topbar-search-input::placeholder {
    color: var(--text-muted);
}

.lerws-topbar-search-kbd {
    padding: 2px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Profile Dropdown */
.lerws-profile-dropdown {
    position: relative;
    border-radius: 100px;
    overflow: visible;
}
.lerws-profile-dropdown img {
    border-radius: 100px;
    overflow: hidden;
}
.lerws-profile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.lerws-profile-trigger:hover {
    opacity: 0.8;
}

.lerws-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.lerws-profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 200;
    overflow: hidden;
}

.lerws-profile-dropdown.open .lerws-profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lerws-profile-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.lerws-profile-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.lerws-profile-menu-info {
    flex: 1;
    min-width: 0;
}

.lerws-profile-menu-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lerws-profile-menu-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lerws-profile-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

.lerws-profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.lerws-profile-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lerws-profile-menu-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    flex-shrink: 0;
}

.lerws-profile-menu-logout {
    color: var(--color-danger);
}

.lerws-profile-menu-logout:hover {
    background: rgba(248, 81, 73, 0.1);
    color: var(--color-danger);
}

/* Theme Icon in dropdown */
.lerws-profile-menu-item .lerws-theme-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    opacity: 0.7;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E");
}

.lerws-portal[data-theme="dark"] .lerws-profile-menu-item .lerws-theme-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.41 1.41'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E");
}

/* Notification Badge */
.lerws-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Mobile Header
   ========================================================================== */
.lerws-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
    overflow: visible;
}

.lerws-mobile-header .lerws-logo {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.lerws-mobile-header .lerws-logo-img {
    max-width: 120px;
    max-height: 28px;
}

.lerws-mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lerws-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.lerws-icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Mobile header icons using CSS background images */
.lerws-icon-search,
.lerws-icon-bell,
.lerws-icon-theme {
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px 20px !important;
}

.lerws-icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
}

.lerws-icon-bell {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E") !important;
}

.lerws-icon-theme {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E") !important;
}

.lerws-portal[data-theme="dark"] .lerws-icon-theme {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e6edf3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.41 1.41'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E") !important;
}

.lerws-portal[data-theme="dark"] .lerws-icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e6edf3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
}

.lerws-portal[data-theme="dark"] .lerws-icon-bell {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e6edf3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E") !important;
}

/* ==========================================================================
   Bottom Navigation (Mobile)
   ========================================================================== */
.lerws-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 0 8px env(safe-area-inset-bottom, 0px);
    z-index: 100;
}

.lerws-bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color var(--transition-fast);
    min-width: 0;
}

.lerws-bottom-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.lerws-bottom-item.active {
    color: var(--accent-primary);
}

.lerws-bottom-item:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.lerws-main {
    flex: 1;
    padding: 84px 24px 54px;
    padding-top: calc(var(--header-height) + 20px);
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--lerws-viewport-height, 100svh);
    background: var(--bg-primary);
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
}

/* Body/HTML dark mode support */
html:has(.lerws-portal[data-theme="dark"]),
body:has(.lerws-portal[data-theme="dark"]) {
    background-color: #050509;
}

html:has(.lerws-portal[data-theme="light"]),
body:has(.lerws-portal[data-theme="light"]) {
    background-color: #f6f8fa;
}

/* ==========================================================================
   Notifications Panel
   ========================================================================== */
.lerws-notif-panel {
    position: fixed;
    inset: 0;
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lerws-notif-panel.open {
    pointer-events: auto;
    opacity: 1;
}

.lerws-notif-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.lerws-notif-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
}

.lerws-notif-panel.open .lerws-notif-content {
    right: 0;
}

.lerws-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.lerws-notif-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.lerws-notif-count {
    font-size: 13px;
    color: var(--text-muted);
}

.lerws-notif-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.lerws-notif-close:hover {
    background: var(--bg-tertiary);
}

.lerws-notif-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.lerws-mark-all-read,
.lerws-clear-all-notifications {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lerws-mark-all-read:hover,
.lerws-clear-all-notifications:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lerws-mark-all-read[disabled],
.lerws-clear-all-notifications[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.lerws-notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.lerws-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
    color: inherit;
    text-decoration: none;
}

.lerws-notif-item:hover {
    background: var(--bg-tertiary);
}

.lerws-notif-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.lerws-notif-item.unread {
    background: var(--bg-secondary);
}

.lerws-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lerws-notif-icon.success { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.lerws-notif-icon.warning { background: rgba(210, 153, 34, 0.15); color: #d29922; }
.lerws-notif-icon.danger { background: rgba(248, 81, 73, 0.15); color: #f85149; }
.lerws-notif-icon.info { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }

.lerws-notif-body {
    flex: 1;
    min-width: 0;
}

.lerws-notif-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lerws-notif-unread-dot {
    width: 8px;
    height: 8px;
    background: var(--color-info);
    border-radius: 50%;
}

.lerws-notif-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lerws-notif-time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.lerws-notif-delete {
    width: 28px;
    height: 28px;
    margin-top: 2px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lerws-notif-delete:hover,
.lerws-notif-delete:focus-visible {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.lerws-notif-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lerws-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: lerws-spin 0.8s linear infinite;
}

@keyframes lerws-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Search Modal
   ========================================================================== */
.lerws-search-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.lerws-search-modal.open {
    pointer-events: auto;
    opacity: 1;
}

.lerws-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.lerws-search-content {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 0 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(-10px);
    transition: transform var(--transition-fast);
}

.lerws-search-modal.open .lerws-search-content {
    transform: translateY(0);
}

.lerws-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.lerws-search-input-wrap svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.lerws-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.lerws-search-input::placeholder {
    color: var(--text-muted);
}

.lerws-search-input-wrap kbd {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    color: var(--text-muted);
}

.lerws-search-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 8px;
}

.lerws-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.lerws-search-result-item:hover {
    background: var(--bg-tertiary);
}

.lerws-search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.lerws-search-result-icon svg {
    width: 16px;
    height: 16px;
}

.lerws-search-result-text {
    flex: 1;
    min-width: 0;
}

.lerws-search-result-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.lerws-search-result-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.lerws-search-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.lerws-search-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.lerws-search-footer kbd {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

/* ==========================================================================
   User Profile Modal
   ========================================================================== */
.lerws-user-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 260;
}

.lerws-user-modal.open {
    display: flex;
}

.lerws-user-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.lerws-user-card {
    position: relative;
    width: min(520px, 92vw);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1;
    animation: lerws-modal-in 0.2s ease-out;
}

@keyframes lerws-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lerws-user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.lerws-user-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.lerws-user-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.lerws-user-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.lerws-user-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lerws-user-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lerws-user-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.lerws-user-profile {
    display: flex;
    gap: 16px;
    align-items: center;
}

.lerws-user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.lerws-user-name {
    font-size: 16px;
    font-weight: 600;
}

.lerws-user-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.lerws-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.lerws-user-field {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 12px;
}

.lerws-user-field span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.lerws-user-field strong {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .lerws-topbar {
        display: none;
    }
    
    .lerws-mobile-header {
        display: flex;
    }
    
    .lerws-bottom-nav {
        display: flex;
    }
    
    .lerws-main {
        padding: 24px 16px;
        padding-top: calc(var(--header-height) + 16px);
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
        overflow-x: hidden;
        min-width: 0;
        max-width: 100vw;
    }
}

@media (max-width: 768px) {
    .lerws-main {
        padding: 84px 12px calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 10px);
    }
    
    .lerws-notif-content {
        max-width: 100%;
    }
    
    .lerws-search-content {
        margin: 0 12px;
        max-width: calc(100% - 24px);
    }
}

/* Tablets in landscape - show header, hide bottom nav */
@media (min-width: 1025px) and (max-width: 1200px) {
    .lerws-topbar-search {
        min-width: 160px;
        max-width: 200px;
    }
    
    .lerws-topbar-nav-item span {
        display: none;
    }
    
    .lerws-topbar-nav-item {
        padding: 8px 12px;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.lerws-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Login Required State */
.lerws-login-required {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-primary);
    border-radius: 12px;
    margin: 40px auto;
    max-width: 400px;
}

.lerws-login-required a {
    color: var(--color-info);
    text-decoration: none;
}

.lerws-login-required a:hover {
    text-decoration: underline;
}
