:root {
    --sidebar-width: 240px;
    --header-h: 60px;
    --brand-dark: #0f1117;
    --brand-accent: #3b82f6;
    --brand-accent-hover: #2563eb;
    --brand-border: rgba(255,255,255,0.07);
    --sidebar-text: #9ca3af;
    --sidebar-active-bg: rgba(59,130,246,0.12);
    --sidebar-active-text: #60a5fa;
    --content-bg: #f4f6fa;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
body { font-family: 'DM Sans', sans-serif; background: var(--content-bg); color: var(--text-primary); display: flex; min-height: 100vh; }
#sidebar { width: var(--sidebar-width); background: var(--brand-dark); height: 100vh; position: fixed; top: 0; left: 0; display: flex; flex-direction: column; z-index: 100; border-right: 1px solid var(--brand-border); transition: transform .25s ease; }
body.sidebar-hidden #sidebar { transform: translateX(-100%); }
.sidebar-logo { padding: 0 20px; height: var(--header-h); display: flex; align-items: center; border-bottom: 1px solid var(--brand-border); gap: 10px; text-decoration: none; }
.sidebar-logo-icon { width: 30px; height: 30px; background: var(--brand-accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; font-weight: 700; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-logo-text span { color: var(--brand-accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 0; }
.nav-section-label { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #4b5563; padding: 14px 20px 6px; }
.sidebar-group { border-bottom: 1px solid rgba(255,255,255,.04); }
.sidebar-group:last-child { border-bottom: 0; }
.sidebar-group-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding-right: 16px; }
.sidebar-group-summary::-webkit-details-marker { display: none; }
.sidebar-group-icon { color: #6b7280; font-size: 12px; transition: transform .18s ease; }
.sidebar-group[open] .sidebar-group-icon { transform: rotate(180deg); }
.sidebar-group-links { padding-bottom: 8px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 500; border-left: 3px solid transparent; transition: all .15s; }
.sidebar-link i { font-size: 15px; width: 18px; text-align: center; }
.sidebar-link:hover { color: #e5e7eb; background: rgba(255,255,255,.04); }
.sidebar-link.active { color: var(--sidebar-active-text); background: var(--sidebar-active-bg); border-left-color: var(--brand-accent); }
.disabled-link { pointer-events: none; opacity: .72; }
.badge-soon { margin-left: auto; font-size: 9px; font-weight: 600; background: rgba(99,102,241,.2); color: #818cf8; padding: 2px 6px; border-radius: 20px; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--brand-border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: #e5e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #6b7280; }
#main-wrapper { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); max-width: calc(100% - var(--sidebar-width)); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; transition: margin-left .25s ease, width .25s ease, max-width .25s ease; }
body.sidebar-hidden #main-wrapper { margin-left: 0; }
body.sidebar-hidden #main-wrapper { width: 100%; max-width: 100%; }
#topbar { min-height: var(--header-h); background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 50; }
.sidebar-toggle-btn { flex: 0 0 auto; }
.topbar-breadcrumb { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.topbar-breadcrumb .page-title { color: var(--text-primary); font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-btn { width: 36px; height: 36px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; }
.topbar-btn:hover { background: #f8fafc; color: var(--text-primary); }
.notification-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
#main-content { flex: 1; padding: 28px; min-width: 0; width: 100%; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.page-header p { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card.compact { min-width: 0; }
.stat-card.compact .stat-value { font-size: 25px; }
.erpro-card, .stat-card { background: var(--card-bg); border: 1px solid #e9ecf0; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.erpro-card { padding: 22px 24px; width: 100%; min-width: 0; }
.stat-card { padding: 20px 22px; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1.1; font-family: 'DM Mono', monospace; }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 10px; }
.btn-primary-erpro, .btn-outline-erpro { border-radius: 8px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn-primary-erpro { background: var(--brand-accent); color: #fff; border: none; }
.btn-primary-erpro:hover { background: var(--brand-accent-hover); color: #fff; }
.btn-outline-erpro { background: transparent; color: var(--text-secondary); border: 1px solid #d1d5db; }
.btn-outline-erpro:hover { background: #f3f4f6; color: var(--text-primary); }
.form-label-erpro { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; display: block; }
.form-control-erpro, .form-select-erpro { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 12px; font-size: 13.5px; color: var(--text-primary); background: #fff; outline: none; font-family: 'DM Sans', sans-serif; }
.form-control-erpro:focus, .form-select-erpro:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.table-responsive-erpro { width: 100%; overflow-x: hidden; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.table-responsive-erpro .table-erpro,
.table-responsive-erpro .erpro-table { width: 100% !important; border-collapse: separate; border-spacing: 0; table-layout: auto !important; }
.table-erpro thead th, .erpro-table th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); padding: 11px 14px; border-bottom: 1px solid #e9ecf0; background: #f9fafb; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; min-width: 0 !important; width: auto !important; }
.table-erpro tbody td, .erpro-table td { padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid #f0f2f5; vertical-align: top; line-height: 1.55; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; min-width: 0 !important; width: auto !important; }
.table-responsive-erpro .table-erpro td *,
.table-responsive-erpro .erpro-table td * {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.table-responsive-erpro .table-erpro td .badge-erpro,
.table-responsive-erpro .erpro-table td .badge-erpro,
.table-responsive-erpro .table-erpro td .btn-outline-erpro,
.table-responsive-erpro .table-erpro td .btn-primary-erpro,
.table-responsive-erpro .erpro-table td .btn-outline-erpro,
.table-responsive-erpro .erpro-table td .btn-primary-erpro {
    white-space: normal !important;
}
.erpro-table tr:hover td { background: #fafbfc; }
.dataTables_wrapper { width: 100%; min-width: 0; overflow: visible; }
.dataTables_wrapper .row { --bs-gutter-x: 16px; row-gap: 12px; margin-left: 0; margin-right: 0; align-items: center; }
.dataTables_wrapper .row > * { min-width: 0; padding-left: 0; padding-right: 0; }
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { margin-bottom: 8px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { display: flex; align-items: center; }
.dataTables_wrapper .dataTables_length { justify-content: flex-start; }
.dataTables_wrapper .dataTables_filter { justify-content: flex-end; }
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.dataTables_wrapper .dataTables_filter label { justify-content: flex-end; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select { border-radius: 8px; border: 1px solid #d1d5db; min-height: 38px; }
.dataTables_wrapper .dataTables_filter input { min-width: 0; width: min(100%, 320px) !important; margin-left: 0 !important; flex: 1 1 220px; }
.dataTables_wrapper .dataTables_length select { margin: 0 !important; }
.dataTables_wrapper table.dataTable { width: 100% !important; margin: 0 !important; }
.dataTables_wrapper .pagination { gap: 4px; flex-wrap: wrap; }
.dataTables_wrapper .page-link { border-radius: 8px; color: var(--text-primary); }
.dataTables_wrapper .page-item.active .page-link { background: var(--brand-accent); border-color: var(--brand-accent); }
.dataTables_wrapper .dtr-details { width: 100%; }
.dataTables_wrapper .dtr-details li { display: grid; grid-template-columns: minmax(95px, .35fr) minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.dataTables_wrapper .dtr-details li:last-child { border-bottom: 0; }
.dataTables_wrapper .dtr-title { font-weight: 800; color: var(--text-primary); font-size: 12px; }
.dataTables_wrapper .dtr-data { color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.dataTables_wrapper .dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    .dataTables_wrapper .dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background: var(--brand-accent);
    box-shadow: none;
    border: 0;
}
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    background: #fff;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 1.4;
    padding-left: 0;
    padding-right: 18px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 10px;
}
.select2-container--default .select2-selection--multiple {
    align-items: flex-start;
    padding-top: 4px;
    padding-bottom: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 0;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 2px 8px;
}
.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db;
    border-radius: 8px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.alert-erpro { border-radius: 8px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success-erpro { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning-erpro { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-error-erpro { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.modal-backdrop {
    --bs-backdrop-zindex: 1050;
    --bs-backdrop-bg: #0f172a;
    --bs-backdrop-opacity: .68;
}
.modal-backdrop.show {
    opacity: var(--bs-backdrop-opacity);
}
.modal {
    --bs-modal-zindex: 1060;
}
.modal-content {
    box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}
.badge-erpro { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
.detail-row span:first-child { color: #6b7280; }
.detail-row span:last-child { color: #111827; font-weight: 600; text-align: right; }
.chat-shell { display: grid; grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(280px, 310px); gap: 16px; align-items: start; }
.chat-shell > aside,
.chat-shell > section { min-width: 0; }
.conversation-mini-list { display: flex; flex-direction: column; gap: 8px; }
.conversation-mini-item { display: block; text-decoration: none; border: 1px solid #e9ecf0; border-radius: 9px; padding: 10px; color: inherit; background: #fff; }
.conversation-mini-item.active, .conversation-mini-item:hover { border-color: #bfdbfe; background: #eff6ff; }
.message-thread { min-height: 420px; max-height: 58vh; overflow-y: auto; padding: 18px; background: #f8fafc; border: 1px solid #e9ecf0; border-radius: 10px; }
.message-row { display: flex; margin-bottom: 12px; }
.message-row.inbound { justify-content: flex-start; }
.message-row.outbound { justify-content: flex-end; }
.message-bubble { max-width: min(76%, 620px); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.message-row.inbound .message-bubble { background: #fff; border: 1px solid #e5e7eb; color: #111827; }
.message-row.outbound .message-bubble { background: #dbeafe; border: 1px solid #bfdbfe; color: #1e3a8a; }
.message-meta { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; font-size: 11px; color: #6b7280; }
.conversation-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters-grid-erpro { display: grid; grid-template-columns: minmax(240px, 1.8fr) repeat(3, minmax(150px, 1fr)) repeat(2, minmax(130px, .8fr)); gap: 14px 16px; align-items: end; }
.filters-actions-erpro { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.filters-card-erpro { overflow: hidden; }
.attachment-file-cell { min-width: 0; }
.attachment-file-cell strong,
.attachment-contact-cell strong { display: block; }
.attachment-stack-cell { min-width: 0; }
.attachment-stack-cell strong { display: block; }
.attachment-meta-text { font-size: 12px; color: #6b7280; }
.attachment-meta-text.muted { color: #94a3b8; }
.attachment-inline-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.attachment-type-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.attachment-type-badge.image { background: #dbeafe; color: #1d4ed8; }
.attachment-type-badge.document { background: #e0e7ff; color: #4338ca; }
.attachment-type-badge.audio { background: #dcfce7; color: #166534; }
.attachment-type-badge.video { background: #fee2e2; color: #b91c1c; }
.attachment-direction-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 82px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.attachment-direction-badge.inbound { background: #fff7ed; color: #c2410c; }
.attachment-direction-badge.outbound { background: #eff6ff; color: #1d4ed8; }
.attachment-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.attachment-actions .btn-outline-erpro { padding: 6px 9px; font-size: 12px; justify-content: center; }
.transfer-helper-card { padding: 12px 14px; border: 1px solid #dbe3f0; border-radius: 12px; background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%); }
.transfer-helper-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.transfer-helper-subtitle { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.45; }
.transfer-helper-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.transfer-helper-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.transfer-helper-item strong { display: block; font-size: 13px; color: #111827; line-height: 1.4; }
.transfer-helper-item span { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.transfer-helper-item.is-current { border-color: #bfdbfe; background: #eff6ff; }
.transfer-helper-empty { font-size: 12.5px; color: #94a3b8; padding: 10px 2px; }
.timeline-item-erpro { padding: 12px 0; border-bottom: 1px solid #f0f2f5; }
.timeline-item-erpro:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.timeline-time { font-size: 11.5px; color: #94a3b8; white-space: nowrap; }
.timeline-description { font-size: 12.5px; color: #334155; line-height: 1.5; }
.timeline-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #64748b; margin-top: 6px; }
.timeline-badge-blue { background: #eff6ff; color: #1d4ed8; }
.timeline-badge-green { background: #dcfce7; color: #166534; }
.timeline-badge-yellow { background: #fef3c7; color: #92400e; }
.timeline-badge-red { background: #fee2e2; color: #b91c1c; }
.timeline-badge-gray { background: #f3f4f6; color: #4b5563; }
.attachments-table-card .dataTables_wrapper .row:first-child { align-items: center; }
.attachments-table-card .dataTables_wrapper .dataTables_length { margin-bottom: 0; }
.attachments-table-card .dataTables_wrapper .dataTables_paginate { margin-top: 10px; }
.attachments-table-card .table-erpro tbody td { padding-top: 14px; padding-bottom: 14px; }
.attachments-page .page-header { margin-bottom: 18px; }
.attachments-page .page-header p { max-width: 880px; }
.attachments-page .table-responsive-erpro { overflow-x: auto; }
.reports-page-header { margin-bottom: 16px; }
.reports-header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.reports-filter-card { margin-bottom: 16px; }
.reports-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.reports-kpi { position: relative; overflow: hidden; background: #fff; border: 1px solid #e9ecf0; border-radius: 14px; padding: 18px; box-shadow: 0 1px 3px rgba(15,23,42,.04); min-width: 0; }
.reports-kpi:before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #cbd5e1; }
.reports-kpi-primary:before { background: #2563eb; }
.reports-kpi-danger:before { background: #dc2626; }
.reports-kpi-warning:before { background: #d97706; }
.reports-kpi-label { font-size: 11.5px; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.reports-kpi-value { font-family: 'DM Mono', monospace; font-size: clamp(26px, 4vw, 36px); line-height: 1; font-weight: 800; color: #0f172a; letter-spacing: -.05em; }
.reports-kpi-note { margin-top: 10px; color: #64748b; font-size: 12.5px; line-height: 1.45; }
.reports-split-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.reports-side-stack { display: grid; grid-template-rows: auto 1fr; gap: 16px; min-width: 0; }
.reports-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.reports-section-heading h2 { font-size: 16px; font-weight: 800; color: #0f172a; margin: 0; }
.reports-section-heading p { font-size: 12.5px; color: #64748b; margin: 3px 0 0; line-height: 1.45; }
.reports-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 700; padding: 5px 10px; white-space: nowrap; }
.reports-empty-state { min-height: 220px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #64748b; padding: 22px; }
.reports-empty-state i { color: #16a34a; font-size: 30px; }
.reports-empty-state strong { color: #0f172a; }
.reports-critical-list { display: grid; gap: 10px; }
.reports-critical-item { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.1fr) auto; gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid #e5e7eb; border-radius: 13px; color: inherit; text-decoration: none; background: #fff; transition: border-color .15s, background .15s, transform .15s; }
.reports-critical-item:hover { border-color: #bfdbfe; background: #f8fbff; transform: translateY(-1px); color: inherit; }
.reports-critical-main { min-width: 0; }
.reports-critical-main strong { display: block; font-size: 13.5px; color: #0f172a; line-height: 1.35; }
.reports-critical-main span { display: block; margin-top: 3px; font-size: 12.5px; color: #64748b; }
.reports-critical-badges { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.reports-critical-meta { display: flex; align-items: center; gap: 10px; color: #64748b; font-size: 12.5px; white-space: nowrap; }
.reports-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reports-channel-grid > div { border: 1px solid #eef2f7; background: #f8fafc; border-radius: 12px; padding: 12px; min-width: 0; }
.reports-channel-grid span { display: block; font-size: 12px; color: #64748b; margin-bottom: 8px; }
.reports-channel-grid strong { font-family: 'DM Mono', monospace; font-size: 23px; line-height: 1; color: #0f172a; }
.reports-volume-list { display: grid; gap: 10px; max-height: 270px; overflow-y: auto; padding-right: 4px; }
.reports-volume-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 12.5px; color: #475569; }
.reports-volume-row > div { height: 12px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.reports-volume-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.reports-volume-row strong { text-align: right; font-family: 'DM Mono', monospace; color: #0f172a; }
.reports-mini-bar { width: min(120px, 100%); height: 6px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin-top: 7px; }
.reports-mini-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16a34a, #86efac); }
.reports-muted { color: #64748b; font-size: 13px; }
.reports-table-card { margin-bottom: 16px; }
.reports-detail-table tbody td { padding-top: 14px; padding-bottom: 14px; }
.reports-cell-sub { margin-top: 5px; font-size: 12px; color: #64748b; line-height: 1.4; }
.reports-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.reports-flags span { display: inline-flex; align-items: center; border-radius: 999px; background: #fff7ed; color: #c2410c; padding: 4px 8px; font-size: 11.5px; font-weight: 700; }
.reports-flags span.is-soft { background: #f1f5f9; color: #64748b; }
.reports-open-button { padding: 6px 10px; font-size: 12px; justify-content: center; }
.server-metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.server-metric-card { background: #fff; border: 1px solid #e9ecf0; border-radius: 16px; padding: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.04); min-width: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.server-metric-card-accent { border-color: #fecaca; background: linear-gradient(180deg, #fff 0%, #fff7f7 100%); }
.server-metric-card-green { border-color: #bbf7d0; background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%); }
.server-metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.server-metric-top span { display: block; font-size: 11px; color: #64748b; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 0; line-height: 1.25; }
.server-metric-top i { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; color: #2563eb; font-size: 14px; }
.server-metric-card-accent .server-metric-top i { color: #dc2626; background: #fee2e2; }
.server-metric-card-green .server-metric-top i { color: #059669; background: #dcfce7; }
.server-metric-card strong { display: flex; align-items: baseline; gap: 5px; font-family: 'DM Mono', monospace; font-size: clamp(23px, 2.4vw, 32px); line-height: 1; color: #0f172a; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.04em; }
.server-metric-card strong em { font-style: normal; font-size: .55em; font-weight: 800; letter-spacing: 0; color: #334155; }
.server-metric-card small { display: block; color: #64748b; line-height: 1.35; min-height: 34px; font-size: 12px; }
.server-metric-card small span { display: inline; font-size: inherit; color: inherit; font-weight: 700; letter-spacing: 0; text-transform: none; margin: 0; }
.server-metric-bar { width: 100%; height: 7px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin-top: auto; }
.server-metric-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #60a5fa); transition: width .25s ease; }
.server-metric-card-accent .server-metric-bar i { background: linear-gradient(90deg, #dc2626, #fb7185); }
.server-metric-card-green .server-metric-bar i { background: linear-gradient(90deg, #059669, #34d399); }
.server-metrics-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr); gap: 16px; align-items: stretch; }
.server-chart-wrap { min-height: 320px; position: relative; }
.server-diagnostic-list { display: grid; gap: 12px; }
.server-diagnostic-list > div { border: 1px solid #eef2f7; border-radius: 12px; background: #f8fafc; padding: 12px; min-width: 0; }
.server-diagnostic-list span { display: block; color: #64748b; font-size: 12px; margin-bottom: 6px; }
.server-diagnostic-list strong { display: block; color: #0f172a; font-size: 13.5px; overflow-wrap: anywhere; line-height: 1.45; }
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; }
#sidebar-overlay.active { display: block; }
@media (max-width: 1399.98px) {
    .chat-shell { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); }
    .chat-shell > aside:last-child { grid-column: 1 / -1; }
    .filters-grid-erpro { grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(160px, 1fr)); }
    .reports-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .reports-split-grid { grid-template-columns: 1fr; }
    .reports-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
    .server-metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .server-metrics-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1199.98px) {
    .chat-shell { grid-template-columns: 1fr; }
    .message-thread { max-height: none; }
    .chat-shell > aside:last-child { grid-column: auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-grid-erpro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-critical-item { grid-template-columns: minmax(0, 1fr); }
    .reports-critical-meta { justify-content: space-between; }
    .table-erpro thead th, .erpro-table th,
    .table-erpro tbody td, .erpro-table td {
        min-width: 0 !important;
    }
}
@media (max-width: 991.98px) {
    .dataTables_wrapper .row:first-child > div,
    .dataTables_wrapper .row:last-child > div { text-align: left !important; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_filter label { justify-content: flex-start; }
    .dataTables_wrapper .dataTables_filter input { width: 100%; min-width: 0; }
    .table-erpro thead th, .erpro-table th {
        white-space: nowrap !important;
        width: auto !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
    }
    .table-erpro tbody td, .erpro-table td {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
    }
    .conversation-actions > * { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .filters-grid-erpro { grid-template-columns: 1fr; }
    .attachment-actions { min-width: 140px; }
    .attachment-inline-group { flex-direction: column; align-items: flex-start; gap: 6px; }
    .timeline-item-top { flex-direction: column; align-items: flex-start; }
    .reports-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-side-stack { grid-template-columns: 1fr; }
    .reports-header-actions { justify-content: flex-start; }
    .server-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); max-width: min(86vw, var(--sidebar-width)); }
    #sidebar.open { transform: translateX(0); }
    #main-wrapper { margin-left: 0; width: 100%; max-width: 100%; }
    body.sidebar-hidden #sidebar { transform: translateX(-100%); }
    #topbar { padding: 0 14px; }
    #main-content { padding: 16px 14px 20px; }
    .erpro-card, .stat-card { padding: 16px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header > * { width: 100%; }
    .page-header .btn-primary-erpro,
    .page-header .btn-outline-erpro { width: 100%; justify-content: center; }
    .table-responsive-erpro { margin: 0 -4px; width: calc(100% + 8px); }
    .table-erpro thead th, .erpro-table th,
    .table-erpro tbody td, .erpro-table td { padding: 10px 10px; font-size: 12.5px; }
    .table-erpro thead th, .erpro-table th { white-space: nowrap !important; letter-spacing: .03em; }
    .table-erpro tbody td, .erpro-table td { overflow-wrap: normal !important; word-break: normal !important; }
    .table-erpro tbody td:first-child,
    .erpro-table tbody td:first-child { min-width: 0; max-width: calc(100vw - 126px); }
    .table-erpro tbody td:first-child *,
    .erpro-table tbody td:first-child * {
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        min-width: 0 !important;
    }
    .table-erpro tbody td:first-child strong,
    .erpro-table tbody td:first-child strong,
    .table-erpro tbody td:first-child [style*="font-weight:700"],
    .erpro-table tbody td:first-child [style*="font-weight:700"] {
        display: block;
        overflow-wrap: break-word !important;
        word-break: normal !important;
        line-height: 1.35;
    }
    .table-erpro tbody td:first-child > div,
    .erpro-table tbody td:first-child > div {
        align-items: flex-start !important;
    }
    .table-erpro tbody td:first-child .badge-erpro,
    .erpro-table tbody td:first-child .badge-erpro {
        display: inline-flex;
    }
    .table-erpro tbody td:last-child,
    .erpro-table tbody td:last-child { width: 70px !important; max-width: 78px; }
    .table-erpro tbody td:last-child .btn-outline-erpro,
    .erpro-table tbody td:last-child .btn-outline-erpro {
        padding: 6px 8px !important;
        font-size: 0 !important;
        width: 42px;
        height: 36px;
        justify-content: center;
    }
    .table-erpro tbody td:last-child .btn-outline-erpro i,
    .erpro-table tbody td:last-child .btn-outline-erpro i {
        font-size: 15px !important;
        margin: 0;
    }
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control { padding-left: 42px !important; position: relative; }
    .dataTables_wrapper .dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    .dataTables_wrapper .dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        width: 22px;
        height: 22px;
        line-height: 22px;
        border-radius: 999px;
        font-size: 14px;
        text-indent: 0;
        text-align: center;
    }
    .dataTables_wrapper table.dataTable > tbody > tr.child ul.dtr-details {
        display: block;
        width: 100%;
        padding: 8px 2px;
    }
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label { justify-content: flex-start; }
    .dataTables_wrapper .dataTables_paginate { overflow-x: auto; }
    .conversation-actions > * { flex: 1 1 100%; }
    .detail-row { flex-direction: column; align-items: flex-start; }
    .detail-row span:last-child { text-align: left; }
    .message-bubble { max-width: 92%; }
    .stats-grid { grid-template-columns: 1fr; }
    .filters-actions-erpro > * { width: 100%; justify-content: center; }
    .attachments-page .table-responsive-erpro { margin: 0; width: 100%; }
    .reports-kpi-grid { grid-template-columns: 1fr; }
    .reports-channel-grid { grid-template-columns: 1fr; }
    .reports-section-heading { flex-direction: column; }
    .reports-critical-item { padding: 12px; }
    .server-metrics-grid { grid-template-columns: 1fr; }
    .server-chart-wrap { min-height: 260px; }
}
