body {
    margin: 0;
    background: #f3f4f6;
    color: #07152f;
    font-family: Arial, sans-serif;
}

.crm-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ШАПКА */
.crm-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    background: #e30613;
    color: #fff;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
}

.brand-subtitle {
    color: #64748b;
    font-size: 14px;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.user-panel button {
    background: #e30613;
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 9px 16px;
    font-weight: 900;
}

/* БЫСТРЫЙ ДОСТУП */
.quick-menu-section {
    background: #111827;
    padding: 24px 0;
    margin-bottom: 22px;
}

.quick-menu-title {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 16px;
}

.quick-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-menu-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 18px;
    background: #fff;
    border-radius: 18px;
    text-decoration: none;
    color: #07152f;
    box-shadow: 0 10px 24px rgba(0,0,0,.16);
    transition: .2s ease;
}

.quick-menu-card:hover {
    transform: translateY(-3px);
    color: #07152f;
    box-shadow: 0 16px 32px rgba(0,0,0,.22);
}

.quick-menu-accent {
    background: #e30613;
    color: #fff;
}

.quick-menu-accent:hover {
    color: #fff;
}

.quick-menu-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.quick-menu-accent .quick-menu-icon {
    background: rgba(255,255,255,.18);
}

.quick-menu-name {
    font-size: 17px;
    font-weight: 900;
}

.quick-menu-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.quick-menu-accent .quick-menu-desc {
    color: rgba(255,255,255,.85);
}

/* СТРАНИЦА */
.page {
    padding-bottom: 40px;
}

.page-head {
    background: #fff;
    border: 1px solid #dbe1ea;
    border-left: 7px solid #e30613;
    border-radius: 16px;
    padding: 20px 26px;
    margin-bottom: 18px;
}

.page-head h1 {
    font-size: 30px;
    font-weight: 900;
    margin: 0 0 6px;
}

.page-head p {
    margin: 0;
    color: #475569;
}

/* КАРТОЧКИ */
.panel,
.crm-card {
    background: #fff;
    border: 1px solid #dbe1ea;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}

.panel h4,
.crm-card h3 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
}

/* СТАТИСТИКА */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card {
    background: #fff;
    border: 1px solid #dbe1ea;
    border-radius: 16px;
    padding: 22px;
}

.stat-label {
    font-weight: 900;
    color: #07152f;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
}

/* ФИЛЬТРЫ */
.form-label {
    font-weight: 900;
}

.form-select,
.form-control {
    min-height: 46px;
    border-radius: 10px;
}

.btn {
    border-radius: 10px;
    font-weight: 900;
}

.btn-primary {
    background: #e30613;
    border-color: #e30613;
}

.btn-primary:hover {
    background: #c9000b;
    border-color: #c9000b;
}

.btn-secondary,
.btn-dark {
    background: #111827;
    border-color: #111827;
}

/* ТАБЛИЦА */
.table {
    background: #fff;
}

.table thead th {
    background: #111827;
    color: #fff;
    padding: 14px;
}

.table td {
    padding: 14px;
    vertical-align: middle;
}

/* ЛОГИН */
.login-page {
    min-height: 100vh;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
    border-top: 8px solid #e30613;
}

.login-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-title {
    font-size: 30px;
    font-weight: 900;
}

.login-brand-subtitle {
    color: #64748b;
}

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 1100px) {
    .quick-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .crm-container {
        padding: 0 14px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-title {
        font-size: 21px;
    }

    .user-panel {
        width: 100%;
        justify-content: space-between;
    }

    .quick-menu-grid {
        grid-template-columns: 1fr;
    }

    .quick-menu-card {
        min-height: 76px;
        padding: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-head h1 {
        font-size: 25px;
    }
}

.crm-header {
    background: #ffffff !important;
    padding: 14px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.header-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.brand-icon {
    width: 46px !important;
    height: 46px !important;
    border-radius: 12px !important;
    background: #e30613 !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 900 !important;
    font-size: 22px !important;
}

.brand-title {
    font-size: 24px !important;
    font-weight: 900 !important;
}

.brand-subtitle {
    font-size: 14px !important;
    color: #64748b !important;
}

.page-head {
    padding: 18px 24px !important;
    margin-top: 22px !important;
}

.page-head h1 {
    font-size: 28px !important;
}

.panel {
    padding: 20px 24px !important;
}

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
}

.stat-card {
    background: #fff !important;
    border: 1px solid #dbe1ea !important;
    border-radius: 16px !important;
    padding: 22px !important;
}

.stat-label {
    font-weight: 900 !important;
    margin-bottom: 10px !important;
}

.stat-value {
    font-size: 32px !important;
    font-weight: 900 !important;
}

@media (max-width: 900px) {
    .header-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

.table-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

.table-head h3 {
    margin: 0 !important;
}

.table-head .btn {
    margin-left: auto !important;
}

@media (max-width: 760px) {
    .crm-table,
    .crm-table thead,
    .crm-table tbody,
    .crm-table th,
    .crm-table td,
    .crm-table tr {
        display: block !important;
        width: 100% !important;
    }

    .crm-table thead {
        display: none !important;
    }

    .crm-table tr {
        background: #fff !important;
        border: 1px solid #dbe1ea !important;
        border-radius: 16px !important;
        padding: 14px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 8px 20px rgba(0,0,0,.06) !important;
    }

    .crm-table td {
        border: 0 !important;
        border-bottom: 1px solid #eef2f7 !important;
        padding: 10px 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 12px !important;
        text-align: right !important;
    }

    .crm-table td:last-child {
        border-bottom: 0 !important;
    }

    .crm-table td::before {
        font-weight: 900 !important;
        color: #64748b !important;
        text-align: left !important;
        min-width: 110px !important;
    }

    .crm-table td:nth-child(1)::before { content: "Клиент"; }
    .crm-table td:nth-child(2)::before { content: "Категория"; }
    .crm-table td:nth-child(3)::before { content: "Задача"; }
    .crm-table td:nth-child(4)::before { content: "Менеджер"; }
    .crm-table td:nth-child(5)::before { content: "Срок"; }
    .crm-table td:nth-child(6)::before { content: "Статус"; }
    .crm-table td:nth-child(7)::before { content: "Действие"; }

    .crm-table small {
        text-align: right !important;
    }

    .crm-table .btn {
        width: 100% !important;
        margin-top: 8px !important;
    }
}