:root {
    --primary-color: #003b77;
    --primary-dark: #002a58;
    --primary-light: #1a5496;
    --accent-color: #d82e21;
    --accent-dark: #b02419;
    --secondary-color: #5c656d;
    --muted-color: #5f6871;
    --success-color: #2d7a4f;
    --warning-color: #b07a1e;
    --danger-color: #d82e21;
    --sidebar-bg: #003b77;
    --sidebar-hover: #1a5496;
    --content-bg: #f5f5f7;
    --border-color: #dddddf;
    --card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 8px 20px -4px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--content-bg);
    color: #1e293b;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

    #sidebar::-webkit-scrollbar {
        width: 4px;
    }

    #sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    #sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.12);
        border-radius: 3px;
    }

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-circle {
    width: 48px;
    height: 48px;
    background: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.logo-text h4 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.logo-text p {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    margin: 0;
}

.sidebar-nav {
    padding: 1.5rem 0.75rem;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 1rem 0.5rem;
    margin-top: 1rem;
}

.nav-item {
    margin-bottom: 0.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

    .nav-link:hover {
        background: var(--sidebar-hover);
        color: white;
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.12);
        color: white;
        border-left: 3px solid var(--accent-color);
        padding-left: calc(1rem - 3px);
    }

    .nav-link i {
        font-size: 1.125rem;
        width: 20px;
    }

.sidebar-footer {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.user-avatar {
    background: var(--primary-light);
    color: #fff;
    font-weight: 600;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

    .user-info h6 {
        margin: 0;
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .user-info p {
        margin: 0;
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.55);
        text-transform: capitalize;
    }

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

    .logout-btn:hover {
        background: rgba(216, 46, 33, 0.12);
        border-color: var(--accent-color);
        color: #f87171;
    }

/* Content */
.content {
    flex: 1;
    margin-left: 280px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar */
.topbar {
    background: rgba(255, 255, 255, 0.96);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(8px);
}

.topbar-left h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.topbar-left p {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
}

    .search-box input {
        width: 280px;
        padding: 0.6rem 1rem 0.6rem 2.75rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-size: 0.875rem;
        transition: all 0.15s;
        background: #f5f5f7;
        color: #1e293b;
    }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary-color);
            background: white;
            box-shadow: 0 0 0 3px rgba(0, 59, 119, 0.1);
        }

    .search-box i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted-color);
    }

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f5f5f7;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.15s;
}

    .icon-btn:hover {
        background: #eaeaec;
        color: var(--primary-color);
        border-color: #c8c8ca;
    }

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background: var(--card-color);
    }

    .stat-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--card-shadow-hover);
    }

    .stat-card.blue {
        --card-color: var(--primary-color);
    }

    .stat-card.red {
        --card-color: var(--accent-color);
    }

    .stat-card.green {
        --card-color: var(--success-color);
    }

    .stat-card.gray {
        --card-color: var(--secondary-color);
    }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card.blue .stat-icon {
    background: rgba(0, 59, 119, 0.08);
    color: var(--primary-color);
}

.stat-card.red .stat-icon {
    background: rgba(216, 46, 33, 0.08);
    color: var(--accent-color);
}

.stat-card.green .stat-icon {
    background: rgba(45, 122, 79, 0.08);
    color: var(--success-color);
}

.stat-card.gray .stat-icon {
    background: rgba(92, 101, 109, 0.08);
    color: var(--secondary-color);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

    .stat-trend.up {
        background: rgba(45, 122, 79, 0.08);
        color: var(--success-color);
    }

    .stat-trend.down {
        background: rgba(216, 46, 33, 0.08);
        color: var(--accent-color);
    }

.stat-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-description {
    color: var(--muted-color);
    font-size: 0.8125rem;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.chart-card {
    background: white;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.chart-filter {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 5px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.15s;
}

    .filter-btn:hover,
    .filter-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

/* Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.875rem;
    background: #f5f5f7;
    border-radius: 8px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

    .activity-item:hover {
        background: white;
        border-color: var(--border-color);
    }

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .activity-icon.blue {
        background: rgba(0, 59, 119, 0.08);
        color: var(--primary-color);
    }

    .activity-icon.red {
        background: rgba(216, 46, 33, 0.08);
        color: var(--accent-color);
    }

    .activity-icon.green {
        background: rgba(45, 122, 79, 0.08);
        color: var(--success-color);
    }

    .activity-icon.orange {
        background: rgba(176, 122, 30, 0.08);
        color: var(--warning-color);
    }

.activity-content h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
}

.activity-content p {
    font-size: 0.8125rem;
    color: var(--secondary-color);
    margin: 0;
}

.activity-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted-color);
    white-space: nowrap;
}

/* Quick Actions */
.bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: #f5f5f7;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    color: #0f172a;
    font-size: 0.875rem;
}

    .quick-action-btn:hover {
        background: white;
        border-color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 59, 119, 0.12);
        color: var(--primary-color);
    }

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

    .qa-icon.blue {
        background: rgba(0, 59, 119, 0.1);
        color: var(--primary-color);
    }

    .qa-icon.red {
        background: rgba(216, 46, 33, 0.1);
        color: var(--accent-color);
    }

    .qa-icon.green {
        background: rgba(45, 122, 79, 0.1);
        color: var(--success-color);
    }

    .qa-icon.gray {
        background: rgba(92, 101, 109, 0.1);
        color: var(--secondary-color);
    }

/* System Status */
.system-status {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

    .status-badge.online {
        background: rgba(45, 122, 79, 0.1);
        color: var(--success-color);
    }

.status-bar {
    height: 6px;
    background: #eaeaec;
    border-radius: 3px;
    overflow: hidden;
}

.status-progress {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

    .status-progress.green {
        background: var(--success-color);
    }

    .status-progress.red {
        background: var(--accent-color);
    }

.status-value {
    font-size: 0.8125rem;
    color: var(--muted-color);
}

/* Tasks */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #f5f5f7;
    border-radius: 8px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

    .task-item:hover {
        background: white;
        border-color: var(--border-color);
    }

.task-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.task-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
}

.task-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #0f172a;
}

.task-checkbox:checked + .task-label .task-title {
    text-decoration: line-through;
    color: var(--muted-color);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.task-priority {
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

    .task-priority.high {
        background: rgba(216, 46, 33, 0.08);
        color: var(--accent-color);
    }

    .task-priority.medium {
        background: rgba(176, 122, 30, 0.08);
        color: var(--warning-color);
    }

    .task-priority.low {
        background: rgba(92, 101, 109, 0.08);
        color: var(--secondary-color);
    }

.task-due {
    font-size: 0.8125rem;
    color: var(--muted-color);
}

/* Responsive */
@media (max-width: 1024px) {
    #sidebar {
        margin-left: -280px;
    }

        #sidebar.active {
            margin-left: 0;
        }

    .content {
        margin-left: 0;
    }

    .search-box input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .stats-grid, .charts-grid, .bottom-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        display: none;
    }

    .topbar {
        padding: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: fadeIn 0.4s ease-out both;
}

    .stat-card:nth-child(1) {
        animation-delay: 0.05s;
    }

    .stat-card:nth-child(2) {
        animation-delay: 0.1s;
    }

    .stat-card:nth-child(3) {
        animation-delay: 0.15s;
    }

    .stat-card:nth-child(4) {
        animation-delay: 0.2s;
    }

/* Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f5f5f7 25%, #eaeaec 50%, #f5f5f7 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f5f7;
}

::-webkit-scrollbar-thumb {
    background: #c8c8ca;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #5f6871;
    }
