* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.crm-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: #0f3d5e;
    color: #ffffff;
    padding: 24px 18px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: #ffffff;
    color: #0f3d5e;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.brand h2 {
    margin: 0;
    font-size: 18px;
}

.brand p {
    margin: 3px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

.menu a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 13px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    font-size: 15px;
}

.menu a:hover,
.menu a.active {
    background: rgba(255,255,255,0.16);
}

.main-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    padding: 28px;
}

.topbar {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 6px 18px rgba(15, 61, 94, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
}

.topbar p {
    margin: 5px 0 0;
    color: #6b7280;
}

.topbar-user {
    background: #eef6fb;
    color: #0f3d5e;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(15, 61, 94, 0.08);
}

.card-label {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.card strong {
    font-size: 38px;
    display: block;
    color: #0f3d5e;
}

.card p {
    margin: 8px 0 0;
    color: #6b7280;
}

.panel h2 {
    margin-top: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f8fafc;
    color: #374151;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

@media (max-width: 980px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .crm-wrapper {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: block;
    }

    .topbar-user {
        margin-top: 14px;
        display: inline-block;
    }
}