:root {
    --navy: #172033;
    --blue: #2563eb;
    --muted: #64748b;
    --bg: #f1f5f9
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: #1e293b;
    font-family: Inter, Segoe UI, Arial, sans-serif
}

.topbar {
    background: var(--navy);
    color: #fff;
    padding: 16px 24px;
    box-shadow: 0 2px 12px #17203325
}

.topbar a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 22px;
    font-size: 14px
}

.topbar a:hover {
    color: #fff
}

.card,
.panel {
    background: #fff;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 8px 30px #1720330d;
    padding: 24px
}

.stat {
    border-left: 4px solid var(--blue)
}

h1 {
    font-weight: 750;
    letter-spacing: -.03em;
    margin-bottom: 24px
}

.form-control,
.form-select {
    border-radius: 9px;
    border: 1px solid #dbe3ef;
    padding: 10px 12px
}

.btn {
    border-radius: 9px;
    padding: 10px 16px;
    font-weight: 600
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue)
}

thead th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .05em;
    background: #f8fafc !important
}

.badge {
    border-radius: 99px;
    padding: 7px 10px
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #172033, #2563eb)
}

.login-card {
    width: min(420px, calc(100% - 32px));
    background: #fff;
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 20px 70px #02061755
}

.brand {
    font-weight: 800;
    letter-spacing: -.04em
}

@media(max-width:700px) {
    .topbar {
        padding: 14px
    }

    .topbar a {
        margin-left: 8px;
        font-size: 12px
    }

    .card,
    .panel {
        padding: 16px
    }
}

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

.sidebar {
    width: 248px;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    overflow-y: auto;
    background: #172033;
    color: #dbe4f0;
    padding: 26px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    padding: 0 14px 26px
}

.sidebar-brand span {
    color: #7dd3fc
}

.sidebar a {
    color: #aebbd0;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600
}

.sidebar a:hover,
.sidebar a.active {
    background: #263653;
    color: #fff
}

.sidebar-bottom {
    margin-top: auto
}

.main-content {
    flex: 1;
    margin-left: 248px;
    padding: 42px 2%;
    max-width: 1600px
}

.mobile-header {
    display: none
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px
}

.eyebrow {
    font-size: 11px;
    letter-spacing: .15em;
    color: #64748b;
    font-weight: 800;
    margin: 0 0 7px
}

.subtitle {
    color: #64748b
}

.count-pill {
    background: #e0eaff;
    color: #1d4ed8;
    padding: 9px 14px;
    border-radius: 30px;
    font-weight: 700
}

.crm-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 30px #1720330d
}

.section-title {
    margin-bottom: 18px
}

.section-title h5 {
    margin: 0
}

.section-title small {
    color: #64748b
}

.filter-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 100px auto;
    gap: 10px;
    margin-bottom: 20px
}

.crm-table th {
    white-space: nowrap
}

.crm-table td {
    padding-top: 16px;
    padding-bottom: 16px
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569
}

.status-sent {
    background: #dcfce7;
    color: #15803d
}

.status-failed {
    background: #fee2e2;
    color: #b91c1c
}

.status-pending {
    background: #fef3c7;
    color: #a16207
}

.status-dot:before {
    content: '●';
    margin-right: 5px
}

.status-dot.success {
    color: #15803d
}

.status-dot.muted {
    color: #94a3b8
}

.error-cell {
    max-width: 180px;
    color: #b91c1c;
    font-size: 12px
}

.actions {
    white-space: nowrap
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 42px !important
}

.pagination {
    margin-top: 18px
}

@media(max-width:800px) {
    .sidebar {
        position: fixed;
        z-index: 20;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left .2s
    }

    .sidebar-open .sidebar {
        left: 0
    }

    .main-content {
        padding: 20px 14px
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px
    }

    .page-header {
        display: block
    }

    .count-pill {
        display: inline-block;
        margin-top: 8px
    }

    .filter-bar {
        display: block
    }

    .filter-bar>* {
        margin-bottom: 9px;
        width: 100%
    }

    .crm-table {
        min-width: 900px
    }
}
