:root {
    --argon-bg: #f7f8fc;
    --argon-card: #ffffff;
    --argon-text: #344767;
    --argon-muted: #8392ab;
    --argon-border: #e9ecef;
    --argon-primary: #5e72e4;
    --argon-secondary: #825ee4;
    --argon-info: #11cdef;
    --argon-success: #2dce89;
    --argon-warning: #fb6340;
    --argon-danger: #f5365c;
    --argon-shadow: 0 20px 45px rgba(50, 50, 93, 0.08), 0 8px 18px rgba(0, 0, 0, 0.04);
    --argon-radius: 1rem;
    --sidebar-width: 17.125rem;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--argon-bg);
    color: var(--argon-text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.crm-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.crm-sidebar {
    position: fixed;
    inset: 1rem auto 1rem 1rem;
    width: var(--sidebar-width);
    background: var(--argon-card);
    border-radius: 1.5rem;
    box-shadow: var(--argon-shadow);
    z-index: 1030;
    overflow: hidden;
}

.crm-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    color: var(--argon-text);
    font-weight: 700;
    border-bottom: 1px solid var(--argon-border);
}

.crm-brand-icon,
.crm-nav-icon,
.metric-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.crm-brand-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .8rem;
    color: #fff;
    background: linear-gradient(135deg, var(--argon-primary), var(--argon-secondary));
}

.crm-sidebar-nav {
    padding: 1rem;
}

.crm-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.75rem;
    border-radius: .85rem;
    color: #67748e;
    font-weight: 600;
    margin-bottom: .35rem;
    transition: all .18s ease;
}

.crm-sidebar .nav-link:hover,
.crm-sidebar .nav-link.active {
    color: var(--argon-text);
    background: #f6f9fc;
    box-shadow: 0 8px 18px rgba(50, 50, 93, 0.08);
}

.crm-nav-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .65rem;
    color: var(--argon-primary);
    background: #fff;
    box-shadow: 0 4px 10px rgba(50, 50, 93, 0.1);
}

.crm-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: calc(var(--sidebar-width) + 2rem);
    padding: 1rem 1.5rem 0;
    overflow-y: auto;
}

.crm-topbar-wrap {
    position: relative;
    z-index: 1040;
    margin-left: calc(var(--sidebar-width) + 2rem);
    padding: 1rem 1.5rem 0;
    overflow: visible !important;
}

.crm-topbar {
    position: relative;
    min-height: 4.25rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(50, 50, 93, 0.06);
    isolation: isolate;
}

.crm-topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: inherit;
    z-index: -1;
}

.crm-menu-title {
    color: var(--argon-muted);
    font-size: .68rem;
    font-weight: 800;
    margin: 1rem .75rem .45rem;
    text-transform: uppercase;
}

.crm-page-title {
    font-weight: 700;
    color: var(--argon-text);
}

.crm-content {
    padding: 1.5rem 0 2rem;
    flex: 1 0 auto;
}

.argon-card {
    background: var(--argon-card);
    border: 0;
    border-radius: var(--argon-radius);
    box-shadow: var(--argon-shadow);
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-label {
    color: var(--argon-muted);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-value {
    margin: .2rem 0 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.metric-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 18px rgba(94, 114, 228, .25);
}

.metric-icon.primary { background: linear-gradient(135deg, #5e72e4, #825ee4); }
.metric-icon.success { background: linear-gradient(135deg, #2dce89, #2dcecc); }
.metric-icon.warning { background: linear-gradient(135deg, #fb6340, #fbb140); }
.metric-icon.danger { background: linear-gradient(135deg, #f5365c, #f56036); }

.btn-primary,
.btn-argon {
    border: 0;
    background: linear-gradient(135deg, var(--argon-primary), var(--argon-secondary));
    box-shadow: 0 8px 18px rgba(94, 114, 228, .25);
}

.btn-primary:hover,
.btn-argon:hover {
    background: linear-gradient(135deg, #4f62d6, #734cd6);
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--argon-border);
    border-radius: .75rem;
}

.input-group .input-group-text {
    border-end-start-radius: .75rem;
    border-start-start-radius: .75rem;
}

.input-group .form-control {
    border-end-end-radius: .75rem;
    border-start-end-radius: .75rem;
}

.table {
    color: var(--argon-text);
}

.table thead th {
    color: var(--argon-muted);
    font-size: .72rem;
    text-transform: uppercase;
}

.crm-footer {
    color: var(--argon-muted);
    font-size: .875rem;
    padding: 0 0 1.5rem;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 20%, rgba(94, 114, 228, .22), transparent 28rem),
        linear-gradient(135deg, #f8f9fe 0%, #eef2ff 100%);
}

.login-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #5e72e4, #825ee4);
    color: #fff;
    border-bottom-left-radius: 2rem;
    overflow: hidden;
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: auto -6rem -9rem auto;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.login-card {
    width: min(430px, 92vw);
    border: 0;
    border-radius: 1.25rem;
    box-shadow: var(--argon-shadow);
}

@media (max-width: 991.98px) {
    .crm-sidebar {
        position: static;
        width: auto;
        margin: 1rem;
    }

    .crm-main {
        margin-left: 0;
        padding: 0 1rem;
    }

    .crm-topbar-wrap {
        margin-left: 0;
        padding: 0 1rem;
    }

    .crm-topbar {
        border-radius: 1rem;
    }

    .login-hero {
        min-height: auto;
        border-radius: 0 0 2rem 2rem;
        padding: 3rem 1.5rem;
    }
}
