html {
    font-size: 14px;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: #edf3f8;
    color: #162738;
}

a {
    text-decoration: none;
}

.crm-body {
    background: radial-gradient(circle at top left, rgba(41, 98, 255, 0.08), transparent 22%), linear-gradient(180deg, #eef4f9 0%, #e9f0f6 100%);
}

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

.crm-sidebar {
    width: 245px;
    background: linear-gradient(180deg, #031225 0%, #041730 100%);
    color: #dbe6f2;
    padding: 18px 14px;
    box-shadow: 12px 0 34px rgba(3, 18, 37, 0.22);
    position: sticky;
    top: 0;
    height: 100vh;
}

.crm-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 20px 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.crm-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2763f6 0%, #32ccff 100%);
    color: #fff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(39, 99, 246, 0.35);
}

.crm-brand-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.crm-brand-subtitle {
    font-size: 0.72rem;
    color: #8ca6bf;
}

.crm-nav {
    display: grid;
    gap: 8px;
}

.crm-nav-item {
    padding: 12px 14px;
    border-radius: 12px;
    color: #c7d8ea;
    font-weight: 700;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

    .crm-nav-item:hover {
        background: rgba(255,255,255,0.06);
        color: #fff;
        border-color: rgba(255,255,255,0.08);
    }

.crm-main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.crm-topbar {
    height: 72px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(20, 43, 71, 0.06);
    position: sticky;
    top: 0;
    z-index: 30;
}

.crm-topbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a2d40;
}

.crm-topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.crm-top-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1px solid #d6e1ec;
    background: rgba(255,255,255,0.92);
    color: #284055;
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(29, 53, 87, 0.05);
}

    .crm-top-btn:hover {
        background: #fff;
        color: #1a3147;
    }

.crm-top-btn-primary {
    background: linear-gradient(135deg, #2763f6 0%, #3fc7ff 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 28px rgba(39, 99, 246, 0.24);
}

    .crm-top-btn-primary:hover {
        color: #fff;
    }

.crm-content {
    padding: 22px;
}

.dash-page {
    width: 100%;
}

.dash-head {
    margin-bottom: 18px;
}

.dash-kicker {
    font-size: 0.70rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    color: #6d8399;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.dash-title {
    margin: 0 0 6px 0;
    font-size: 2rem;
    font-weight: 900;
    color: #102235;
}

.dash-subtitle {
    margin: 0;
    color: #688096;
    font-size: 0.95rem;
}

.dash-hero {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    border-radius: 24px;
    padding: 24px;
    color: #fff;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 22%), linear-gradient(135deg, #0f1d46 0%, #1d49c6 50%, #27bde6 100%);
    box-shadow: 0 22px 44px rgba(23, 51, 111, 0.18);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 0.74rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.dash-hero h2 {
    margin: 0 0 12px 0;
    font-size: 2.2rem;
    line-height: 1.06;
    font-weight: 900;
}

.dash-hero p {
    margin: 0;
    max-width: 760px;
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-main,
.btn-alt,
.btn-ghost,
.mini-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 800;
}

.btn-main {
    background: #fff;
    color: #14315a;
}

    .btn-main:hover {
        background: #f5f9ff;
        color: #14315a;
    }

.btn-alt {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
}

    .btn-alt:hover {
        color: #fff;
        background: rgba(255,255,255,0.22);
    }

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

    .btn-ghost:hover {
        color: #fff;
        background: rgba(255,255,255,0.08);
    }

.dash-hero-right {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.hero-stat {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

    .hero-stat span {
        display: block;
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: rgba(255,255,255,0.82);
    }

    .hero-stat strong {
        display: block;
        font-size: 2rem;
        line-height: 1;
        font-weight: 900;
        margin-top: 10px;
        color: #fff;
    }

    .hero-stat small {
        display: block;
        margin-top: 8px;
        font-size: 0.80rem;
        color: rgba(255,255,255,0.82);
    }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.kpi-card {
    background: #fff;
    border: 1px solid #dde8f2;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 12px 26px rgba(20, 43, 71, 0.06);
    position: relative;
    overflow: hidden;
}

    .kpi-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 4px;
    }

.kpi-blue::before {
    background: linear-gradient(90deg, #245dff, #4fa0ff);
}

.kpi-sky::before {
    background: linear-gradient(90deg, #3576ff, #33c8ff);
}

.kpi-yellow::before {
    background: linear-gradient(90deg, #f0a300, #ffd35a);
}

.kpi-cyan::before {
    background: linear-gradient(90deg, #00bcd4, #4fe4ff);
}

.kpi-green::before {
    background: linear-gradient(90deg, #00a86b, #5de2a5);
}

.kpi-red::before {
    background: linear-gradient(90deg, #e64a4a, #ff8585);
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #75879a;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 900;
    color: #102235;
    margin-top: 10px;
    line-height: 1;
}

.kpi-text {
    margin-top: 8px;
    font-size: 0.80rem;
    color: #7c8e9f;
    line-height: 1.5;
}

.panel-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.two-col {
    grid-template-columns: 1fr 1fr;
}

.panel {
    background: rgba(255,255,255,0.92);
    border: 1px solid #dde7f1;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(20, 43, 71, 0.05);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.panel-kicker {
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #75879a;
    margin-bottom: 4px;
}

.panel h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 900;
    color: #14263a;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.focus-card {
    border-radius: 18px;
    padding: 16px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .focus-card h4 {
        margin: 0 0 8px 0;
        font-size: 1rem;
        font-weight: 900;
        color: #15283c;
    }

    .focus-card p {
        margin: 0 0 14px 0;
        font-size: 0.84rem;
        color: #5f7387;
        line-height: 1.55;
    }

.focus-info {
    background: linear-gradient(180deg, #f3f8ff 0%, #edf6ff 100%);
    border: 1px solid #dbeafe;
}

.focus-warning {
    background: linear-gradient(180deg, #fff9eb 0%, #fff5db 100%);
    border: 1px solid #f8e1a6;
}

.focus-danger {
    background: linear-gradient(180deg, #fff1f1 0%, #ffe8e8 100%);
    border: 1px solid #f6c7c7;
}

.focus-success {
    background: linear-gradient(180deg, #eefbf5 0%, #e6f9ef 100%);
    border: 1px solid #ccefdc;
}

.mini-btn {
    border: 1px solid #d7e2ee;
    background: #f8fbff;
    color: #284058;
}

    .mini-btn:hover {
        background: #fff;
        color: #1d3348;
    }

.rate-block {
    margin-bottom: 14px;
}

.rate-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #284058;
    font-size: 0.88rem;
}

    .rate-top strong {
        color: #112539;
    }

.rate-bar,
.pipeline-bar {
    height: 10px;
    border-radius: 999px;
    background: #e8eff6;
    overflow: hidden;
}

.rate-fill,
.pipeline-fill {
    height: 100%;
    border-radius: 999px;
}

.fill-blue, .bar-blue {
    background: linear-gradient(90deg, #245dff 0%, #49b5ff 100%);
}

.fill-cyan, .bar-cyan {
    background: linear-gradient(90deg, #17b7d8 0%, #56e1ff 100%);
}

.fill-green, .bar-green {
    background: linear-gradient(90deg, #09a36d 0%, #58d9a1 100%);
}

.bar-yellow {
    background: linear-gradient(90deg, #f0ab00 0%, #ffd76b 100%);
}

.bar-red {
    background: linear-gradient(90deg, #e25252 0%, #ff9d9d 100%);
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.mini-stat {
    background: #f8fbff;
    border: 1px solid #dce7f2;
    border-radius: 16px;
    padding: 14px;
}

    .mini-stat span {
        display: block;
        color: #6f8397;
        font-size: 0.78rem;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .mini-stat strong {
        font-size: 1.5rem;
        font-weight: 900;
        color: #102235;
        line-height: 1;
    }

.list-cards,
.pipeline-list,
.recent-grid {
    display: grid;
    gap: 12px;
}

.info-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border-radius: 16px;
    padding: 14px 16px;
    background: #fbfdff;
    border: 1px solid #e4edf6;
}

.info-title {
    font-size: 0.96rem;
    font-weight: 900;
    color: #112539;
}

.info-meta {
    margin-top: 4px;
    color: #72869a;
    font-size: 0.80rem;
    line-height: 1.55;
}

.info-side {
    text-align: right;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #edf4ff;
    color: #2b5ec4;
    font-size: 0.74rem;
    font-weight: 800;
}

.days-pill {
    margin-top: 6px;
    font-size: 0.80rem;
    font-weight: 800;
    color: #cf6b00;
}

.danger-pill {
    color: #c43f3f;
}

.empty-box {
    border: 1px dashed #d7e2ee;
    border-radius: 18px;
    background: #fafcff;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
}

.empty-title {
    font-size: 1rem;
    font-weight: 900;
    color: #21364b;
    margin-bottom: 6px;
}

.empty-text {
    max-width: 560px;
    font-size: 0.83rem;
    color: #76899c;
    line-height: 1.6;
}

.ok-box .empty-title {
    color: #15815f;
}

.pipeline-row {
    display: grid;
    gap: 8px;
}

.pipeline-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #294054;
    font-size: 0.86rem;
}

    .pipeline-top strong {
        color: #112539;
    }

.trend-wrap {
    margin-top: 22px;
}

.trend-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    align-items: end;
    min-height: 210px;
    margin-top: 12px;
}

.trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.trend-box {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: end;
    justify-content: center;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5fb 100%);
    border-radius: 16px;
    padding: 10px;
    border: 1px solid #e0ebf5;
}

.trend-bar {
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(180deg, #2d69ff 0%, #41c6ff 100%);
    box-shadow: 0 10px 20px rgba(45, 105, 255, 0.18);
    min-height: 14px;
}

.trend-num {
    font-size: 0.82rem;
    font-weight: 800;
    color: #16304b;
}

.trend-label {
    font-size: 0.78rem;
    color: #6e8398;
    text-transform: capitalize;
}

.recent-card {
    border-radius: 18px;
    border: 1px solid #e2ebf5;
    background: #fbfdff;
    padding: 14px 16px;
}

.recent-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.recent-actions {
    margin-top: 12px;
}

@media (max-width: 1500px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .crm-sidebar {
        display: none;
    }

    .dash-hero,
    .two-col {
        grid-template-columns: 1fr;
    }

    .dash-hero-right,
    .focus-grid,
    .mini-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crm-content {
        padding: 16px;
    }
}

@media (max-width: 900px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-hero-right,
    .focus-grid,
    .mini-stat-grid,
    .trend-chart {
        grid-template-columns: 1fr;
    }

    .crm-topbar {
        height: auto;
        padding: 12px;
        gap: 12px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .crm-topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dash-hero h2 {
        font-size: 1.6rem;
    }

    .dash-title {
        font-size: 1.6rem;
    }

    .crm-content {
        padding: 12px;
    }
}
