body {
    font-family: Tahoma, "Segoe UI", sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.app-body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 290px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-brand {
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef2f7;
}

.sidebar-link {
    border-radius: 0.85rem;
    color: #374151;
    background: #f8fafc;
    padding: 0.8rem 1rem;
    transition: all 0.2s ease-in-out;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
}

.main-content {
    flex: 1;
    padding: 2rem;
}

.app-version-footer {
    position: fixed;
    bottom: 0.65rem;
    right: 0.85rem;
    left: auto;
    z-index: 1040;
    text-align: right;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    padding: 0.3rem 0.7rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    max-width: min(22rem, calc(100vw - 1.5rem));
}

.app-version-footer .version-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.app-version-footer .version-link:hover {
    color: #0d6efd !important;
    text-decoration: underline !important;
}

.app-version-footer .version-update-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #fd7e14;
    flex-shrink: 0;
    animation: version-pulse 1.5s ease-in-out infinite;
}

.app-version-footer .version-update-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.app-version-footer .version-link.version-has-update .version-link-text {
    font-weight: 600;
}

@keyframes version-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.changelog-page .changelog-major-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-weight: 600;
}

.changelog-page .changelog-major-divider::before,
.changelog-page .changelog-major-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.changelog-page .changelog-release-current {
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.15);
}

.guest-body .changelog-page {
    width: min(100%, 720px);
    margin: 0 auto;
}

.guest-body .guest-wrapper:has(.changelog-page) {
    width: min(100%, 760px);
}

.guest-body .app-version-footer {
    background: rgba(255, 255, 255, 0.98);
}

.topbar {
    margin-bottom: 1.5rem;
}

.notification-panel {
    width: min(22rem, 92vw);
    max-height: 22rem;
    overflow: hidden;
}

.notification-list {
    max-height: 16rem;
    overflow-y: auto;
}

.notification-item-unread {
    background: rgba(13, 110, 253, 0.06);
}

.notification-bell {
    min-width: 2.75rem;
}

.user-avatar-sm {
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-lg {
    object-fit: cover;
}

.user-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
}

.user-avatar-placeholder.user-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.user-avatar-placeholder:not(.user-avatar-sm) {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.device-timeline .timeline-item:last-child {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.summary-card {
    border-radius: 1.25rem;
}

.summary-label {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
}

.chart-wrapper {
    min-height: 320px;
}

.badge.text-bg-primary-soft {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.18);
    font-weight: 500;
}

.guest-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.guest-wrapper {
    width: min(100%, 480px);
}

.login-card {
    border-radius: 1.5rem;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.card,
.form-control,
.form-select,
.btn,
.alert,
.page-link {
    border-radius: 0.95rem;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-left: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .main-content {
        padding: 1.25rem;
    }
}
