@font-face {
    font-family: 'YekanBakhFaNum';
    src: url('../fonts/YekanBakhFaNum-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'YekanBakhFaNum';
    src: url('../fonts/YekanBakhFaNum-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'YekanBakhFaNum';
    src: url('../fonts/YekanBakhFaNum-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'YekanBakhFaNum';
    src: url('../fonts/YekanBakhFaNum-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --crm-primary: #2454ff;
    --crm-primary-rgb: 36, 84, 255;
    --crm-primary-dark: #153ed4;
    --crm-primary-soft: #edf2ff;
    --crm-bg: #eef3fa;
    --crm-app: #ffffff;
    --crm-surface: #ffffff;
    --crm-surface-soft: #f8fbff;
    --crm-text: #0e1324;
    --crm-muted: #667894;
    --crm-muted-2: #94a3b8;
    --crm-border: #e7edf5;
    --crm-border-strong: #dbe5f0;
    --crm-radius: 18px;
    --crm-radius-lg: 26px;
    --crm-shadow: 0 28px 80px rgba(25, 42, 70, .08);
    --crm-shadow-soft: 0 14px 38px rgba(25, 42, 70, .06);
    --crm-font-family: 'YekanBakhFaNum', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html.crm-datepicker-open,
html.crm-datepicker-open body { overflow-x: hidden; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    direction: rtl;
    font-family: var(--crm-font-family);
    background: radial-gradient(circle at top left, rgba(var(--crm-primary-rgb), .08), transparent 36%), var(--crm-bg);
    color: var(--crm-text);
    font-size: 14px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--crm-primary); }
img { max-width: 100%; }

.crm-auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 20% 10%, rgba(var(--crm-primary-rgb), .18), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(14, 165, 233, .12), transparent 32%),
        #f3f7fc;
}
.crm-auth-card {
    width: min(440px, 100%);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--crm-border);
    border-radius: 30px;
    box-shadow: var(--crm-shadow);
    padding: 34px;
    backdrop-filter: blur(14px);
}
.crm-logo {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--crm-primary), #1234c9);
    font-weight: 800;
    letter-spacing: -.03em;
    box-shadow: 0 16px 30px rgba(var(--crm-primary-rgb), .28);
    margin-bottom: 18px;
}

.crm-layout {
    width: min(1680px, calc(100% - 72px));
    min-height: calc(100vh - 84px);
    margin: 42px auto;
    display: grid;
    grid-template-columns: 290px 1fr;
    background: var(--crm-app);
    border: 1px solid var(--crm-border);
    box-shadow: var(--crm-shadow);
    overflow: hidden;
}
.crm-sidebar {
    background: #fbfcff;
    color: #5d6f89;
    padding: 28px 24px;
    border-left: 1px solid var(--crm-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.crm-sidebar .d-flex.align-items-center.gap-2.mb-4 {
    align-items: center !important;
    padding: 0 4px 25px;
    margin-bottom: 22px !important;
    border-bottom: 1px solid var(--crm-border);
}
.crm-sidebar .crm-logo { width: 38px; height: 38px; border-radius: 13px; margin: 0 !important; font-size: 12px; }
.crm-sidebar strong { color: var(--crm-text); font-weight: 800; font-size: 17px; }
.crm-sidebar small { color: var(--crm-muted-2) !important; }
.crm-sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    color: #596b84;
    padding: 12px 14px;
    border-radius: 15px;
    margin: 1px 0;
    font-weight: 600;
    transition: .18s ease;
}
.crm-sidebar a::before {
    content: attr(data-icon);
    width: 26px;
    height: 26px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    color: #6f7f98;
    background: transparent;
    font-size: 15px;
    flex: 0 0 26px;
}
.crm-sidebar a:hover {
    color: var(--crm-primary);
    background: var(--crm-primary-soft);
}
.crm-sidebar a:hover::before { color: var(--crm-primary); background: #fff; }
.crm-sidebar a.active {
    color: #fff;
    background: var(--crm-primary);
    box-shadow: 0 14px 32px rgba(var(--crm-primary-rgb), .24);
}
.crm-sidebar a.active::before { color: var(--crm-primary); background: rgba(255,255,255,.94); }
.crm-sidebar a[href*="logout"] { margin-top: auto; color: #ef4444; background: #fff5f5; }
.crm-sidebar a[href*="logout"]::before { content: '⎋'; color: #ef4444; }

.crm-main {
    min-width: 0;
    background: #ffffff;
    padding: 34px 40px;
}
.crm-topbar {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 6px;
}
.crm-topbar h1 { font-size: 25px; font-weight: 800; letter-spacing: -.03em; color: var(--crm-text); }
.crm-topbar small { color: var(--crm-muted); font-size: 13px; }
.crm-topbar > .text-muted.small {
    min-width: 190px;
    border: 1px solid var(--crm-border);
    background: var(--crm-surface-soft);
    border-radius: 999px;
    padding: 10px 15px;
    color: #334155 !important;
    box-shadow: 0 10px 24px rgba(25,42,70,.035);
}

.crm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.crm-stat-card, .crm-panel {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius-lg);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.crm-stat-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    min-height: 132px;
}
.crm-stat-card::before {
    content: '';
    position: absolute;
    inset-inline-end: 18px;
    top: 18px;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: var(--crm-primary-soft);
}
.crm-stat-card::after {
    content: '';
    position: absolute;
    inset-inline-end: 31px;
    top: 31px;
    width: 18px;
    height: 18px;
    border-radius: 7px;
    background: var(--crm-primary);
    box-shadow: 0 8px 20px rgba(var(--crm-primary-rgb), .24);
}
.crm-stat-card small { display: block; color: var(--crm-muted); font-weight: 600; padding-inline-end: 58px; }
.crm-stat-card strong { display: block; font-size: 32px; line-height: 1.1; margin-top: 16px; font-weight: 800; letter-spacing: -.04em; color: var(--crm-text); }
.crm-panel { padding: 24px; }
.crm-panel h2, .crm-panel h3 { color: var(--crm-text); font-weight: 800; }
.crm-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.crm-page-head h2, .crm-page-head h3 { font-weight: 800; letter-spacing: -.025em; }

.crm-dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}
.crm-hero-card {
    position: relative;
    min-height: 176px;
    padding: 28px;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 78% 48%, rgba(255,255,255,.22), transparent 22%),
        radial-gradient(circle at 90% 20%, rgba(255,255,255,.16), transparent 24%),
        linear-gradient(135deg, var(--crm-primary), #1238d8);
    box-shadow: 0 26px 55px rgba(var(--crm-primary-rgb), .24);
    overflow: hidden;
}
.crm-hero-card::after {
    content: '';
    position: absolute;
    inset-inline-end: -40px;
    bottom: -72px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 42px solid rgba(255,255,255,.10);
}
.crm-hero-card h2 { color: #fff; font-size: 26px; font-weight: 800; margin: 0 0 10px; }
.crm-hero-card p { color: rgba(255,255,255,.75); margin: 0 0 20px; max-width: 620px; }
.crm-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crm-quick-card {
    border: 1px solid var(--crm-border);
    border-radius: 30px;
    padding: 22px;
    background: #fff;
}
.crm-quick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.crm-quick-item {
    min-height: 74px;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background: var(--crm-surface-soft);
    display: grid;
    place-items: center;
    color: var(--crm-text);
    font-weight: 700;
    transition: .18s;
}
.crm-quick-item:hover { border-color: rgba(var(--crm-primary-rgb), .35); background: var(--crm-primary-soft); color: var(--crm-primary); transform: translateY(-2px); }

.crm-input, .form-control, .form-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--crm-border-strong);
    border-radius: 16px;
    padding: 12px 15px;
    outline: none;
    background: #fff;
    color: var(--crm-text);
    transition: .18s ease;
    box-shadow: none !important;
}
.crm-input::placeholder { color: #9aa8bc; }
.crm-input:focus, .form-control:focus, .form-select:focus {
    border-color: rgba(var(--crm-primary-rgb), .78);
    box-shadow: 0 0 0 4px rgba(var(--crm-primary-rgb), .10) !important;
}
.crm-form-label, label { font-size: 13px; color: #5c6d86; margin-bottom: 8px; font-weight: 700; }
textarea.crm-input { min-height: 110px; resize: vertical; }
select.crm-input { appearance: auto; padding-left: 30px; }

.crm-btn, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border: 0;
    border-radius: 15px;
    padding: 12px 18px;
    background: var(--crm-primary);
    color: #fff !important;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(var(--crm-primary-rgb), .20);
    transition: .18s ease;
}
.crm-btn:hover, .btn-primary:hover { background: var(--crm-primary-dark); color: #fff !important; transform: translateY(-1px); }
.crm-btn-light {
    background: #f7f9fc;
    color: var(--crm-text) !important;
    border: 1px solid var(--crm-border);
    box-shadow: none;
}
.crm-btn-light:hover { background: var(--crm-primary-soft); color: var(--crm-primary) !important; border-color: rgba(var(--crm-primary-rgb), .25); }
.crm-btn-danger { background: #ef4444; box-shadow: 0 14px 28px rgba(239,68,68,.16); }
.crm-btn-danger:hover { background: #dc2626; }
.crm-actions { white-space: nowrap; }
.crm-actions .crm-btn { min-height: 38px; padding: 8px 13px; border-radius: 12px; font-size: 13px; }

.crm-alert { padding: 13px 15px; border-radius: 17px; margin-bottom: 14px; border: 1px solid transparent; font-weight: 600; }
.crm-alert-error { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.crm-alert-warning { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.crm-alert-success { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.crm-alert-info { background: var(--crm-primary-soft); color: var(--crm-primary-dark); border-color: rgba(var(--crm-primary-rgb), .13); }
.crm-flash { margin: 0 0 18px; }
.crm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.crm-badge-priority-urgent, .crm-badge-priority-critical { background: #fff1f2; color: #be123c; }
.crm-badge-priority-high { background: #fff7ed; color: #c2410c; }
.crm-badge-priority-low { background: #ecfdf5; color: #047857; }

.table-responsive { border-radius: 22px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--crm-text); }
.table thead th {
    color: #5d6f89;
    font-weight: 800;
    font-size: 13px;
    border-bottom: 1px solid var(--crm-border);
    padding: 16px 14px;
    background: #fbfdff;
}
.table tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--crm-border);
    color: #334155;
    vertical-align: middle;
}
.table tbody tr { transition: .18s ease; }
.table tbody tr:hover { background: #fbfdff; }
.table tbody tr:last-child td { border-bottom: 0; }

.crm-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.crm-meta-grid > div { border: 1px solid var(--crm-border); border-radius: 18px; padding: 15px; background: var(--crm-surface-soft); }
.crm-meta-grid small { display:block; color: var(--crm-muted); margin-bottom: 6px; font-weight: 600; }
.crm-meta-grid strong { display:block; color: var(--crm-text); font-weight: 800; }
.crm-message {
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
}
.crm-message-internal { background: #fff8ed; border-color: #fed7aa; }
.crm-message-unread { border-inline-start: 4px solid var(--crm-primary); background: var(--crm-primary-soft); }
.crm-file-row { display: flex; flex-direction: column; gap: .25rem; padding: .85rem 0; border-bottom: 1px solid var(--crm-border); }
.crm-file-row:last-child { border-bottom: 0; }
.crm-file-row small { color: var(--crm-muted); }

.row.g-4 > [class*="col-"] .crm-panel,
.row.g-3 > [class*="col-"] .crm-panel { height: 100%; }
.text-muted { color: var(--crm-muted) !important; }
.mb-4 { margin-bottom: 1.35rem !important; }

@media (max-width: 1200px) {
    .crm-layout { width: min(100% - 28px, 1280px); grid-template-columns: 250px 1fr; margin: 18px auto; min-height: calc(100vh - 36px); }
    .crm-main { padding: 28px; }
    .crm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-dashboard-hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .crm-layout { display: block; width: 100%; margin: 0; min-height: 100vh; border: 0; }
    .crm-sidebar { border-left: 0; border-bottom: 1px solid var(--crm-border); padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .crm-sidebar .d-flex.align-items-center.gap-2.mb-4 { grid-column: 1 / -1; margin-bottom: 10px !important; padding-bottom: 16px; }
    .crm-sidebar a { min-height: 44px; padding: 10px 12px; }
    .crm-sidebar a[href*="logout"] { margin-top: 0; }
    .crm-main { padding: 22px 16px; }
    .crm-topbar { flex-direction: column; align-items: stretch; gap: 14px; }
    .crm-topbar > .text-muted.small { border-radius: 18px; }
    .crm-page-head { align-items: stretch; flex-direction: column; }
    .crm-page-head .crm-btn { width: 100%; }
    .crm-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
    body { font-size: 13px; }
    .crm-auth-card { padding: 24px; border-radius: 24px; }
    .crm-sidebar { grid-template-columns: 1fr; }
    .crm-grid, .crm-meta-grid, .crm-quick-list { grid-template-columns: 1fr; }
    .crm-stat-card strong { font-size: 28px; }
    .crm-hero-card { padding: 22px; min-height: 160px; }
    .crm-hero-card h2 { font-size: 22px; }
    .crm-panel { padding: 18px; border-radius: 22px; }
    .crm-actions { display: flex; gap: 8px; white-space: normal; }
}


@media (max-width: 640px) {
    .table-responsive { overflow: visible; }
    .table-responsive table.crm-responsive-table {
        border-collapse: separate;
        border-spacing: 0 12px;
    }
    .table-responsive table.crm-responsive-table thead { display: none; }
    .table-responsive table.crm-responsive-table tbody,
    .table-responsive table.crm-responsive-table tr,
    .table-responsive table.crm-responsive-table td { display: block; width: 100%; }
    .table-responsive table.crm-responsive-table tr {
        background: #fff;
        border: 1px solid var(--crm-border);
        border-radius: 18px;
        padding: 10px 12px;
        box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
    }
    .table-responsive table.crm-responsive-table td {
        border: 0 !important;
        padding: 9px 4px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        text-align: left;
    }
    .table-responsive table.crm-responsive-table td::before {
        content: attr(data-label);
        color: var(--crm-muted);
        font-weight: 800;
        text-align: right;
    }
    .table-responsive table.crm-responsive-table td[data-label="موضوع"] {
        align-items: flex-start;
        flex-direction: column;
        text-align: right;
    }
    .table-responsive table.crm-responsive-table td[data-label="موضوع"]::before { margin-bottom: 4px; }
    .table-responsive table.crm-responsive-table .crm-actions {
        justify-content: stretch;
        flex-wrap: wrap;
    }
    .table-responsive table.crm-responsive-table .crm-actions::before { width: 100%; }
    .table-responsive table.crm-responsive-table .crm-actions .crm-btn,
    .table-responsive table.crm-responsive-table td[data-label="عملیات"] .crm-btn {
        flex: 1 1 120px;
        justify-content: center;
    }
}

/* Jalali Datepicker */
.crm-jalali-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.crm-jalali-wrap .crm-jalali-input {
    flex: 1 1 130px;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    background: #fff;
}
.crm-jalali-time {
    min-height: 46px;
    width: 98px;
    border: 1px solid var(--crm-border);
    border-radius: 14px;
    padding: 10px 9px;
    color: var(--crm-text);
    background: #fff;
    direction: ltr;
}
.crm-jalali-clear {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
}
.crm-jalali-clear:hover { background: #fee2e2; color: #dc2626; }
.crm-jalali-popup {
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0;
    right: auto;
    width: 306px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-x: hidden;
    padding: 14px;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .16);
    display: none;
}
.crm-jalali-popup.is-open { display: block; }
.crm-jalali-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.crm-jalali-head strong { font-size: 14px; color: var(--crm-text); }
.crm-jalali-head button,
.crm-jalali-foot button {
    border: 0;
    border-radius: 12px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    min-width: 38px;
    height: 34px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}
.crm-jalali-head button {
    flex: 0 0 38px;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
}
.crm-jalali-head button span {
    display: block;
    transform: translateY(-1px);
}
.crm-jalali-week,
.crm-jalali-days {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    text-align: center;
}
.crm-jalali-week span {
    min-width: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    padding-bottom: 4px;
}
.crm-jalali-days button {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.crm-jalali-days button:hover { background: var(--crm-primary-soft); color: var(--crm-primary); }
.crm-jalali-days button.is-selected {
    background: var(--crm-primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(var(--crm-primary-rgb), .22);
}
.crm-jalali-days button.is-today:not(.is-selected) {
    background: #f97316;
    color: #fff;
    box-shadow: 0 10px 20px rgba(249, 115, 22, .24);
}
.crm-jalali-foot {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}
@media (max-width: 576px) {
    .crm-jalali-wrap { flex-wrap: wrap; }
    .crm-jalali-time { width: 100%; }
    .crm-jalali-clear { position: absolute; left: 8px; top: 4px; }
    .crm-jalali-popup { width: min(306px, calc(100vw - 24px)); right: auto; border-radius: 18px; }
}

/* v1.3.7 Smart Notifications */
.crm-topbar-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.crm-user-card{min-width:190px;border:1px solid var(--crm-border);background:var(--crm-surface-soft);border-radius:999px;padding:10px 15px;color:#334155!important;box-shadow:0 10px 24px rgba(25,42,70,.035)}
.crm-notification-pill,.crm-notification-toggle{min-height:38px;border:1px solid var(--crm-border);background:#fff;color:#40516b;border-radius:999px;padding:8px 12px;font-family:inherit;font-size:12px;font-weight:800;display:inline-flex;align-items:center;gap:8px;box-shadow:0 8px 20px rgba(15,23,42,.035);cursor:pointer}
.crm-notification-pill:hover,.crm-notification-toggle:hover{background:var(--crm-primary-soft);color:var(--crm-primary)}
.crm-notification-dot{min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#ef4444;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;box-shadow:0 8px 18px rgba(239,68,68,.22)}
.crm-notification-dot.is-empty{background:#dbe5f0;color:#64748b;box-shadow:none}
.crm-toast-wrap{position:fixed;inset-inline-end:24px;bottom:24px;z-index:99999;display:grid;gap:10px;width:min(380px,calc(100vw - 32px));pointer-events:none}
.crm-toast-alert{pointer-events:auto;display:block;background:#fff;border:1px solid var(--crm-border);border-inline-start:5px solid var(--crm-primary);border-radius:18px;padding:14px 16px;box-shadow:0 22px 50px rgba(15,23,42,.16);transform:translateY(12px);opacity:0;transition:.25s;color:var(--crm-text)}
.crm-toast-alert.is-visible{transform:translateY(0);opacity:1}
.crm-toast-alert strong{display:block;font-size:14px;margin-bottom:4px;color:var(--crm-text)}
.crm-toast-alert span{display:block;color:var(--crm-muted);font-size:13px;line-height:1.7}
@media(max-width:860px){.crm-topbar-tools{justify-content:flex-start;margin-top:14px}.crm-user-card{border-radius:18px}.crm-notification-pill,.crm-notification-toggle{flex:1;justify-content:center}.crm-toast-wrap{inset-inline:12px;bottom:14px;width:auto}}

/* v1.5.0 External Notifications */
.crm-subtle-box {
    background: rgba(15, 23, 42, .035);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    padding: 14px;
}
.crm-btn-light {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #dbe4f0;
}
.crm-btn-light:hover {
    background: #eef3fb;
    color: #0f172a;
}

/* v1.5.8 - CRM illustrated icons */
.crm-nav-link--image::before { content: none !important; display: none !important; }
.crm-menu-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(var(--crm-primary-rgb), .08);
    box-shadow: 0 10px 24px rgba(25, 42, 70, .055);
    overflow: hidden;
    transition: .18s ease;
}
.crm-menu-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}
.crm-sidebar a.crm-nav-link--image { gap: 10px; padding-inline-start: 10px; }
.crm-sidebar a.crm-nav-link--image:hover .crm-menu-icon,
.crm-sidebar a.crm-nav-link--image.active .crm-menu-icon {
    background: #fff;
    transform: translateY(-1px);
    border-color: rgba(255,255,255,.82);
}
.crm-sidebar a.crm-nav-link--image.active .crm-menu-icon { box-shadow: 0 12px 26px rgba(15,23,42,.13); }
.crm-sidebar a[href*="logout"]::before { content: '⎋'; color: #ef4444; }

.crm-hero-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.crm-hero-content { position: relative; z-index: 2; min-width: 0; }
.crm-hero-illustration {
    position: relative;
    z-index: 2;
    width: 136px;
    height: 136px;
    object-fit: contain;
    flex: 0 0 136px;
    filter: drop-shadow(0 20px 34px rgba(15,23,42,.14));
}
.crm-quick-list--icons .crm-quick-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 106px;
    padding: 14px 10px;
    text-align: center;
}
.crm-quick-icon {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(var(--crm-primary-rgb), .08);
    box-shadow: 0 12px 28px rgba(25,42,70,.06);
}
.crm-quick-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}
.crm-quick-item:hover .crm-quick-icon { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(var(--crm-primary-rgb), .10); }

@media (max-width: 860px) {
    .crm-menu-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 11px; }
    .crm-menu-icon img { width: 25px; height: 25px; }
    .crm-hero-illustration { width: 104px; height: 104px; flex-basis: 104px; }
    .crm-quick-list--icons .crm-quick-item { min-height: 96px; }
}
@media (max-width: 576px) {
    .crm-hero-card { align-items: flex-start; }
    .crm-hero-illustration { width: 86px; height: 86px; flex-basis: 86px; }
}

/* v1.6.0 - Ticketing Core / SLA */
.crm-sla-pill {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #eef3fb;
    color: #475569;
}
.crm-sla-ok { background: #dcfce7; color: #166534; }
.crm-sla-pending { background: #dbeafe; color: #1d4ed8; }
.crm-sla-late, .crm-badge-danger { background: #fee2e2; color: #b91c1c; }
.crm-sla-unknown { background: #f1f5f9; color: #64748b; }

/* v1.7.0 - Advanced report UI */
.crm-export-panel .table td,
.crm-export-panel .table th { vertical-align: middle; }
.crm-mini-metric {
    min-height: 88px;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background: var(--crm-surface-soft);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.crm-mini-metric span { color: var(--crm-muted); font-size: 12px; }
.crm-mini-metric strong { color: var(--crm-text); font-size: 20px; font-weight: 800; }

.crm-captcha-row {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 10px;
    align-items: center;
}
.crm-captcha-question {
    min-height: 48px;
    border: 1px solid var(--crm-border-strong);
    border-radius: 15px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .02em;
}
.crm-remember-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--crm-muted);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.crm-remember-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--crm-primary);
}
@media (max-width: 575px) {
    .crm-captcha-row { grid-template-columns: 1fr; }
}

/* v1.8.2: clearer remember-me/login persistence hint */
.crm-remember-row span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.45;
}
.crm-remember-row small {
    color: var(--crm-muted);
    font-size: 11px;
    font-weight: 500;
}

/* v1.8.3 - Login redirect, compact grouped sidebar, dashboard metric typography */
.crm-sidebar {
    overflow-y: auto;
    max-height: calc(100vh - 84px);
    scrollbar-width: thin;
    padding-bottom: 18px;
}
.crm-sidebar-brand {
    margin-bottom: 10px !important;
}
.crm-nav-group {
    border: 1px solid rgba(219, 229, 240, .82);
    background: rgba(255, 255, 255, .66);
    border-radius: 18px;
    padding: 6px;
    margin: 0 0 8px;
}
.crm-nav-group summary {
    list-style: none;
    cursor: pointer;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -.01em;
    border-radius: 13px;
    user-select: none;
}
.crm-nav-group summary::-webkit-details-marker { display: none; }
.crm-nav-group summary::after {
    content: '⌄';
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: var(--crm-primary);
    background: var(--crm-primary-soft);
    transition: .18s ease;
    font-size: 14px;
    line-height: 1;
}
.crm-nav-group[open] summary::after { transform: rotate(180deg); }
.crm-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 0 2px;
}
.crm-nav-group .crm-nav-link {
    min-height: 40px;
    padding: 7px 9px;
    border-radius: 13px;
    margin: 0;
    font-size: 13px;
}
.crm-nav-group .crm-menu-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 12px;
}
.crm-nav-group .crm-menu-icon img {
    width: 25px;
    height: 25px;
}
.crm-sidebar a.crm-logout-link {
    margin-top: 8px;
    min-height: 42px;
    flex-shrink: 0;
}
.crm-stat-card strong.crm-stat-value-text {
    font-size: clamp(18px, 1.65vw, 23px);
    line-height: 1.55;
    letter-spacing: -.02em;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.crm-stat-card small + strong.crm-stat-value-text { margin-top: 12px; }
@media (max-width: 1280px) {
    .crm-layout { grid-template-columns: 260px 1fr; }
    .crm-sidebar { padding: 22px 18px; }
    .crm-nav-group .crm-nav-link { font-size: 12.5px; }
}
@media (max-width: 860px) {
    .crm-sidebar {
        display: block;
        max-height: none;
        overflow: visible;
        padding: 16px;
    }
    .crm-nav-group { margin-bottom: 8px; }
    .crm-sidebar a.crm-logout-link { margin-top: 8px; }
    .crm-stat-card strong.crm-stat-value-text { font-size: 18px; }
}

/* v1.8.4 - no inner sidebar scrollbar, cleaner pagination and smaller metric text */
.crm-sidebar {
    max-height: none !important;
    overflow: visible !important;
    gap: 6px;
}
.crm-sidebar-brand {
    padding-bottom: 14px !important;
    margin-bottom: 8px !important;
}
.crm-nav-group {
    margin-bottom: 7px;
    padding: 5px;
    border-radius: 17px;
}
.crm-nav-group:not([open]) {
    padding-bottom: 5px;
}
.crm-nav-group:not([open]) .crm-nav-group-items {
    display: none;
}
.crm-nav-group summary {
    min-height: 32px;
    padding: 5px 9px;
}
.crm-nav-group .crm-nav-link {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12.5px;
}
.crm-nav-group .crm-menu-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 11px;
}
.crm-nav-group .crm-menu-icon img {
    width: 23px;
    height: 23px;
}
.crm-sidebar a.crm-logout-link {
    min-height: 38px;
    margin-top: 8px;
    justify-content: center;
}
.crm-user-card {
    text-align: center;
    line-height: 1.85;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.crm-stat-card strong.crm-stat-value-text {
    font-size: clamp(15px, 1.15vw, 18px) !important;
    line-height: 1.8;
    letter-spacing: -.015em;
}
.crm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    padding-top: 12px;
}
.crm-page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--crm-border);
    background: #fff;
    color: #40516b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(15,23,42,.035);
}
.crm-page-link:hover {
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
}
.crm-page-link.is-active {
    background: var(--crm-primary);
    color: #fff;
    border-color: var(--crm-primary);
    box-shadow: 0 12px 28px rgba(var(--crm-primary-rgb), .18);
}
.crm-page-link.is-disabled {
    pointer-events: none;
    opacity: .48;
    background: #f8fafc;
}
@media (max-width: 1280px) {
    .crm-layout { grid-template-columns: 248px 1fr; }
    .crm-sidebar { padding: 18px 14px; }
    .crm-sidebar-brand .crm-logo { width: 34px; height: 34px; }
    .crm-sidebar strong { font-size: 15px; }
    .crm-sidebar small { font-size: 11px; }
}
@media (max-width: 860px) {
    .crm-stat-card strong.crm-stat-value-text { font-size: 16px !important; }
    .crm-pagination { justify-content: flex-start; }
}

/* v1.9.0 Knowledge Base & canned responses */
.crm-kb-suggestions {
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(var(--crm-primary-rgb), .055), rgba(255,255,255,.88));
    padding: 14px;
}
.crm-kb-suggestion-item,
.crm-kb-card {
    display: block;
    height: 100%;
    padding: 14px 16px;
    border: 1px solid var(--crm-border);
    border-radius: 16px;
    background: #fff;
    color: var(--crm-text);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .035);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.crm-kb-suggestion-item:hover,
.crm-kb-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--crm-primary-rgb), .28);
    box-shadow: 0 14px 32px rgba(var(--crm-primary-rgb), .11);
    color: var(--crm-primary);
}
.crm-kb-suggestion-item strong,
.crm-kb-card strong {
    display: block;
    font-size: 13px;
    line-height: 1.9;
}
.crm-kb-suggestion-item small,
.crm-kb-card small {
    display: block;
    margin-top: 4px;
    color: var(--crm-muted);
    font-size: 11.5px;
}
.crm-kb-card p {
    margin: 10px 0 0;
    color: var(--crm-muted);
    font-size: 12.5px;
    line-height: 2;
}
.crm-article-body {
    color: var(--crm-text);
    line-height: 2.35;
    font-size: 14px;
    white-space: normal;
}

/* v2.1.0 - finance module and cleaner information layouts */
.crm-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.crm-info-grid--customer {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}
.crm-info-card {
    min-height: 86px;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    padding: 15px 16px;
    background: linear-gradient(180deg, #fff, var(--crm-surface-soft));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
}
.crm-info-card small {
    display: block;
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 800;
}
.crm-info-card strong {
    display: block;
    color: var(--crm-text);
    font-size: 14px;
    line-height: 1.65;
    font-weight: 900;
    word-break: break-word;
}
.crm-section-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crm-section-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    color: var(--crm-text);
}
.crm-section-title span {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 600;
}
.crm-subpanel {
    border: 1px solid var(--crm-border);
    border-radius: 22px;
    background: #fbfdff;
    padding: 18px;
}
.crm-inline-edit-form {
    display: grid;
    grid-template-columns: minmax(108px, .7fr) minmax(130px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 360px;
}
.crm-table-modern thead th {
    color: var(--crm-muted);
    font-size: 12px;
    font-weight: 900;
    border-bottom-color: var(--crm-border-strong);
}
.crm-table-modern tbody td {
    vertical-align: middle;
    border-bottom-color: #eef3f8;
}
.crm-table-modern td[dir="ltr"],
.crm-table-modern th[dir="ltr"],
.crm-table-modern .crm-id-cell {
    direction: ltr;
    text-align: left;
    white-space: nowrap;
}
.crm-table-modern td .crm-cell-meta {
    display: block;
    margin-top: 3px;
    color: var(--crm-muted);
    font-size: 11px;
}
.crm-total-strip {
    border: 1px solid var(--crm-border);
    border-radius: 16px;
    padding: 10px 16px;
    background: var(--crm-surface-soft);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}
.crm-total-strip span { color: var(--crm-muted); font-size: 12px; }
.crm-total-strip strong { color: var(--crm-primary); font-size: 18px; }
.crm-invoice-paper {
    border: 1px solid var(--crm-border);
    border-radius: 30px;
    background: #fff;
    padding: 28px;
    box-shadow: 0 18px 55px rgba(15,23,42,.05);
}
.crm-invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--crm-border);
}
.crm-invoice-head h2 {
    margin: 10px 0 4px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.03em;
}
.crm-invoice-head p { margin: 0; color: var(--crm-muted); font-weight: 700; }
.crm-invoice-status {
    min-width: 210px;
    border: 1px solid var(--crm-border);
    border-radius: 20px;
    background: var(--crm-surface-soft);
    padding: 14px 16px;
    text-align: center;
}
.crm-invoice-status strong { display:block; color: var(--crm-primary); font-size: 17px; font-weight: 900; }
.crm-invoice-status span { display:block; color: var(--crm-muted); margin-top: 4px; font-size: 12px; font-weight: 800; }
.crm-note-box {
    border: 1px dashed var(--crm-border-strong);
    border-radius: 18px;
    background: #fbfdff;
    padding: 14px 16px;
}
.crm-note-box small { display:block; color: var(--crm-muted); font-weight: 900; margin-bottom: 8px; }
.crm-note-box p { margin: 0; color: #334155; line-height: 1.9; }
.crm-total-box {
    border: 1px solid var(--crm-border);
    border-radius: 22px;
    background: linear-gradient(180deg, #fff, var(--crm-surface-soft));
    padding: 14px;
}
.crm-total-box > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 6px;
    border-bottom: 1px solid #eef3f8;
}
.crm-total-box > div:last-child { border-bottom: 0; }
.crm-total-box span { color: var(--crm-muted); font-size: 12px; font-weight: 800; }
.crm-total-box strong { color: var(--crm-text); font-weight: 900; }
.crm-total-box .is-final {
    margin: 6px 0;
    border: 0;
    border-radius: 16px;
    background: var(--crm-primary);
    color: #fff;
    padding: 12px;
}
.crm-total-box .is-final span,
.crm-total-box .is-final strong { color: #fff; }
@media print {
    body { background: #fff !important; }
    .crm-sidebar, .crm-topbar, .crm-print-hide { display: none !important; }
    .crm-layout { display: block !important; width: 100% !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }
    .crm-main { padding: 0 !important; }
    .crm-invoice-paper { border: 0; box-shadow: none; border-radius: 0; }
}
@media (max-width: 992px) {
    .crm-inline-edit-form { min-width: 0; grid-template-columns: 1fr; }
    .crm-invoice-head { flex-direction: column; }
    .crm-invoice-status { width: 100%; }
}
@media (max-width: 575px) {
    .crm-info-grid, .crm-info-grid--customer { grid-template-columns: 1fr; }
    .crm-invoice-paper { padding: 18px; border-radius: 22px; }
}


/* v2.1.1 - UI polish, notification pagination, cleaner action forms */
.crm-form-grid {
    display: grid;
    gap: 14px;
    align-items: end;
}
.crm-customer-user-form {
    grid-template-columns: minmax(170px, 1.25fr) minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(128px, .8fr) minmax(104px, auto);
}
.crm-document-upload-form {
    grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(120px, .7fr) minmax(110px, auto);
}
.crm-form-action {
    display: flex;
    align-items: end;
    min-width: 104px;
}
.crm-form-action .crm-btn {
    min-width: 96px;
    white-space: nowrap;
}
select.crm-input,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 15px;
    padding-inline-start: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6d86' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 14px 14px;
    background-position: 16px center;
}
.crm-input[type="file"] {
    padding-block: 10px;
    overflow: hidden;
}
.crm-nav-group summary::after {
    content: '▾' !important;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 999px;
    background: var(--crm-primary-soft);
    color: var(--crm-primary);
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    transform: none;
    padding: 0;
}
.crm-nav-group[open] summary::after {
    transform: rotate(180deg);
}
.crm-sidebar a.crm-logout-link {
    border: 1px solid #fee2e2;
    background: linear-gradient(180deg, #fff8f8, #fff1f2);
    color: #dc2626 !important;
    border-radius: 18px;
    min-height: 46px;
    box-shadow: 0 12px 28px rgba(239,68,68,.07);
    gap: 9px;
}
.crm-sidebar a.crm-logout-link::before {
    content: '⎋' !important;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(239,68,68,.09);
    color: #ef4444;
    margin: 0;
    font-size: 14px;
}
.crm-sidebar a.crm-logout-link:hover {
    background: #ef4444;
    color: #fff !important;
    transform: translateY(-1px);
}
.crm-sidebar a.crm-logout-link:hover::before {
    background: rgba(255,255,255,.18);
    color: #fff;
}
.crm-info-grid--profile {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    align-items: stretch;
}
.crm-info-card {
    min-height: 82px;
    align-items: flex-start;
    text-align: start;
}
.crm-info-card strong {
    max-width: 100%;
    overflow-wrap: anywhere;
}
.crm-subpanel {
    overflow: hidden;
}
.crm-notification-list {
    display: grid;
    gap: 12px;
}
.crm-notification-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(15,23,42,.035);
}
.crm-notification-item.is-unread {
    background: linear-gradient(135deg, rgba(var(--crm-primary-rgb), .075), #fff);
    border-color: rgba(var(--crm-primary-rgb), .18);
}
.crm-notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: var(--crm-primary-soft);
    position: relative;
}
.crm-notification-icon::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--crm-primary);
    position: absolute;
    inset: 0;
    margin: auto;
}
.crm-notification-content { min-width: 0; }
.crm-notification-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.crm-notification-content strong {
    font-size: 14px;
    color: var(--crm-text);
}
.crm-notification-content p {
    margin: 7px 0 3px;
    color: var(--crm-muted);
    font-size: 13px;
    line-height: 1.9;
}
.crm-notification-content small {
    color: var(--crm-muted-2);
    font-size: 11.5px;
}
.crm-notification-action .crm-btn {
    min-height: 38px;
    padding: 8px 13px;
}
@media (max-width: 1200px) {
    .crm-customer-user-form,
    .crm-document-upload-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .crm-form-action { min-width: 0; }
}
@media (max-width: 680px) {
    .crm-customer-user-form,
    .crm-document-upload-form {
        grid-template-columns: 1fr;
    }
    .crm-notification-item {
        grid-template-columns: 36px minmax(0, 1fr);
    }
    .crm-notification-action {
        grid-column: 2;
    }
}

/* v2.5.2 - Stable layout grid helpers without experimental drag/drop personalization */
.crm-personal-layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}
.crm-personal-layout .crm-layout-col { min-width: 0; }
.crm-layout-span-12 { grid-column: span 12; }
.crm-layout-span-8 { grid-column: span 8; }
.crm-layout-span-7 { grid-column: span 7; }
.crm-layout-span-6 { grid-column: span 6; }
.crm-layout-span-5 { grid-column: span 5; }
.crm-layout-span-4 { grid-column: span 4; }
.crm-personal-layout--dashboard { margin-top: 10px; }
.crm-profile-stat-grid { margin-bottom: 22px; }
@media (max-width: 1199px) {
    .crm-layout-span-8,
    .crm-layout-span-7,
    .crm-layout-span-6,
    .crm-layout-span-5,
    .crm-layout-span-4 { grid-column: span 12; }
}
@media (max-width: 767px) {
    .crm-personal-layout { gap: 16px; }
}

/* v2.2.0 - Projects module small UI helpers */
.crm-check {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 44px;
    padding: .65rem .9rem;
    border: 1px solid #dbe7f7;
    border-radius: 16px;
    background: #f8fbff;
    color: #334155;
    font-weight: 800;
}
.crm-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--crm-primary);
}

/* v2.2.3 - Canned responses UX */
.crm-canned-response-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}
.crm-canned-response-row .crm-input {
    min-width: 0;
    flex: 1 1 auto;
}
.crm-canned-response-row .crm-btn {
    flex: 0 0 auto;
    min-width: 112px;
    justify-content: center;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .crm-canned-response-row {
        flex-direction: column;
    }
    .crm-canned-response-row .crm-btn {
        width: 100%;
    }
}

/* v2.2.4 - Canned responses department-aware UX */
.crm-canned-response-picker .crm-input:disabled,
.crm-canned-response-picker .crm-btn:disabled {
    opacity: .72;
    cursor: not-allowed;
}
.crm-canned-response-picker [data-canned-response-empty] {
    line-height: 1.9;
}

/* v2.3.0 - System maintenance */
.crm-maintenance-alert {
    border-radius: 18px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}
.crm-maintenance-stat small {
    color: var(--crm-muted);
    font-weight: 700;
}
.crm-maintenance-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    font-weight: 900;
    color: var(--crm-text);
}
.crm-maintenance-stat span {
    display: block;
    margin-top: 6px;
    color: var(--crm-muted);
    font-size: 12px;
}
.crm-maintenance-table-wrap {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
}
.crm-maintenance-table-wrap table {
    margin-bottom: 0;
}
.crm-maintenance-table-wrap thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.crm-cleanup-list .list-group-item {
    border-color: var(--crm-border);
}
.crm-maintenance-health .badge,
.crm-cleanup-list .badge {
    white-space: normal;
    line-height: 1.6;
}
@media (max-width: 767px) {
    .crm-maintenance-table-wrap {
        max-height: none;
    }
    .crm-maintenance-stat strong {
        font-size: 20px;
    }
}

/* v2.4.0 - backup, restore and maintenance mode */
.crm-backup-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid #dbe6fb;
    border-radius: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
    box-shadow: 0 16px 40px rgba(31, 56, 110, .06);
}
.crm-backup-hero h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; color: #17233f; }
.crm-backup-hero p { margin: 0; color: #64748b; line-height: 2; max-width: 760px; }
.crm-backup-stats {
    min-width: 260px;
    display: grid;
    gap: 8px;
    align-content: center;
}
.crm-backup-stats span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.82);
    border: 1px solid #e4ebfb;
    font-size: 12px;
    color: #506282;
}
.crm-backup-stats strong { color: #1d2a44; }
.crm-soft-badge,
.crm-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #edf4ff;
    color: #2454ff;
    border: 1px solid #d6e4ff;
    white-space: nowrap;
}
.crm-status-pill.is-success { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.crm-status-pill.is-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.crm-checkline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2eaf8;
    border-radius: 14px;
    background: #f8fbff;
    color: #34445f;
    font-size: 13px;
    font-weight: 700;
}
.crm-checkline input { width: 18px; height: 18px; accent-color: var(--crm-primary); }
.crm-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.crm-actions-inline form { display: inline-flex; margin: 0; }
.crm-btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; border-radius: 12px; }
.crm-btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.crm-btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.crm-maintenance-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 80% 15%, rgba(36,84,255,.14), transparent 28%),
        linear-gradient(135deg, #f7faff 0%, #eef4ff 100%);
    font-family: var(--crm-font-family);
}
.crm-maintenance-card {
    width: min(100%, 560px);
    text-align: center;
    padding: 34px;
    border-radius: 28px;
    background: rgba(255,255,255,.92);
    border: 1px solid #dbe6fb;
    box-shadow: 0 26px 80px rgba(31, 56, 110, .14);
}
.crm-maintenance-badge {
    display: inline-flex;
    margin: 18px 0 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 12px;
    font-weight: 900;
}
.crm-maintenance-card h1 { margin: 0 0 12px; font-size: 24px; font-weight: 900; color: #17233f; }
.crm-maintenance-card p { margin: 0 auto 22px; color: #52627f; line-height: 2.05; }
@media (max-width: 768px) {
    .crm-backup-hero { flex-direction: column; padding: 18px; }
    .crm-backup-stats { min-width: 0; }
    .crm-backup-stats span { align-items: flex-start; flex-direction: column; gap: 4px; }
    .crm-actions-inline { align-items: stretch; }
    .crm-actions-inline .crm-btn,
    .crm-actions-inline form { width: 100%; }
    .crm-actions-inline form .crm-btn { width: 100%; }
    .crm-maintenance-card { padding: 26px 18px; }
}

/* v2.5.2 - final stabilization, upload/schema hardening and module metadata normalization */
.crm-security-card {
    border-color: #dbe6fb;
}
.crm-security-card.is-ok {
    background: linear-gradient(135deg, #ffffff 0%, #f7fffb 100%);
}
.crm-security-card.is-warning {
    background: linear-gradient(135deg, #ffffff 0%, #fffaf0 100%);
}
.crm-security-table-wrap {
    max-height: 620px;
    overflow: auto;
    border: 1px solid var(--crm-border);
    border-radius: 18px;
}
.crm-security-table-wrap table { margin-bottom: 0; }
.crm-security-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
}
.crm-access-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid transparent;
}
.crm-access-pill.is-allow {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0;
}
.crm-access-pill.is-deny {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}
.crm-rich-editor {
    border: 1px solid #dbe7f7;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}
.crm-rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #f8fbff;
    border-bottom: 1px solid #e4edf9;
}
.crm-rich-editor-toolbar button {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #d8e4f4;
    border-radius: 10px;
    background: #fff;
    color: #26364d;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
}
.crm-rich-editor-toolbar button:hover,
.crm-rich-editor-toolbar button:focus {
    border-color: var(--crm-primary);
    color: var(--crm-primary);
    outline: none;
}
.crm-rich-editor-area {
    min-height: 260px;
    padding: 16px 18px;
    line-height: 2.1;
    color: #17233f;
    background: #fff;
    outline: none;
}
.crm-rich-editor-area:focus {
    box-shadow: inset 0 0 0 2px rgba(36,84,255,.12);
}
.crm-article-body {
    line-height: 2.15;
    color: #17233f;
    word-break: break-word;
}
.crm-article-body h2,
.crm-article-body h3,
.crm-article-body h4 {
    margin: 1.35rem 0 .65rem;
    font-weight: 900;
    color: #14213d;
}
.crm-article-body p { margin: 0 0 1rem; }
.crm-article-body ul,
.crm-article-body ol { padding-inline-start: 1.4rem; margin: .8rem 0 1rem; }
.crm-article-body blockquote {
    margin: 1rem 0;
    padding: 12px 16px;
    border-inline-start: 4px solid var(--crm-primary);
    background: #f7faff;
    border-radius: 14px;
    color: #334155;
}
.crm-article-body pre,
.crm-article-body code {
    direction: ltr;
    text-align: left;
    font-family: Consolas, Monaco, monospace;
}
.crm-article-body pre {
    overflow: auto;
    padding: 14px;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
}
.crm-article-body a {
    color: var(--crm-primary);
    font-weight: 800;
    text-decoration: none;
}
.crm-article-body a:hover { text-decoration: underline; }
@media (max-width: 575.98px) {
    .crm-rich-editor-toolbar { align-items: stretch; }
    .crm-rich-editor-toolbar button { flex: 1 1 auto; }
    .crm-rich-editor-area { min-height: 220px; padding: 14px; }
    .crm-security-table-wrap { max-height: none; }
}
 .crm-industry-party-list{grid-column:1/-1;min-width:0}.crm-industry-party-rows{display:grid;gap:.6rem;margin-top:.5rem}.crm-industry-party-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:.5rem;align-items:center}.crm-industry-party-row .crm-btn{white-space:nowrap}@media(max-width:640px){.crm-industry-party-row{grid-template-columns:1fr 1fr}}
