/* Public layout: header/footer shared styles */
.site-header {
    background: #0f172a;
    position: relative;
    z-index: 120;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.logo-tagline {
    font-size: 0.625rem;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 600;
}

.nav-link-icon {
    width: 16px;
    height: 16px;
    opacity: 0.85;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-menu-btn {
    display: none;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    color: #fff;
    border-radius: 8px;
    transition: background 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-icon {
    position: relative;
    width: 22px;
    height: 16px;
    display: block;
}

.mobile-menu-line {
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.28s ease, opacity 0.2s ease, top 0.28s ease;
}

.mobile-menu-line:nth-child(1) {
    top: 0;
}

.mobile-menu-line:nth-child(2) {
    top: 7px;
}

.mobile-menu-line:nth-child(3) {
    top: 14px;
}

.mobile-menu-btn.is-open .mobile-menu-line:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
}

.mobile-menu-btn.is-open .mobile-menu-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.is-open .mobile-menu-line:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-menu-btn:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.mobile-nav {
    background: #1e293b;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: max-height 0.32s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.mobile-nav.open {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    min-height: 56px;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-link:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: -2px;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.user-btn-profile {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border: 1px solid rgba(125, 211, 252, 0.55);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2), 0 8px 20px rgba(2, 132, 199, 0.28);
}

.user-btn-profile:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.7), 0 10px 24px rgba(2, 132, 199, 0.35);
}

.user-btn-logout {
    color: rgba(255, 255, 255, 0.6);
    padding: 0.375rem 0.5rem;
}

.user-btn-logout:hover {
    color: #fff;
}

.user-btn-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.user-btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 4px;
    font-size: 0.625rem;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: #dc2626;
    border: 1px solid rgba(15, 23, 42, 0.7);
    font-weight: 700;
}

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

.notification-badge.attention {
    background: #d97706;
}

.notification-badge.subtle {
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    line-height: 10px;
    font-size: 0;
    background: #94a3b8;
    border-color: rgba(15, 23, 42, 0.45);
}

.notification-panel {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.notification-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.notification-panel__sheet {
    margin-left: auto;
    height: 100%;
    width: min(100vw, 380px);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    box-shadow: -12px 0 28px rgba(15, 23, 42, 0.2);
}

.notification-panel.open .notification-panel__sheet {
    transform: translateX(0);
}

.notification-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.notification-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.notification-panel__close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    color: #475569;
    cursor: pointer;
}

.notification-panel__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.notification-panel__mark-all,
.notification-panel__all-link {
    font-size: 0.8125rem;
    font-weight: 700;
}

.notification-panel__mark-all {
    border: 0;
    background: #f1f5f9;
    color: #334155;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
}

.notification-panel__all-link {
    color: #0369a1;
}

.notification-panel__body {
    overflow-y: auto;
    padding: 0.75rem;
    flex: 1;
}

.notification-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
    background: #f8fafc;
}

.notification-item.unread {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.notification-item__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}

.notification-item__body {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.45;
    white-space: pre-wrap;
}

.notification-item__meta {
    margin-top: 0.45rem;
    font-size: 0.7rem;
    color: #64748b;
}

.notification-item__link {
    margin-top: 0.45rem;
    display: inline-flex;
    font-size: 0.75rem;
    color: #0369a1;
    font-weight: 700;
}

.notification-empty {
    color: #64748b;
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem 1rem;
}

.mobile-user-modal {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-user-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-user-modal-sheet {
    margin-left: auto;
    height: 100%;
    width: min(100vw, 320px);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -12px 0 28px rgba(15, 23, 42, 0.2);
}

.mobile-user-modal.open .mobile-user-modal-sheet {
    transform: translateX(0);
}

.mobile-user-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-user-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.mobile-user-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.mobile-user-modal-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-user-modal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    width: 100%;
}

.mobile-user-modal-nav-link:hover,
.mobile-user-modal-nav-link:active {
    background: #f1f5f9;
}

.mobile-user-modal-nav-primary {
    color: #0369a1;
    font-weight: 700;
}

.mobile-user-modal-nav-danger {
    color: #be123c;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.logout-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.logout-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.logout-modal-card {
    width: min(92vw, 360px);
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.3);
}

.logout-modal-title {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.logout-modal-text {
    margin: 0.5rem 0 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.logout-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.logout-modal-cancel,
.logout-modal-submit {
    border-radius: 8px;
    border: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.logout-modal-cancel {
    background: #e2e8f0;
    color: #334155;
}

.logout-modal-submit {
    background: #be123c;
    color: #ffffff;
}

.search-bar-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-footer {
    background-color: #0f172a;
}

.site-footer-accent {
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9 0%, #10b981 33%, #8b5cf6 66%, #d4a843 100%);
}

@media (max-width: 768px) {
    .site-header {
        position: sticky;
        top: 0;
    }

    .header-inner {
        gap: 0.25rem;
    }

    .desktop-nav {
        display: none !important;
    }

    .logo-tagline {
        display: none;
    }

    .logo-container {
        flex: 1;
        min-width: 0;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .user-btn-logout {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }

    .mobile-user-modal {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .nav-link-icon {
        width: 14px;
        height: 14px;
    }
}
