.card,
.section-card,
.users-panel,
.form-card,
.cp-card {
    border: 1px solid rgba(219, 228, 238, 0.95) !important;
    box-shadow: var(--crm-shadow) !important;
}

.crm-row-overdue,
.crm-row-overdue > td,
tr.row-followup-overdue,
tr.row-followup-overdue td {
    background: #fde2e2 !important;
    background-color: #fde2e2 !important;
}

.crm-row-no-followup,
.crm-row-no-followup > td,
tr.row-followup-none,
tr.row-followup-none td {
    background: #fff0dc !important;
    background-color: #fff0dc !important;
}

.crm-row-scheduled,
.crm-row-scheduled > td,
tr.row-followup-scheduled,
tr.row-followup-scheduled td {
    background: #e8f8ef !important;
    background-color: #e8f8ef !important;
}

.crm-row-unassigned,
.crm-row-unassigned > td,
tr.row-followup-unassigned,
tr.row-followup-unassigned td {
    background: #eef4ff !important;
    background-color: #eef4ff !important;
    color: #64748b;
}

.crm-row-closed,
.crm-row-closed > td,
tr.row-followup-closed,
tr.row-followup-closed td {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
    color: #64748b;
}

.crm-followup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.crm-badge-overdue {
    background: #dc2626;
    color: #fff;
}

.crm-badge-no-followup {
    background: #f97316;
    color: #fff;
}

.crm-badge-unassigned {
    background: #64748b;
    color: #fff;
}

.crm-badge-scheduled {
    background: #16a34a;
    color: #fff;
}

.crm-badge-closed {
    background: #64748b;
    color: #fff;
}

.crm-badge-normal {
    background: #e2e8f0;
    color: #475569;
}

.crm-followup-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.crm-followup-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.crm-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.crm-legend-dot.is-overdue {
    background: #dc2626;
}

.crm-legend-dot.is-new {
    background: #0b57d0;
}

.crm-legend-dot.is-unassigned {
    background: #64748b;
}

.crm-legend-dot.is-no-followup {
    background: #f97316;
}

.crm-legend-dot.is-scheduled {
    background: #16a34a;
}

.crm-legend-dot.is-closed {
    background: #64748b;
}

.card-header,
.modal-header {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    border-bottom: 1px solid var(--crm-border);
}

.card-title,
.card-header strong,
.section-title,
.crm-section-title h4 {
    color: var(--crm-text);
    font-weight: 700;
}

.crm-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 24%),
        linear-gradient(135deg, #102133 0%, #1f4564 58%, #2f6b73 100%);
    color: #fff;
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.14);
}

.crm-hero h3,
.crm-hero h4 {
    color: #fff;
    margin-bottom: 8px;
}

.crm-hero p {
    margin: 0;
    color: rgba(255,255,255,0.82);
}

.crm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.crm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.crm-kpi-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    box-shadow: var(--crm-shadow);
}

.crm-kpi-label {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-kpi-value {
    margin-top: 8px;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    color: var(--crm-text);
}

.crm-kpi-sub {
    margin-top: 8px;
    color: var(--crm-muted);
    font-size: 12px;
}

.crm-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.crm-integration-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--crm-border);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: var(--crm-shadow);
}

.crm-section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.crm-section-title p {
    margin: 4px 0 0;
    color: var(--crm-muted);
    font-size: 13px;
}

.crm-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-timeline-item {
    position: relative;
    padding: 16px 16px 16px 24px;
    border-radius: 18px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
}

.crm-timeline-item::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 22px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crm-accent);
}

.crm-empty {
    padding: 28px 20px;
    text-align: center;
    border: 1px dashed var(--crm-border);
    border-radius: 18px;
    background: var(--crm-surface-alt);
    color: var(--crm-muted);
}

.crm-help-message {
    max-width: 88%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.6;
}

.crm-help-message strong {
    display: block;
    margin-bottom: 4px;
}

.crm-help-message p {
    margin: 0;
}

.crm-help-message-bot {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border: 1px solid rgba(216, 224, 235, 0.92);
    color: var(--crm-text);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.crm-help-message-user {
    margin-left: auto;
    background: linear-gradient(135deg, #bd8a4e, #8b5826);
    color: #ffffff;
}

.crm-help-chip {
    border: 1px solid rgba(216, 224, 235, 0.94);
    background: #ffffff;
    color: var(--crm-text);
    border-radius: 999px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.table {
    border-color: rgba(219, 228, 238, 0.92);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbfe !important;
    color: var(--crm-text) !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--crm-border) !important;
}

.table tbody td {
    color: #314255 !important;
    border-color: rgba(219, 228, 238, 0.75) !important;
}

.table tbody tr:hover td {
    background: #f8fbfe !important;
}

.table-responsive {
    border-radius: 18px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper {
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
}

.dataTables_wrapper > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.dataTables_wrapper > .row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.dataTables_wrapper > .row.align-items-center.mb-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dataTables_wrapper > .row.align-items-center.mb-2 > [class*="col-"] {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
}

.dataTables_wrapper > .row.dt-controls-single > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.dataTables_wrapper .dt-controls-left,
.dataTables_wrapper .dt-controls-right,
.dataTables_wrapper .dt-footer-left,
.dataTables_wrapper .dt-footer-right {
    display: flex !important;
    align-items: center;
    width: 100%;
}

.dataTables_wrapper .dt-controls-left,
.dataTables_wrapper .dt-footer-left {
    justify-content: flex-start;
}

.dataTables_wrapper .dt-controls-right,
.dataTables_wrapper .dt-footer-right {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_length {
    justify-content: flex-start;
}

.dataTables_wrapper .dataTables_filter {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    float: none !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: flex !important;
    align-items: center;
    margin-bottom: 14px !important;
    padding-top: 8px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_filter input {
    width: 360px;
    max-width: min(100%, 360px);
    min-width: 240px !important;
    margin-left: 0 !important;
}

.dataTables_wrapper .dataTables_length select {
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_length label {
    justify-content: flex-start;
}

.dataTables_wrapper .dataTables_filter label {
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px !important;
}

.dataTables_wrapper .dataTables_scroll {
    width: 100%;
}

.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollBody {
    border-radius: 0 !important;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.dataTables_wrapper .dataTables_scrollHead table,
.dataTables_wrapper .dataTables_scrollBody table {
    width: 100% !important;
}

.form-control,
.custom-select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 42px;
    border-radius: 12px !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: none !important;
}

.form-control:focus,
.custom-select:focus,
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: rgba(183, 110, 34, 0.48) !important;
    box-shadow: 0 0 0 3px rgba(183, 110, 34, 0.12) !important;
}

textarea.form-control {
    min-height: 110px;
}

label,
.form-group label {
    color: var(--crm-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    min-height: 40px;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    line-height: 1.15 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0 14px !important;
}

.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fab,
.btn .ti {
    margin-right: 0 !important;
    line-height: 1 !important;
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px !important;
}

.crm-kpi-card .btn,
.crm-kpi-card .btn-sm {
    min-height: 36px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
}

.table td,
.table th {
    vertical-align: middle !important;
}

.table thead th {
    text-align: left;
}

.table-responsive {
    border-radius: 16px;
}

@media (max-width: 767px) {
    .dataTables_wrapper > .row.align-items-center.mb-2 {
        display: block;
    }

    .dataTables_wrapper > .row.align-items-center.mb-2 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dataTables_wrapper .dt-controls-left,
    .dataTables_wrapper .dt-controls-right,
    .dataTables_wrapper .dt-footer-left,
    .dataTables_wrapper .dt-footer-right {
        justify-content: flex-start;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        min-width: 0 !important;
    }

    .dataTables_wrapper .dataTables_filter label {
        justify-content: flex-start;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--crm-accent), var(--crm-accent-dark)) !important;
    border-color: var(--crm-accent-dark) !important;
}

.btn-outline-secondary {
    border-color: var(--crm-border) !important;
    color: var(--crm-text) !important;
}

.btn-outline-secondary:hover {
    background: #eef4fa !important;
}

.alert {
    border-radius: 16px !important;
    border-width: 1px !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.04);
}

.badge,
.status-badge,
.role-badge,
.access-pill,
.crm-badge {
    border-radius: 999px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

.modal-content {
    border-radius: 22px !important;
    border: 1px solid var(--crm-border) !important;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.2) !important;
}

.modal-dialog {
    margin: 1rem auto;
}

.modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.crm-form-card {
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.06);
    border: none;
}

.crm-form-card .card-body {
    padding: 28px;
}

.crm-section-heading {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 18px;
}

.crm-info-note {
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    color: #0c5460;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.required-star {
    color: #dc3545;
}

.settings-logo-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    min-width: 160px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid #dbe4ee;
    background: #fff;
}

.settings-logo-preview img {
    max-width: 140px;
    max-height: 54px;
}

@media (max-width: 1199px) {
    .crm-kpi-grid,
    .crm-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .crm-kpi-grid,
    .crm-mini-grid {
        grid-template-columns: 1fr;
    }

    .crm-form-card .card-body {
        padding: 18px;
    }
}

.card,
.section-card,
.users-panel,
.form-card,
.cp-card,
.crm-form-card,
.report-section-card,
.report-chart-box,
.report-table-wrap {
    border-radius: var(--crm-radius-md) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
}

.card-body,
.section-card .card-body,
.users-panel .card-body {
    padding: 16px !important;
}

.card-header,
.modal-header {
    padding: 12px 16px;
}

.crm-hero {
    border-radius: var(--crm-radius-lg);
    padding: 18px;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.crm-hero h3,
.crm-hero h4 {
    margin-bottom: 6px;
}

.crm-chip-row {
    gap: 8px;
    margin-top: 12px;
}

.crm-chip {
    gap: 6px;
    padding: 8px 12px;
    font-size: 11px;
}

.crm-kpi-grid,
.crm-mini-grid {
    gap: 12px;
    margin: 12px 0;
}

.crm-kpi-card,
.crm-integration-card {
    padding: 14px;
    border-radius: 14px;
}

.crm-kpi-label {
    font-size: 10.5px;
}

.crm-kpi-value {
    margin-top: 6px;
    font-size: 24px;
}

.crm-kpi-sub {
    margin-top: 6px;
    font-size: 11px;
}

.crm-section-title {
    gap: 10px;
    margin-bottom: 12px;
}

.crm-section-title p {
    font-size: 12px;
}

.crm-timeline {
    gap: 10px;
}

.crm-timeline-item {
    padding: 12px 12px 12px 18px;
    border-radius: 14px;
}

.crm-timeline-item::before {
    left: 8px;
    top: 18px;
    width: 7px;
    height: 7px;
}

.crm-empty {
    padding: 20px 16px;
    border-radius: 14px;
    font-size: 12px;
}

.table-responsive {
    border-radius: 14px;
}

.table th,
.table td {
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.35;
}

.table thead th {
    font-size: 10.5px;
    letter-spacing: 0.03em;
}

.dataTables_wrapper > .row.align-items-center.mb-2 {
    gap: 12px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 10px !important;
    padding-top: 4px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    gap: 8px;
    font-size: 12px;
}

.dataTables_wrapper .dataTables_filter input {
    width: 280px;
    max-width: min(100%, 280px);
    min-width: 180px !important;
}

.form-group {
    margin-bottom: 12px;
}

.form-control,
.custom-select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 36px;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 12.5px;
}

textarea.form-control {
    min-height: 84px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

label,
.form-group label {
    font-size: 11px;
    margin-bottom: 6px;
}

.btn {
    min-height: 34px;
    padding: 0 12px !important;
    border-radius: 10px !important;
    gap: 6px !important;
    font-size: 12px !important;
}

.btn-sm {
    min-height: 30px;
    padding: 0 10px !important;
    font-size: 11.5px !important;
}

.alert {
    border-radius: 12px !important;
    padding: 12px 14px !important;
}

.badge,
.status-badge,
.role-badge,
.access-pill,
.crm-badge {
    padding: 5px 9px !important;
    font-size: 10.5px !important;
}

.modal-content {
    border-radius: 16px !important;
}

.crm-form-card .card-body {
    padding: 18px;
}

.crm-section-heading {
    font-size: 16px;
    margin-bottom: 12px;
}

.crm-info-note {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 12.5px;
}

.settings-logo-preview {
    min-height: 64px;
    min-width: 132px;
    padding: 10px;
    border-radius: 14px;
}

.settings-logo-preview img {
    max-width: 112px;
    max-height: 40px;
}

@media (max-width: 767px) {
    .card-body,
    .section-card .card-body,
    .users-panel .card-body,
    .crm-form-card .card-body {
        padding: 12px !important;
    }

    .table th,
    .table td {
        padding: 8px;
        font-size: 11.5px;
    }

    .btn {
        min-height: 36px;
    }

    .form-control,
    .custom-select,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        min-height: 44px;
        font-size: 16px !important;
    }

    .input-group > .form-control,
    .input-group > .custom-select {
        min-width: 0;
    }

    .table-responsive {
        border-radius: 12px;
    }

    .table {
        min-width: 640px;
    }

    .modal-dialog {
        width: calc(100% - 16px);
        max-width: none;
        margin: 8px auto;
    }

    .modal-content {
        border-radius: 14px !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 12px;
        padding-right: 12px;
    }

    .modal-body {
        max-height: calc(100vh - 110px);
    }
}

@media (max-width: 575px) {
    .btn,
    .btn-sm {
        width: 100%;
    }

    .btn-group .btn,
    .btn-group-sm .btn,
    .table td .btn,
    .table th .btn,
    .dataTables_wrapper .paginate_button {
        width: auto;
    }

    .card-header,
    .modal-header {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
}

/* Compact interaction layer for mobile CRM use */
.table-responsive {
    position: relative;
}

@media (max-width: 991px) {
    .card,
    .section-card,
    .crm-form-card,
    .modal-content {
        border-radius: 18px !important;
    }

    .card-body,
    .section-card .card-body,
    .users-panel .card-body,
    .crm-form-card .card-body {
        padding: 16px !important;
    }

    .table-responsive {
        border-radius: 16px;
    }

    .table-responsive::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 18px;
        pointer-events: none;
        background: linear-gradient(270deg, rgba(248, 250, 252, 0.95) 0%, rgba(248, 250, 252, 0) 100%);
    }

    .dataTables_wrapper > .row,
    .dataTables_wrapper > .row.align-items-center.mb-2 {
        row-gap: 10px;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
    }

    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
    }

    .form-control,
    .custom-select,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        min-height: 46px;
        border-radius: 12px;
    }

    textarea.form-control {
        min-height: 112px;
    }

    .btn,
    .btn-sm {
        min-height: 40px;
        border-radius: 12px !important;
        font-weight: 700;
    }

    .btn i,
    .btn .fa,
    .btn .fas,
    .btn .far,
    .btn .fab,
    .btn .ti {
        font-size: 0.95em;
    }

    .input-group {
        flex-wrap: nowrap;
    }

    .modal-dialog {
        width: calc(100% - 20px);
        max-width: none;
        margin: 10px auto;
    }

    .modal-body {
        max-height: calc(100vh - 124px);
        overflow-y: auto;
    }
}

@media (max-width: 767px) {
    .card-body,
    .section-card .card-body,
    .users-panel .card-body,
    .crm-form-card .card-body {
        padding: 14px !important;
    }

    .table th,
    .table td {
        padding: 9px 8px;
        font-size: 12px;
    }

    .table {
        min-width: 560px;
    }

    .dataTables_wrapper .dataTables_info {
        padding-top: 2px !important;
    }

    .dataTables_wrapper .dataTables_paginate {
        padding-top: 0 !important;
    }
}

@media (max-width: 575px) {
    .btn,
    .btn-sm {
        width: auto;
        min-width: 44px;
    }

    .btn-block,
    .w-100,
    input[type="submit"].btn,
    button[type="submit"].btn:not(.btn-link) {
        width: 100%;
    }

    .table-responsive::after {
        width: 12px;
    }
}

/* Compact professional admin system */
.card,
.section-card,
.crm-form-card,
.users-panel,
.modal-content {
    border-radius: 16px !important;
}

.card-header,
.section-card .card-header,
.modal-header {
    padding: 12px 16px;
}

.card-body,
.section-card .card-body,
.users-panel .card-body,
.crm-form-card .card-body,
.modal-body {
    padding: 16px !important;
}

.card-footer,
.modal-footer {
    padding: 12px 16px;
}

.card-title,
.section-title,
.modal-title,
.crm-section-title {
    margin-bottom: 0;
    font-size: 0.96rem;
    line-height: 1.25;
}

.card-subtitle,
.text-muted.small,
small.form-text {
    line-height: 1.4;
}

.form-group,
.form-row,
.filter-group,
.cp-filter-group {
    margin-bottom: 12px;
}

label,
.form-label {
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.form-control,
.custom-select,
.input-group-text,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
}

textarea.form-control {
    min-height: 104px;
    padding-top: 10px;
}

.input-group > .form-control,
.input-group > .custom-select {
    min-width: 0;
}

.btn,
.btn-sm,
.btn-lg {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px !important;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}

.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fab,
.btn .mdi,
.btn .ti {
    margin-right: 5px;
    font-size: 0.95em;
    vertical-align: middle;
}

.btn-icon,
.action-btns .btn,
.cp-action-btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge,
.badge-pill,
.status-badge,
.crm-chip {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.table-responsive {
    border-radius: 14px;
}

.table {
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 11px 12px;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.table td .btn,
.table th .btn {
    margin: 0;
}

.dataTables_wrapper > .row {
    row-gap: 10px;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    margin-bottom: 0;
    font-size: 0.82rem;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 8px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 8px !important;
    font-size: 0.82rem;
}

.dataTables_wrapper .paginate_button {
    min-height: 34px;
    border-radius: 9px !important;
    padding: 6px 10px !important;
}

.filters-card,
.cp-filters-card,
.filter-panel {
    padding: 14px;
    border-radius: 14px;
}

.filter-actions,
.cp-filter-actions,
.top-actions {
    gap: 8px;
}

.modal-header,
.modal-footer {
    gap: 8px;
}

.modal-body .row {
    row-gap: 10px;
}

.alert,
.crm-info-note {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

@media (max-width: 991px) {
    .card-header,
    .section-card .card-header,
    .modal-header,
    .card-footer,
    .modal-footer {
        padding: 11px 14px;
    }

    .card-body,
    .section-card .card-body,
    .users-panel .card-body,
    .crm-form-card .card-body,
    .modal-body {
        padding: 14px !important;
    }

    .table th,
    .table td {
        padding: 10px;
    }
}

@media (max-width: 767px) {
    .card,
    .section-card,
    .crm-form-card,
    .modal-content {
        border-radius: 14px !important;
    }

    .card-header,
    .section-card .card-header,
    .modal-header,
    .card-footer,
    .modal-footer {
        padding: 10px 12px;
    }

    .card-body,
    .section-card .card-body,
    .users-panel .card-body,
    .crm-form-card .card-body,
    .modal-body {
        padding: 12px !important;
    }

    .form-group,
    .form-row,
    .filter-group,
    .cp-filter-group {
        margin-bottom: 10px;
    }

    .table th,
    .table td {
        padding: 9px 8px;
    }

    .btn,
    .btn-sm,
    .btn-lg {
        min-height: 40px;
        padding: 8px 12px;
    }
}

.filters-row,
.filters-toolbar,
.cp-filters-row,
.report-filter-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.filter-group,
.cp-filter-group,
.report-filter-group {
    grid-column: span 3;
    min-width: 0;
}

.filter-group.filter-group-search,
.filter-group.filter-group-wide,
.cp-filter-group.filter-group-search,
.cp-filter-group.cp-filter-group-wide,
.report-filter-group.filter-group-wide {
    grid-column: span 6;
}

.filters-row-actions,
.cp-filters-row.filters-row-actions {
    grid-template-columns: 1fr auto;
}

.filters-row-actions .filter-actions,
.cp-filters-row.filters-row-actions .cp-filter-actions,
.report-filter-actions {
    justify-content: flex-end;
}

.filters-toolbar .filter-actions {
    grid-column: span 3;
    justify-content: flex-end;
}

.filters-card,
.cp-filters-card,
.filter-panel {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.form-control,
.custom-select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 40px;
}

.crm-mobile-filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    margin: 0 0 10px;
    padding: 0 14px;
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    background: #fff;
    color: var(--crm-text);
    box-shadow: var(--crm-shadow);
    font-size: 12px;
    font-weight: 700;
}

.crm-mobile-filter-toggle:hover,
.crm-mobile-filter-toggle:focus {
    outline: none;
    border-color: rgba(183, 110, 34, 0.32);
}

.crm-mobile-filter-toggle__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.crm-mobile-filter-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--crm-accent-soft);
    color: var(--crm-accent-dark);
    font-size: 10px;
    font-weight: 800;
}

.crm-mobile-filter-toggle__count.is-hidden {
    display: none;
}

.crm-mobile-filter-toggle__icon {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.crm-mobile-filter-toggle.is-open .crm-mobile-filter-toggle__icon {
    transform: rotate(-135deg);
}

.crm-collapsible-filter-panel {
    transition: max-height 0.22s ease, opacity 0.22s ease, transform 0.22s ease, padding 0.22s ease, margin 0.22s ease, border-width 0.22s ease;
}

.crm-table-cards-mobile td::before {
    content: attr(data-label);
    display: none;
}

.crm-card-table-wrap {
    min-width: 0;
}

@media (max-width: 1199px) {
    .filter-group,
    .cp-filter-group,
    .report-filter-group {
        grid-column: span 4;
    }

    .filter-group.filter-group-search,
    .filter-group.filter-group-wide,
    .cp-filter-group.filter-group-search,
    .cp-filter-group.cp-filter-group-wide,
    .report-filter-group.filter-group-wide {
        grid-column: span 6;
    }

    .filters-toolbar .filter-actions {
        grid-column: span 6;
    }
}

@media (max-width: 991px) {
    .crm-mobile-filter-toggle {
        display: inline-flex;
    }

    .filters-row,
    .filters-toolbar,
    .cp-filters-row,
    .report-filter-row,
    .filters-row-actions,
    .cp-filters-row.filters-row-actions {
        grid-template-columns: 1fr;
    }

    .filter-group,
    .cp-filter-group,
    .report-filter-group,
    .filter-group.filter-group-search,
    .filter-group.filter-group-wide,
    .cp-filter-group.filter-group-search,
    .cp-filter-group.cp-filter-group-wide,
    .report-filter-group.filter-group-wide {
        grid-column: auto;
    }

    .filters-row-actions .filter-actions,
    .filters-toolbar .filter-actions,
    .cp-filters-row.filters-row-actions .cp-filter-actions,
    .report-filter-actions {
        justify-content: stretch;
    }

    .filters-row-actions .btn,
    .filters-toolbar .btn,
    .cp-filters-row.filters-row-actions .btn,
    .report-filter-actions .btn {
        flex: 1 1 0;
    }

    .crm-collapsible-filter-panel.is-collapsed {
        max-height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        border-top-width: 0 !important;
        border-bottom-width: 0 !important;
        overflow: hidden !important;
        opacity: 0;
        transform: translateY(-4px);
    }

    .crm-collapsible-filter-panel:not(.is-collapsed) {
        max-height: 1400px;
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .crm-card-table-wrap,
    .crm-card-table-wrap.dt-managed-scroll,
    .crm-card-table-wrap .dataTables_wrapper,
    .crm-card-table-wrap .dataTables_scroll,
    .crm-card-table-wrap .dataTables_scrollBody {
        overflow: visible !important;
    }

    .crm-card-table-wrap,
    .crm-card-table-wrap.dt-managed-scroll {
        border: 0 !important;
        background: transparent !important;
    }

    .crm-table-cards-mobile {
        border: 0;
    }

    .crm-table-cards-mobile thead {
        display: none;
    }

    .crm-table-cards-mobile,
    .crm-table-cards-mobile tbody,
    .crm-table-cards-mobile tr,
    .crm-table-cards-mobile td {
        display: block;
        width: 100% !important;
    }

    .crm-table-cards-mobile tbody tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--crm-border);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .crm-table-cards-mobile tbody td {
        padding: 0;
        margin-bottom: 10px;
        border: 0 !important;
    }

    .crm-table-cards-mobile tbody td:last-child {
        margin-bottom: 0;
        padding-top: 4px;
    }

    .crm-table-cards-mobile td::before {
        display: block;
        margin-bottom: 4px;
        color: var(--crm-muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .crm-table-cards-mobile .action-btns,
    .crm-table-cards-mobile .cp-action-btns {
        width: 100%;
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .crm-table-cards-mobile .action-btns .btn,
    .crm-table-cards-mobile .cp-action-btns .btn {
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .crm-table-cards-mobile .assign-form,
    .crm-table-cards-mobile .cp-assign-form {
        gap: 8px;
    }

    .crm-table-cards-mobile .assigned-cell,
    .crm-table-cards-mobile .cp-col-assigned {
        min-width: 0 !important;
        width: auto !important;
    }
}

/* Shared action-row alignment */
.filter-actions,
.cp-filter-actions,
.top-actions,
.report-filter-actions,
.crm-form-actions,
.modal-footer,
.report-toolbar,
.crm-bulk-toolbar__buttons,
.team-performance-filter-actions,
.team-performance-filter-actions--detail,
.project-report-export-wrap,
.report-page .crm-filter-actions-row,
.report-page-shell .crm-filter-actions-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.filter-actions .btn,
.cp-filter-actions .btn,
.top-actions .btn,
.report-filter-actions .btn,
.crm-form-actions .btn,
.modal-footer .btn,
.report-toolbar .btn,
.crm-bulk-toolbar__buttons .btn,
.team-performance-filter-actions .btn,
.team-performance-filter-actions--detail .btn,
.project-report-export-wrap .btn,
.report-page .crm-filter-actions-row .btn,
.report-page-shell .crm-filter-actions-row .btn {
    margin: 0;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .filter-actions,
    .cp-filter-actions,
    .top-actions,
    .report-filter-actions,
    .crm-form-actions,
    .modal-footer,
    .report-toolbar,
    .crm-bulk-toolbar__buttons,
    .team-performance-filter-actions,
    .team-performance-filter-actions--detail,
    .project-report-export-wrap,
    .report-page .crm-filter-actions-row,
    .report-page-shell .crm-filter-actions-row {
        flex-direction: row !important;
        align-items: center !important;
    }
}

@media (max-width: 767px) {
    .filter-actions,
    .cp-filter-actions,
    .top-actions,
    .report-filter-actions,
    .crm-form-actions,
    .modal-footer,
    .report-toolbar,
    .crm-bulk-toolbar__buttons,
    .team-performance-filter-actions,
    .team-performance-filter-actions--detail,
    .project-report-export-wrap,
    .report-page .crm-filter-actions-row,
    .report-page-shell .crm-filter-actions-row {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }

    .filter-actions .btn,
    .cp-filter-actions .btn,
    .top-actions .btn,
    .report-filter-actions .btn,
    .crm-form-actions .btn,
    .modal-footer .btn,
    .report-toolbar .btn,
    .crm-bulk-toolbar__buttons .btn,
    .team-performance-filter-actions .btn,
    .team-performance-filter-actions--detail .btn,
    .project-report-export-wrap .btn,
    .report-page .crm-filter-actions-row .btn,
    .report-page-shell .crm-filter-actions-row .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
}
