﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700&display=swap');

:root {
    --crm-bg: #f6f8fb;
    --crm-text: #1a1d2e;
    --crm-muted: #5e6782;
    --crm-border: #e0e4ed;
    --crm-surface-border: #d5dbe8;
    --crm-surface-shadow: 0 1px 3px rgba(26, 29, 46, 0.04), 0 8px 20px rgba(26, 29, 46, 0.045);
    --crm-primary: #4F6AC7;
    --crm-primary-soft: rgba(79, 106, 199, 0.13);
    --crm-primary-hover: #3D56AE;
    --crm-accent-purple: #7C5CBF;
    --crm-accent-teal: #24A3B5;
    --crm-sidebar: #151B2B;
    --crm-sidebar-accent: #1F2940;
}

/* Override Bootstrap primary to match workvibes brand */
.btn-primary {
    --bs-btn-bg: #4F6AC7;
    --bs-btn-border-color: #4F6AC7;
    --bs-btn-hover-bg: #3D56AE;
    --bs-btn-hover-border-color: #3D56AE;
    --bs-btn-active-bg: #334A9A;
    --bs-btn-active-border-color: #334A9A;
    --bs-btn-disabled-bg: #4F6AC7;
    --bs-btn-disabled-border-color: #4F6AC7;
}

.btn-outline-primary {
    --bs-btn-color: #4F6AC7;
    --bs-btn-border-color: #4F6AC7;
    --bs-btn-hover-bg: #4F6AC7;
    --bs-btn-hover-border-color: #4F6AC7;
    --bs-btn-active-bg: #3D56AE;
    --bs-btn-active-border-color: #3D56AE;
}

body.crm-body {
    font-family: 'Inter', sans-serif;
    background: var(--crm-bg);
    color: var(--crm-text);
}

.crm-app {
    display: flex;
    min-height: 100vh;
}

.crm-main-col {
    min-width: 0;
}

.crm-sidebar {
    width: 260px;
    min-width: 260px;
    flex: 0 0 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--crm-sidebar);
    color: #e2e8f0;
    border-right: 1px solid #15202e;
}

.crm-sidebar-content {
    flex: 1 1 auto;
    overflow-y: auto;
}

.crm-brand {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.crm-brand-dot {
    color: #36B8CC;
}

/* Sidebar logo mark */
.crm-sidebar-logo {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #4F6AC7 0%, #7C5CBF 50%, #36B8CC 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(79, 106, 199, 0.4);
}

.crm-sidebar-logo-letter {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.crm-sidebar .nav-link {
    color: rgba(226, 232, 240, 0.7);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

.crm-sidebar .nav-link.active,
.crm-sidebar .nav-link:hover {
    background: var(--crm-sidebar-accent);
    color: #fff;
}

.crm-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(79, 106, 199, 0.22) 0%, rgba(124, 92, 191, 0.16) 100%);
    border-left: 2px solid #7C5CBF;
    color: #e2e8f0;
}

.crm-sidebar-heading {
    color: rgba(226, 232, 240, 0.534);
    letter-spacing: 0.08em;
}

.crm-filter-toggle[aria-expanded="true"],
.crm-filter-toggle[aria-expanded="true"]:hover {
    background: var(--crm-primary-soft);
    border-color: var(--crm-primary);
    color: var(--crm-primary);
    display: flex;
    justify-content: center;
    align-items: center;
}

.crm-filter-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(79, 106, 199, 0.13);
    margin-left: 0.5rem;
}

.crm-header {
    height: 60px;
    max-width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--crm-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.crm-header-inner {
    min-height: 60px;
    min-width: 0;
    gap: 0.75rem;
}

.crm-header-search {
    width: min(340px, 100%);
    min-width: 0;
    flex-shrink: 1;
}

.crm-search-icon {
    left: 12px;
    color: #94a3b8;
}

.crm-search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 0.1rem 0.35rem;
    line-height: 1.4;
    pointer-events: none;
    letter-spacing: 0.02em;
}

.crm-header-date {
    font-size: 0.8rem;
    color: var(--crm-muted);
    white-space: nowrap;
    gap: 0.35rem;
}

.crm-header-date i {
    font-size: 0.85rem;
}

.crm-header-divider {
    width: 1px;
    height: 28px;
    background: var(--crm-border);
    flex-shrink: 0;
}

.crm-header-add-btn {
    background: var(--crm-primary);
    color: #fff;
    border-color: var(--crm-primary);
}

.crm-header-add-btn:hover,
.crm-header-add-btn:focus-visible {
    background: var(--crm-primary-hover);
    color: #fff;
    border-color: var(--crm-primary-hover);
}

.crm-header-notif-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border: 1.5px solid #fff;
    border-radius: 50%;
}

.crm-quick-add-menu {
    min-width: 14rem;
}

.crm-quick-add-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--crm-muted);
    padding-bottom: 0.25rem;
}

.crm-dropdown-user-info {
    padding: 0.5rem 0.6rem 0.35rem;
}

.crm-dropdown-user-info .fw-semibold {
    font-size: 0.88rem;
    color: var(--crm-text);
}

/* ── Notification panel ─────────────────────── */
.crm-notif-wrap {
    position: relative;
}

.crm-notif-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: -1rem;
    width: 370px;
    max-height: 480px;
    background: #fff;
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.03);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.crm-notif-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0s;
}

.crm-notif-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.crm-notif-header-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--crm-text);
}

.crm-notif-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.12rem 0.42rem;
    line-height: 1.3;
}

.crm-notif-mark-all {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--crm-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    transition: background-color 0.12s ease;
}

.crm-notif-mark-all:hover {
    background: var(--crm-primary-soft);
}

.crm-notif-body {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #d1d9e2 transparent;
}

.crm-notif-item {
    display: grid;
    grid-template-columns: 36px 1fr 8px;
    gap: 0.55rem;
    align-items: start;
    padding: 0.6rem 0.9rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #f4f6f8;
    transition: background-color 0.1s ease;
}

.crm-notif-item:last-child {
    border-bottom: 0;
}

.crm-notif-item:hover {
    background: #f8fafc;
}

.crm-notif-unread {
    background: rgba(79, 106, 199, 0.04);
}

.crm-notif-unread:hover {
    background: rgba(79, 106, 199, 0.08);
}

.crm-notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    background: #f1f5f9;
    color: var(--crm-muted);
    flex-shrink: 0;
}

.crm-notif-icon-red {
    background: rgba(239, 68, 68, 0.10);
    color: #dc2626;
}

.crm-notif-icon-amber {
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
}

.crm-notif-icon-green {
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
}

.crm-notif-icon-blue {
    background: rgba(79, 106, 199, 0.12);
    color: #4F6AC7;
}

.crm-notif-icon-teal {
    background: rgba(36, 163, 181, 0.10);
    color: #0e7490;
}

.crm-notif-icon-purple {
    background: rgba(124, 92, 191, 0.10);
    color: #7C5CBF;
}

.crm-notif-item-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.crm-notif-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--crm-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-notif-item-body {
    font-size: 0.74rem;
    color: var(--crm-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-notif-item-time {
    font-size: 0.68rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.1rem;
}

.crm-notif-item-time i {
    font-size: 0.62rem;
}

.crm-notif-item-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--crm-primary);
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.crm-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: #94a3b8;
    font-size: 0.84rem;
}

.crm-notif-empty i {
    font-size: 1.6rem;
    opacity: 0.4;
}

.crm-content {
    padding: 0;
    min-width: 0;
}

.crm-card {
    border: 1px solid var(--crm-surface-border);
    border-radius: 14px;
    box-shadow: var(--crm-surface-shadow);
}

.crm-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--crm-surface-border);
}

.crm-badge-soft {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

.crm-badge-rule {
    background: rgba(14, 116, 144, 0.12);
    color: #0e7490;
}

.crm-badge-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.crm-muted {
    color: var(--crm-muted);
}

.crm-client-form {
    display: grid;
    gap: 0.95rem;
}

.crm-form-section .card-header {
    padding: 0.85rem 1rem 0.8rem;
}

.crm-form-section .card-body {
    padding: 1rem;
}

.crm-form-divider {
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--crm-border);
    color: var(--crm-muted);
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.crm-invoice-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--crm-border);
    border-radius: 12px;
    background: #f8fafc;
}

.crm-invoice-control {
    min-width: 0;
}

.crm-invoice-control .form-label {
    margin-bottom: 0.35rem;
}

.crm-invoice-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.crm-invoice-control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 38px;
    white-space: nowrap;
}

.crm-pricing-locked {
    background-color: #f1f5f9;
    color: var(--crm-muted);
    cursor: not-allowed;
}

[data-invoice-items-table] {
    border-collapse: separate;
    border-spacing: 0 0.65rem;
}

[data-invoice-items-table] thead th {
    padding-bottom: 0.35rem;
}

[data-invoice-item-row] tr:first-child td {
    border-top: 1px solid var(--crm-border);
    background: #fff;
}

[data-invoice-item-row] tr:first-child td:first-child {
    border-top-left-radius: 10px;
}

[data-invoice-item-row] tr:first-child td:last-child {
    border-top-right-radius: 10px;
}

[data-invoice-item-row] tr:last-child td {
    border-bottom: 1px solid var(--crm-border);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #fff;
}

.invoice-table tbody[data-invoice-item-row]+tbody[data-invoice-item-row]::before {
    content: "";
    display: table-row;
    height: 5px;
}

@media (max-width: 575.98px) {
    .crm-invoice-control-row {
        grid-template-columns: 1fr;
    }

    .crm-invoice-control-btn {
        width: 100%;
    }
}

.invoice-total-summary {
    width: min(420px, 100%);
    margin-left: auto;
    border-top: 1px solid var(--crm-border);
    padding-top: 0.7rem;
}

.invoice-total-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.28rem 0;
    color: var(--crm-muted);
    font-size: 0.9rem;
}

.invoice-total-summary-row strong {
    color: var(--crm-text);
    font-weight: 700;
    white-space: nowrap;
}

.invoice-total-summary-row-final {
    margin-top: 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--crm-border);
    color: var(--crm-text);
    font-size: 1rem;
}

.crm-supplier-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.crm-supplier-type-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    color: var(--crm-text);
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.crm-supplier-type-option i {
    color: var(--crm-muted);
}

.btn-check:checked+.crm-supplier-type-option {
    border-color: var(--crm-primary);
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

.btn-check:checked+.crm-supplier-type-option i {
    color: var(--crm-primary);
}

.crm-client-form .contact-row {
    padding: 0.6rem 0.55rem;
    border: 1px solid var(--crm-surface-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.crm-client-form .contact-row .form-label {
    margin-bottom: 0.3rem;
}

.crm-form-actions {
    margin-top: 0.25rem;
}

/* в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ
   Client Edit / Create Form (.crm-edit-*)
   в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

/* Back arrow button */
.crm-edit-back {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    border: 1px solid #d1d9e2;
    background: #fff;
    color: var(--crm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.crm-edit-back:hover {
    background: #f1f5f9;
    border-color: #a8b5d4;
    color: var(--crm-primary);
}

/* Avatar in edit hero */
.crm-edit-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* New-client icon placeholder (create page) */
.crm-edit-new-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

/* Edit-mode badge */
.crm-edit-mode-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--crm-primary);
    background: var(--crm-primary-soft);
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    line-height: 1.35;
}

/* Section cards */
.crm-edit-section {
    border-color: #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.crm-edit-section .card-header {
    padding: 0.9rem 1.1rem 0.8rem;
    border-bottom-color: #d1d9e2;
}

.crm-edit-section .card-body {
    padding: 1.1rem;
}

/* Section icon */
.crm-edit-section-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex: 0 0 auto;
}

/* Contact remove button */
.crm-edit-contact-remove {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--crm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    margin-bottom: 1px;
}

.crm-edit-contact-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* Footer actions (bottom of form) */
.crm-edit-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.25rem;
}

@media (max-width: 767.98px) {
    .crm-edit-form-footer {
        flex-direction: column;
    }

    .crm-edit-form-footer .btn {
        width: 100%;
    }
}

.crm-client-hero {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    position: relative;
    z-index: 2;
    overflow: visible;
}

.crm-client-page-body {
    position: relative;
    z-index: 1;
    padding: 18px 150px;
    background: #f4f6f8;
}

.crm-client-hero-head {
    padding: 12px 24px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-client-hero .card-body {
    padding: 1.5rem;
}

.crm-client-avatar {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.crm-client-stat-card .card-body {
    padding: 0.85rem 0.95rem;
}

.crm-client-hero-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 11px;
    padding: 0.28rem 0.62rem;
    min-height: 32px;
    font-size: 0.8125rem;
    line-height: 1;
    font-weight: 500;
}

.crm-client-hero-actions .btn i {
    line-height: 1;
}

.crm-client-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.crm-client-menu-btn:hover {
    transform: none;
    background-color: #eef2f7;
    border-color: #dee2e6;
}

.crm-client-hero .dropdown-menu {
    z-index: 1060;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 0.35rem;
    min-width: 12rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.crm-client-hero .dropdown-menu.show {
    animation: crm-dropdown-fade-in 0.14s ease-out;
}

.crm-client-hero .dropdown-item {
    border-radius: 8px;
    font-size: 0.86rem;
    padding: 0.43rem 0.58rem;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.crm-client-hero .dropdown-item:hover,
.crm-client-hero .dropdown-item:focus {
    background-color: #eef2f7;
}

.crm-client-hero .dropdown-divider {
    margin: 0.3rem 0;
}

@keyframes crm-dropdown-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.crm-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crm-client-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.55rem;
    color: var(--crm-muted);
}

.crm-client-stat-top i {
    font-size: 1rem;
    color: #4F6AC7;
    opacity: 0.9;
}

.crm-client-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.crm-client-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.crm-client-stat-money {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.crm-client-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.35rem;
    border: 1px solid var(--crm-surface-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
    margin-bottom: 0.8rem;
}

.crm-client-tabs .nav-link {
    border-radius: 9px;
    color: var(--crm-muted);
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
}

.crm-client-tabs .nav-link.active {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

/* в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ
   Client Show / Details Page (.crm-show-*)
   в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

/* Type & company badges in hero */
.crm-show-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    white-space: nowrap;
    line-height: 1.35;
}

.crm-show-company-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 500;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    line-height: 1.35;
}

/* Stats grid */
.crm-show-stats-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(max(200px, calc((100% - 1.95rem) / 4)), 1fr));
}

.crm-show-stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-show-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.crm-show-stat>div:last-child {
    min-width: 0;
}

.crm-show-stat-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

.crm-show-stat-icon-blue {
    background: rgba(79, 106, 199, 0.12);
    color: #4F6AC7;
}

.crm-show-stat-icon-indigo {
    background: rgba(124, 92, 191, 0.12);
    color: #7C5CBF;
}

.crm-show-stat-icon-teal {
    background: rgba(36, 163, 181, 0.12);
    color: #1A8F9F;
}

.crm-show-stat-icon-green {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.crm-show-stat-icon-amber {
    background: rgba(234, 130, 30, 0.12);
    color: #C86A12;
}

.crm-show-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-muted);
    line-height: 1.2;
    white-space: nowrap;
}

.crm-show-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--crm-text);
    white-space: nowrap;
}

.crm-interaction-service-case-value {
    white-space: normal;
    overflow-wrap: anywhere;
}

.crm-show-stat-money {
    font-size: 0.92rem;
}

/* Panel cards (tabs content) */
.crm-show-panel {
    border-color: #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.crm-show-panel .card-header {
    border-bottom-color: #d1d9e2;
}

/* Panel header icon */
.crm-show-panel-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

/* Empty states */
.crm-show-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
}

.crm-show-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.crm-show-empty-text {
    font-size: 0.86rem;
    color: var(--crm-muted);
}

@media (max-width: 767.98px) {
    .crm-show-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991.98px) {
    .crm-show-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-show-stats-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .crm-show-stats-grid {
        grid-template-columns: 1fr;
    }

    .crm-show-stats-grid-4 {
        grid-template-columns: 1fr;
    }
}

.crm-panel-card .card-header {
    padding: 0.62rem 0.78rem;
}

.crm-panel-card .card-body {
    padding: 0.78rem;
}

.crm-feed-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0.95rem;
    border-bottom: 1px solid var(--crm-surface-border);
}

.crm-feed-item:last-child {
    border-bottom: 0;
}

.crm-client-page .crm-panel-card a,
.crm-client-page .crm-panel-card a:hover,
.crm-client-page .crm-panel-card a:focus {
    text-decoration: none;
}

.crm-report-filter-actions {
    flex-wrap: wrap;
}

.crm-report-filter-actions .btn {
    flex: 1 1 7.5rem;
    width: auto !important;
    min-width: 0;
}

.crm-item-title-link {
    color: var(--crm-text);
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.crm-item-title-link:hover {
    color: var(--crm-primary);
    transform: translateX(2px);
    opacity: 0.95;
}

.crm-panel-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    color: var(--crm-muted);
    border: 1px solid transparent;
    box-shadow: none;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.crm-panel-action-icon:hover,
.crm-panel-action-icon:focus-visible {
    transform: none;
    opacity: 1;
    background-color: #eef2f7;
    border-color: #dee2e6;
}

.crm-feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* Dashboard-specific styles */
.crm-dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.crm-kpi-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.crm-kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.crm-kpi-icon-green {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.crm-kpi-icon-blue {
    background: rgba(79, 106, 199, 0.12);
    color: #4F6AC7;
}

.crm-kpi-icon-teal {
    background: rgba(36, 163, 181, 0.12);
    color: #1A8F9F;
}

.crm-kpi-icon-indigo {
    background: rgba(124, 92, 191, 0.12);
    color: #7C5CBF;
}

.crm-kpi-icon-amber {
    background: rgba(234, 130, 30, 0.12);
    color: #C86A12;
}

.crm-kpi-icon-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.crm-kpi-body {
    min-width: 0;
}

.crm-kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-muted);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.crm-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--crm-text);
    white-space: nowrap;
}

.crm-kpi-change {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.crm-kpi-change-up {
    color: #059669;
}

.crm-kpi-change-down {
    color: #be123c;
}

.crm-kpi-sub {
    font-size: 0.72rem;
    color: var(--crm-muted);
    margin-top: 0.1rem;
}

@media (max-width: 991.98px) {
    .crm-dashboard-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .crm-dashboard-kpi-row {
        grid-template-columns: 1fr;
    }
}

/* Pipeline funnel */
.crm-pipeline-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crm-pipeline-stage {
    display: grid;
    grid-template-columns: 130px 1fr 36px;
    align-items: center;
    gap: 0.65rem;
}

.crm-pipeline-stage-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--crm-text);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.crm-pipeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.crm-pipeline-bar-track {
    height: 22px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
}

.crm-pipeline-bar {
    height: 100%;
    border-radius: 6px;
    min-width: 4px;
    transition: width 0.4s ease;
}

.crm-pipeline-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--crm-text);
    text-align: right;
}

/* Quick stats sidebar */
.crm-quick-stats {
    display: flex;
    flex-direction: column;
}

.crm-quick-stat-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--crm-surface-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.crm-quick-stat-row:last-child {
    border-bottom: 0;
}

.crm-quick-stat-row:hover {
    background: #f8fafc;
    color: inherit;
}

.crm-quick-stat-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex: 0 0 auto;
}

.crm-quick-stat-icon-blue {
    background: rgba(79, 106, 199, 0.12);
    color: #4F6AC7;
}

.crm-quick-stat-icon-teal {
    background: rgba(36, 163, 181, 0.12);
    color: #1A8F9F;
}

.crm-quick-stat-icon-indigo {
    background: rgba(124, 92, 191, 0.12);
    color: #7C5CBF;
}

.crm-quick-stat-icon-green {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.crm-quick-stat-icon-amber {
    background: rgba(234, 130, 30, 0.12);
    color: #C86A12;
}

.crm-quick-stat-icon-rose {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.crm-quick-stat-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--crm-text);
}

.crm-quick-stat-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--crm-text);
}

.crm-quick-stat-badge {
    font-size: 0.68rem;
    font-weight: 700;
}

/* Overdue task row highlight */
.crm-feed-item-overdue {
    background: rgba(225, 29, 72, 0.04);
}

/* Compact feed items for activity */
.crm-feed-item-compact {
    padding: 0.55rem 0.85rem;
}

.crm-feed-icon-sm {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
    font-size: 0.72rem;
}

/* Interaction feed icon */
.crm-feed-icon-interaction {
    background: rgba(36, 163, 181, 0.12);
    color: #1A8F9F;
}

/* Task priority icons */
.crm-task-priority-urgent {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.crm-task-priority-high {
    background: rgba(234, 130, 30, 0.12);
    color: #C86A12;
}

.crm-task-priority-normal {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

.crm-task-priority-low {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

/* Activity feed icon variants */
.crm-feed-icon-success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.crm-feed-icon-danger {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.crm-feed-icon-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

/* Warning panel */
.crm-panel-warning {
    border-color: rgba(245, 158, 11, 0.35);
}

.crm-show-panel-icon-warning {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #b45309 !important;
}

.min-width-0 {
    min-width: 0;
}

.crm-profile-grid {
    display: grid;
    gap: 0.32rem;
}

.crm-profile-row {
    display: grid;
    gap: 0.2rem;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}

.crm-profile-row:last-child {
    border-bottom: 0;
}

.crm-profile-head {
    display: flex;
    align-items: center;
}

.crm-profile-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--crm-muted);
    font-size: 0.82rem;
}

.crm-profile-value {
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    word-break: break-word;
    padding-left: 0;
}

.crm-profile-value-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.crm-copy-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: var(--crm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out, background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.crm-copy-btn i {
    font-size: 0.72rem;
    line-height: 1;
}

.crm-profile-row:hover .crm-copy-btn,
.crm-copy-btn:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.crm-copy-btn:hover,
.crm-copy-btn:focus-visible {
    background: #eef2f7;
    color: var(--crm-primary);
}

.crm-copy-inline-wrap:hover .crm-copy-btn,
.crm-copy-inline-wrap:focus-within .crm-copy-btn {
    opacity: 1;
    pointer-events: auto;
}

.crm-bank-item {
    padding: 0.5rem 0.55rem;
    border-radius: 9px;
    border: 1px solid var(--crm-surface-border);
    background: #f8fafc;
    font-size: 0.8rem;
    font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.crm-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--crm-surface-border);
}

.crm-contact-row:last-child {
    border-bottom: 0;
}

.crm-contact-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .crm-profile-grid {
        gap: 0.28rem;
    }
}

.crm-search {
    background: #f8fafc;
    border: 1px solid #dce4ef;
    border-radius: 999px;
    padding-left: 36px;
    padding-right: 4rem;
    min-height: 38px;
    font-size: 0.86rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.crm-search:focus {
    background: #fff;
    border-color: #a8b5d4;
    box-shadow: 0 0 0 0.2rem rgba(79, 106, 199, 0.18);
}

.crm-search-suggest {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: -40px;
    right: -40px;
    min-width: 380px;
    z-index: 1050;
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.03);
    overflow: hidden;
}

.crm-search-suggest-body {
    max-height: 340px;
    overflow-y: auto;
    padding: 0.3rem 0;
    scrollbar-width: thin;
    scrollbar-color: #d1d9e2 transparent;
}

.crm-search-suggest-group {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--crm-muted);
    padding: 0.55rem 0.85rem 0.25rem;
}

.crm-search-suggest-item {
    display: grid;
    grid-template-columns: 32px 1fr 20px;
    gap: 0.6rem;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    margin: 0 0.35rem;
    transition: background-color 0.12s ease;
}

.crm-search-suggest-item:hover,
.crm-search-suggest-item.is-active {
    background: #f1f5f9;
}

.crm-search-suggest-item.is-active {
    box-shadow: inset 2px 0 0 var(--crm-primary);
}

.crm-search-suggest-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    font-size: 0.88rem;
    flex-shrink: 0;
}

.crm-suggest-icon-blue {
    background: rgba(79, 106, 199, 0.12);
    color: #4F6AC7;
}

.crm-suggest-icon-teal {
    background: rgba(36, 163, 181, 0.12);
    color: #0e7490;
}

.crm-suggest-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.crm-suggest-icon-rose {
    background: rgba(239, 68, 68, 0.10);
    color: #dc2626;
}

.crm-search-suggest-text {
    min-width: 0;
    display: grid;
    gap: 0.05rem;
}

.crm-search-suggest-title {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--crm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-search-suggest-meta {
    font-size: 0.73rem;
    color: var(--crm-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-search-suggest-arrow {
    color: #c8cfd8;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.crm-search-suggest-item:hover .crm-search-suggest-arrow,
.crm-search-suggest-item.is-active .crm-search-suggest-arrow {
    opacity: 1;
    color: var(--crm-primary);
}

.crm-search-highlight {
    background: rgba(79, 106, 199, 0.15);
    color: var(--crm-primary);
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 700;
}

.crm-search-suggest-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--crm-primary);
    text-decoration: none;
    border-top: 1px solid #eef2f7;
    background: #f9fafb;
    transition: background-color 0.12s ease;
}

.crm-search-suggest-footer:hover {
    background: #f1f5f9;
    color: var(--crm-primary-hover);
}

.crm-search-suggest-footer strong {
    font-weight: 700;
}

.crm-search-suggest-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem 1rem;
    color: var(--crm-muted);
    font-size: 0.84rem;
}

.crm-search-suggest-empty i {
    font-size: 1.1rem;
    opacity: 0.5;
}

.crm-header-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    background: #fff;
    color: var(--crm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.crm-header-icon-btn:hover,
.crm-header-icon-btn:focus-visible {
    background: #f8fafc;
    color: var(--crm-primary);
    border-color: #a8b5d4;
}

.crm-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #dce4ef;
    border-radius: 999px;
    background: #fff;
    padding: 0.16rem 0.52rem 0.16rem 0.16rem;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.crm-user-trigger::after {
    margin-left: 0.22rem;
    transition: transform 180ms ease;
    transform: rotate(0deg);
}

.crm-user-trigger:hover,
.crm-user-trigger:focus-visible {
    border-color: #a8b5d4;
    background: #f8fafc;
}

.crm-user-trigger.show,
.crm-user-trigger[aria-expanded="true"],
.crm-user-trigger:active {
    border-color: #a8b5d4;
    background: #f8fafc;
    color: inherit;
}

.crm-user-trigger.show::after,
.crm-user-trigger[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.crm-user-name {
    color: #1e293b;
    font-size: 0.84rem;
    font-weight: 600;
}

.crm-header .dropdown-menu {
    z-index: 1060;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 0.35rem;
    min-width: 12rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.crm-header .dropdown-menu.show {
    animation: crm-dropdown-fade-in 0.14s ease-out;
}

.crm-header .dropdown-item {
    border-radius: 8px;
    font-size: 0.86rem;
    padding: 0.43rem 0.58rem;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.crm-header .dropdown-item:hover,
.crm-header .dropdown-item:focus {
    background-color: #eef2f7;
}

.crm-header .dropdown-divider {
    margin: 0.3rem 0;
}

.crm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.crm-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-muted);
    background: #f8fafc;
}

.crm-tab {
    border-bottom: 2px solid transparent;
    padding-bottom: 0.5rem;
    color: var(--crm-muted);
}

.crm-tab.active {
    border-color: var(--crm-primary);
    color: var(--crm-text);
    font-weight: 600;
}

/* Client page surface tuning to match .EXAMPLE closer */
.crm-client-page .crm-card {
    border-color: #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.crm-client-page .crm-client-hero {
    border-radius: 0;
}

.crm-client-page .crm-card .card-header {
    border-bottom-color: #d1d9e2;
}

.crm-client-page .crm-client-tabs {
    border-color: #d1d9e2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.crm-client-page .crm-feed-item,
.crm-client-page .crm-contact-row,
.crm-client-page .crm-client-form .contact-row,
.crm-client-page .crm-bank-item {
    border-color: #d1d9e2;
}

a,
button,
img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.crm-delete-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.62);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.crm-delete-confirm-overlay.is-open {
    display: flex;
}

.crm-delete-confirm-dialog {
    width: min(480px, 100%);
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.crm-delete-confirm-head {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #d1d9e2;
}

.crm-delete-confirm-body {
    padding: 1rem;
    color: var(--crm-muted);
}

.crm-delete-confirm-actions {
    padding: 0.9rem 1rem;
    border-top: 1px solid #d1d9e2;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.crm-info-icon {
    color: #64748b;
    cursor: help;
}

.crm-notify-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 3000;
    width: min(360px, calc(100vw - 24px));
    display: grid;
    gap: 0.82rem;
    pointer-events: none;
}

.crm-notify-item {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.82rem;
    align-items: start;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    min-height: 96px;
    padding: 0.88rem 0.92rem;
    transform: translateX(0);
    opacity: 1;
    animation: crm-notify-enter 220ms ease-out;
}

.crm-notify-content {
    min-width: 0;
}

.crm-notify-item.is-closing {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 200ms ease, transform 220ms ease;
}

.crm-notify-success {
    border-color: #a8b5d4;
}

.crm-notify-danger {
    border-color: #fecaca;
}

.crm-notify-icon {
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1;
}

.crm-notify-success .crm-notify-icon {
    background: #dcfce7;
    color: #15803d;
}

.crm-notify-danger .crm-notify-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.crm-notify-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.16rem;
}

.crm-notify-text,
.crm-notify-list {
    margin: 0;
    color: #334155;
    font-size: 0.84rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

.crm-notify-list {
    padding-left: 1.15rem;
}

.crm-notify-close {
    border: 0;
    background: transparent;
    color: #64748b;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 120ms ease, color 120ms ease;
}

.crm-notify-close:hover {
    background: #eef2f7;
    color: #0f172a;
}

@keyframes crm-notify-enter {
    from {
        opacity: 0;
        transform: translateX(28px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .crm-notify-stack {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ
   Clients Index вЂ” redesigned list page (.crm-idx-*)
   в”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђв”Ђ */

/* Buttons shared across the index page */
.crm-idx-ghost-btn {
    background: #fff;
    color: var(--crm-text);
    border: 1px solid #d1d9e2;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.34rem 0.85rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.crm-idx-ghost-btn:hover,
.crm-idx-ghost-btn:focus-visible {
    background: #f1f5f9;
    border-color: #a8b5d4;
    color: var(--crm-primary);
}

.crm-idx-filter-btn {
    background: #fff;
    color: var(--crm-text);
    border: 1px solid #d1d9e2;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 0.34rem 0.85rem;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.crm-idx-filter-btn:hover,
.crm-idx-filter-btn:focus-visible {
    border-color: #a8b5d4;
    color: var(--crm-primary);
    background: #e8edf6;
}

.crm-idx-filter-btn.is-active,
.crm-idx-filter-btn[aria-expanded="true"] {
    background: var(--crm-primary-soft);
    border-color: var(--crm-primary);
    color: var(--crm-primary);
}

.crm-idx-filter-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--crm-primary);
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* в”Ђв”Ђ Filter bar в”Ђв”Ђ */
.crm-idx-filters {
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.crm-idx-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr auto;
    gap: 0.75rem;
    align-items: end;
}

.crm-idx-filter-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-muted);
    margin-bottom: 0.3rem;
}

.crm-idx-filter-actions {
    display: flex;
    gap: 0.45rem;
    align-items: end;
    padding-bottom: 1px;
}

/* в”Ђв”Ђ Table в”Ђв”Ђ */
.crm-idx-table-wrap {
    background: #fff;
    border: 1px solid #d1d9e2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.crm-idx-table {
    --bs-table-bg: transparent;
}

.crm-idx-table thead th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--crm-muted);
    background: #f8fafc;
    border-bottom: 1px solid #d1d9e2;
    padding: 0.65rem 0.85rem;
    white-space: nowrap;
}

.crm-idx-table tbody td {
    padding: 0.72rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.86rem;
}

.crm-idx-table tbody tr:last-child td {
    border-bottom: 0;
}

.crm-idx-row {
    transition: background 0.12s ease;
}

.crm-idx-row:hover {
    background: #f0f3f9;
}

/* avatar */
.crm-idx-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
    flex: 0 0 auto;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}

/* name cell */
.crm-idx-name {
    font-weight: 600;
    color: var(--crm-text);
    text-decoration: none;
    white-space: nowrap;
    display: block;
    transition: color 0.15s ease;
}

.crm-idx-name:hover {
    color: var(--crm-primary);
}

.crm-idx-subtext {
    font-size: 0.77rem;
    color: var(--crm-muted);
    max-width: 220px;
}

/* Type badges */
.crm-idx-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
    white-space: nowrap;
    line-height: 1.35;
}

.crm-idx-badge-company {
    background: rgba(124, 92, 191, 0.12);
    color: #6B4DAF;
}

.crm-idx-badge-individual {
    background: rgba(36, 163, 181, 0.12);
    color: #1A8F9F;
}

.crm-idx-badge-supplier {
    background: rgba(14, 116, 144, 0.12);
    color: #0e7490;
}

.crm-idx-badge-partner {
    background: rgba(245, 158, 11, 0.16);
    color: #a16207;
}

/* Contact stack */
.crm-idx-contact-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.crm-idx-contact-item {
    font-size: 0.82rem;
    color: #475569;
    white-space: nowrap;
}

.crm-idx-contact-item i {
    color: var(--crm-muted);
    font-size: 0.72rem;
}

.crm-idx-contact-empty {
    color: var(--crm-muted);
}

/* City */
.crm-idx-city {
    font-size: 0.82rem;
    color: #475569;
    white-space: nowrap;
}

.crm-idx-city i {
    color: var(--crm-muted);
    font-size: 0.72rem;
}

/* Action icon buttons */
.crm-idx-actions {
    display: flex;
    gap: 0.32rem;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.crm-idx-row:hover .crm-idx-actions {
    opacity: 1;
}

.crm-idx-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--crm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.crm-idx-action-btn:hover {
    background: #eef2f7;
    border-color: #d1d9e2;
    color: var(--crm-primary);
}

/* Empty state */
.crm-idx-empty {
    padding: 3.5rem 1rem;
    text-align: center;
}

.crm-idx-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
}

.crm-idx-empty-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.crm-idx-empty-text {
    color: var(--crm-muted);
    font-size: 0.86rem;
    margin-bottom: 1rem;
}

/* в”Ђв”Ђ Responsive в”Ђв”Ђ */
@media (max-width: 991.98px) {
    .crm-idx-filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crm-idx-filter-field-wide {
        grid-column: 1 / -1;
    }

    .crm-idx-filter-actions {
        grid-column: 1 / -1;
    }

    .crm-idx-actions {
        opacity: 1;
    }
}

@media (max-width: 575.98px) {
    .crm-idx-filters-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────
   Auth Pages — Login / Register (.crm-auth-*)
   ───────────────────────────────────────────────────────── */

.crm-auth-body {
    background: var(--crm-bg);
}

.crm-auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Left: Form panel */
.crm-auth-form-side {
    flex: 1 1 56%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: #fff;
}

.crm-auth-form-inner {
    width: 100%;
    max-width: 400px;
}

.crm-auth-subtitle {
    color: var(--crm-muted);
    font-size: 0.92rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Right: Brand panel */
.crm-auth-brand-side {
    flex: 1 1 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background:
        linear-gradient(160deg, rgba(10, 14, 24, 0.95) 0%, rgba(16, 22, 36, 0.91) 44%, rgba(42, 57, 108, 0.62) 100%),
        url('../images/auth/3.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.crm-auth-brand-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(54, 184, 204, 0.12) 0%, transparent 34%),
        radial-gradient(circle at bottom right, rgba(124, 92, 191, 0.11) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
}

.crm-auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
}

.crm-auth-brand-glow {
    position: absolute;
    top: 20%;
    left: 30%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 106, 199, 0.12) 0%, rgba(124, 92, 191, 0.06) 40%, transparent 70%);
    filter: blur(72px);
    opacity: 0.75;
    pointer-events: none;
}

.crm-auth-brand-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(155deg, rgba(12, 18, 30, 0.46) 0%, rgba(18, 24, 40, 0.34) 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 1.65rem;
    box-shadow: 0 12px 28px rgba(5, 8, 17, 0.22);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.crm-auth-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(79, 106, 199, 0.24) 0%, rgba(124, 92, 191, 0.18) 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #b6dfe8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.crm-auth-brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
    color: #e8eefc;
    letter-spacing: -0.02em;
    margin-bottom: 0.65rem;
}

.crm-auth-brand-text {
    font-size: 0.92rem;
    color: rgba(226, 232, 240, 0.74);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.crm-auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.88rem;
    font-weight: 500;
}

.crm-auth-feature-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    color: var(--crm-accent-teal);
}

/* Form styling */
.crm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crm-auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.crm-auth-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-auth-input-wrap {
    position: relative;
}

.crm-auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.88rem;
    color: var(--crm-muted);
    pointer-events: none;
    transition: color 0.15s ease;
}

.crm-auth-input {
    padding-left: 2.4rem;
    border-radius: 10px;
    border: 1px solid var(--crm-surface-border);
    min-height: 42px;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-auth-input:focus {
    border-color: var(--crm-primary);
    box-shadow: 0 0 0 3px var(--crm-primary-soft);
}

.crm-auth-input:focus~.crm-auth-input-icon,
.crm-auth-input-wrap:focus-within .crm-auth-input-icon {
    color: var(--crm-primary);
}

.crm-auth-check {
    margin-top: 0.15rem;
}

.crm-auth-submit {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    margin-top: 0.25rem;
}

.crm-auth-alert {
    border-radius: 10px;
    font-size: 0.86rem;
}

.crm-auth-link-text {
    color: var(--crm-muted);
    font-size: 0.86rem;
    margin-right: 0.2rem;
}

.crm-auth-link {
    color: var(--crm-primary);
    font-weight: 600;
    font-size: 0.86rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.crm-auth-link:hover {
    color: var(--crm-primary-hover);
    text-decoration: underline;
}

/* Responsive: stack on mobile */
@media (max-width: 991.98px) {
    .crm-auth-wrapper {
        flex-direction: column;
    }

    .crm-auth-brand-side {
        display: none;
    }

    .crm-auth-form-side {
        flex: 1;
        min-height: 100vh;
    }
}

@media (max-width: 575.98px) {
    .crm-auth-form-side {
        padding: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Sidebar, Header, Layout, Tables, Dashboard
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar overlay ───────────────────────────────────── */
.crm-sidebar-overlay {
    display: none;
}

.crm-sidebar-toggle {
    font-size: 1.2rem;
}

/* ── Desktop medium (≤1700px) — move detail hero actions below title ── */
@media (max-width: 1699.98px) {
    .crm-client-hero .card-body>.d-flex.flex-column.flex-lg-row.align-items-start.align-items-lg-center {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .crm-client-hero .card-body>.d-flex.flex-column.flex-lg-row.align-items-start.align-items-lg-center>.crm-client-hero-actions {
        margin-left: 0 !important;
        width: 100%;
    }
}

/* ── Laptop (≤1399px) — tighter spacing ──────────────── */
@media (max-width: 1399.98px) {
    .crm-client-page-body {
        padding: 16px 60px;
    }

    .crm-campaign-period-value {
        white-space: normal;
        overflow-wrap: anywhere;
    }

}

/* ── Small laptop / tablet landscape (≤1199px) — sidebar off-canvas ── */
@media (max-width: 1199.98px) {

    /* Sidebar goes off-canvas */
    .crm-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 270px;
        min-width: 270px;
        z-index: 1080;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .crm-sidebar-content {
        padding: 1.25rem 1rem !important;
    }

    .crm-sidebar .nav-link {
        font-size: 0.88rem;
        padding: 0.5rem 0.75rem;
    }

    body.crm-sidebar-open .crm-sidebar {
        transform: translateX(0);
    }

    .crm-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 1070;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    body.crm-sidebar-open .crm-sidebar-overlay {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.25s ease, visibility 0s linear 0s;
    }

    .crm-main-col {
        width: 100%;
    }

    /* Detail pages */
    .crm-client-page-body {
        padding: 14px 36px;
    }

    .crm-client-hero .card-body {
        padding: 1.1rem;
    }

    .crm-client-hero-actions .btn {
        font-size: 0.78rem;
        padding: 0.22rem 0.55rem;
        min-height: 30px;
    }

    .crm-client-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1rem;
    }

    .crm-header-search {
        width: min(320px, 100%);
    }

    /* Tables: horizontal scroll */
    .crm-idx-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .crm-idx-table thead th,
    .crm-idx-table tbody td {
        padding: 0.55rem 0.6rem;
        font-size: 0.82rem;
    }

    .crm-idx-table {
        min-width: 700px;
    }

    .crm-table {
        min-width: 600px;
    }

    .table-responsive-crm {
        overflow-x: auto;
    }
}

/* ── Tablet portrait (≤991px) — detail pages compact ── */
@media (max-width: 991.98px) {

    /* Detail page hero compact */
    .crm-client-hero .card-body {
        padding: 1rem;
    }

    .crm-client-hero-actions {
        flex-wrap: wrap;
    }

    .crm-client-hero-actions .btn {
        padding: 0.22rem 0.5rem;
        font-size: 0.78rem;
        min-height: 30px;
    }

    /* Detail page body tighter */
    .crm-client-page-body {
        padding: 12px 16px;
    }

    /* Force detail-page columns to stack */
    .crm-client-page-body [class*="col-lg-"] {
        width: 100%;
        flex: 0 0 100%;
    }

    /* Panels compact */
    .crm-show-panel .card-header {
        padding: 0.55rem 0.7rem;
    }

    .crm-show-panel .card-body,
    .crm-panel-card .card-body {
        padding: 0.65rem;
    }

    /* Tabs scroll */
    .crm-client-tabs {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .crm-client-tabs .nav-link {
        font-size: 0.82rem;
        padding: 0.35rem 0.6rem;
    }

    /* Show stat grids: 2 columns */
    .crm-show-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-show-stat-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 0.9rem;
    }

    .crm-show-stat-value {
        font-size: 1.1rem;
    }

    /* Dashboard pipeline */
    .crm-pipeline-stage {
        grid-template-columns: 100px 1fr 30px;
    }
}

/* ── Phone landscape / large phone (≤767px) ───────────── */
@media (max-width: 767.98px) {
    .crm-header {
        height: 54px;
    }

    .crm-header-inner {
        min-height: 54px;
        gap: 0.5rem;
    }

    .crm-header-search {
        width: 100%;
        flex: 1;
    }

    .crm-search {
        min-height: 36px;
        font-size: 0.82rem;
    }

    .crm-search-kbd {
        display: none !important;
    }

    .crm-search {
        padding-right: 0.9rem;
    }

    .crm-header-icon-btn {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .crm-user-trigger {
        padding: 0.12rem 0.4rem 0.12rem 0.12rem;
    }

    .crm-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .crm-header-add-btn {
        width: 34px;
        height: 34px;
    }

    /* Content padding */
    .crm-content {
        padding: 0;
    }

    .crm-content>.container-fluid,
    .crm-content>div>.container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .crm-card {
        border-radius: 12px;
    }

    .crm-card .card-header {
        padding: 0.55rem 0.7rem;
    }

    .crm-panel-card .card-body {
        padding: 0.55rem;
    }

    /* Client show page */
    .crm-client-hero-head {
        padding: 0.8rem 0.75rem;
    }

    .crm-client-hero .card-body {
        padding: 0.75rem;
    }

    .crm-client-stat-value {
        font-size: 1.1rem;
    }

    .crm-client-page-body {
        padding: 10px 10px;
    }

    .crm-show-stat {
        padding: 0.65rem 0.8rem;
        gap: 0.55rem;
    }

    .crm-show-stat-value {
        font-size: 1rem;
    }

    .crm-show-stat-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.84rem;
    }

    /* KPI cards */
    .crm-kpi-card {
        padding: 0.7rem 0.85rem;
    }

    .crm-kpi-value {
        font-size: 1.2rem;
    }

    /* Pipeline funnel */
    .crm-pipeline-stage {
        grid-template-columns: 90px 1fr 28px;
    }

    .crm-pipeline-stage-label {
        font-size: 0.74rem;
    }

    /* Quick stats */
    .crm-quick-stat-row {
        padding: 0.5rem 0.65rem;
    }

    /* Notification panel */
    .crm-notif-panel {
        width: calc(100vw - 1.5rem);
        right: -4rem;
        max-height: 420px;
    }

    .crm-notif-item {
        padding: 0.5rem 0.7rem;
    }

    /* Feed items */
    .crm-feed-item {
        padding: 0.65rem 0.7rem;
        gap: 0.6rem;
    }

    .crm-feed-icon {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }
}

/* ── Phone portrait (≤575px) ──────────────────────────── */
@media (max-width: 575.98px) {
    .crm-header-inner {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
        gap: 0.4rem;
    }

    .crm-header-actions {
        gap: 0.25rem !important;
    }

    .crm-header-date {
        display: none !important;
    }

    .crm-header-divider {
        display: none !important;
    }

    .crm-user-name {
        display: none !important;
    }

    .crm-user-trigger::after {
        display: none;
    }

    .crm-user-trigger {
        padding: 0.12rem;
        border-radius: 50%;
    }

    /* Content */
    .crm-content>.container-fluid,
    .crm-content>div>.container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Dashboard hero */
    .crm-dashboard-kpi-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .crm-kpi-card {
        padding: 0.6rem 0.75rem;
    }

    .crm-kpi-value {
        font-size: 1.05rem;
    }

    /* Pipeline: stack label on top */
    .crm-pipeline-stage {
        grid-template-columns: 1fr 36px;
    }

    .crm-pipeline-stage-label {
        grid-column: 1 / -1;
    }

    /* Cards */
    .crm-card {
        border-radius: 10px;
    }

    .crm-card .card-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    /* Client show */
    .crm-client-hero-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .crm-client-hero .card-body {
        padding: 0.65rem;
    }

    .crm-client-page-body {
        padding: 8px 6px;
    }

    .crm-client-stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .crm-client-tabs .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.78rem;
    }

    .crm-show-stats-grid {
        gap: 0.4rem;
    }

    .crm-show-stat {
        padding: 0.5rem 0.65rem;
    }

    .crm-show-panel .card-body,
    .crm-panel-card .card-body {
        padding: 0.5rem;
    }

    .crm-client-hero-actions .btn {
        font-size: 0.75rem;
        padding: 0.18rem 0.42rem;
        min-height: 28px;
    }

    /* Index table */
    .crm-idx-table {
        min-width: 550px;
    }

    .crm-idx-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.72rem;
    }

    .crm-idx-table thead th,
    .crm-idx-table tbody td {
        padding: 0.5rem 0.55rem;
        font-size: 0.8rem;
    }

    /* Notification panel full width */
    .crm-notif-panel {
        position: fixed;
        top: 54px;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
        max-height: calc(100vh - 70px);
        border-radius: 12px;
    }

    /* Edit forms */
    .crm-edit-form-footer {
        flex-direction: column;
    }

    .crm-edit-form-footer .btn {
        width: 100%;
    }

    /* Search suggest full screen */
    .crm-search-suggest {
        left: -0.6rem;
        right: -0.6rem;
        min-width: 0;
    }

    /* Quick add dropdown */
    .crm-quick-add-menu {
        min-width: 11rem;
    }
}