/* Modals - все модальные окна */

/* JSON Viewer Modal */
.json-viewer-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
}

.json-viewer-content {
    background-color: #1e1e1e;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.json-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #444;
}

.json-viewer-header h3 {
    color: #fff;
    margin: 0;
}

.json-viewer-close {
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 10px;
}

.json-viewer-close:hover {
    color: #ff4444;
}

.json-viewer-body {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 4px;
    overflow: auto;
    max-height: 65vh;
}

/* JSON Formatter Dark Theme Styles */
.json-viewer-body .json-formatter-row {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.json-viewer-body .json-formatter-row .json-formatter-key {
    color: #9cdcfe;
    font-weight: normal;
}

.json-viewer-body .json-formatter-row .json-formatter-string {
    color: #ce9178;
}

.json-viewer-body .json-formatter-row .json-formatter-number {
    color: #b5cea8;
}

.json-viewer-body .json-formatter-row .json-formatter-boolean {
    color: #569cd6;
}

.json-viewer-body .json-formatter-row .json-formatter-null {
    color: #569cd6;
}

.json-viewer-body .json-formatter-row .json-formatter-undefined {
    color: #569cd6;
}

.json-viewer-body .json-formatter-row .json-formatter-constructor-name {
    color: #4ec9b0;
}

.json-viewer-body .json-formatter-row .json-formatter-bracket {
    color: #ffd700;
}

.json-viewer-body .json-formatter-toggler {
    color: #d4d4d4;
    opacity: 0.6;
    cursor: pointer;
    user-select: none;
}

.json-viewer-body .json-formatter-toggler:hover {
    opacity: 1;
}

.json-viewer-body .json-formatter-toggler-link {
    color: #858585;
}

.json-viewer-body a {
    color: #4fc3f7;
    text-decoration: none;
}

.json-viewer-body a:hover {
    text-decoration: underline;
}

.json-button {
    background: #607d8b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: monospace;
    margin-left: 10px;
}

.json-button:hover {
    background: #546e7a;
}

/* ERID Modal */
.erid-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.erid-modal-overlay.show {
    display: flex;
}

.erid-modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease-out;
}

.erid-modal-content.defect {
    border: 3px solid #ff5722;
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.4);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.erid-modal-close {
    position: sticky;
    top: 10px;
    float: right;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 11;
    margin: -8px -8px 0 0;
}

.erid-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.erid-modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 15px 40px 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.erid-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
}

.erid-modal-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.erid-modal-header-info span {
    white-space: nowrap;
}

.erid-modal-erid {
    font-family: monospace;
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.erid-modal-erid:hover {
    background: #e8e8e8;
}

.erid-modal-copy-icon {
    width: 14px;
    height: 14px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.erid-modal-copy-icon:hover {
    opacity: 1;
}

.erid-modal-body {
    margin-bottom: 20px;
}

.erid-modal-field {
    margin-bottom: 16px;
}

.erid-modal-field-label {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.erid-modal-field-value {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.erid-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.erid-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.erid-modal-btn-primary {
    background: #1976d2;
    color: white;
}

.erid-modal-btn-primary:hover {
    background: #1565c0;
}

.erid-modal-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.erid-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.erid-modal-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.erid-modal-btn-secondary:hover {
    background: #e0e0e0;
}

.erid-modal-btn-danger {
    background: #ff5722;
    color: white;
}

.erid-modal-btn-danger:hover {
    background: #e64a19;
}

/* ERID ссылки */
.erid-link {
    color: #1976d2;
    text-decoration: none;
    font-family: monospace;
    cursor: pointer;
    transition: color 0.2s;
}

.erid-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* ERID модальное окно - дополнительные стили */
.erid-modal-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.erid-modal-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.erid-modal-error {
    padding: 16px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    font-size: 14px;
    margin-bottom: 16px;
}

.erid-modal-section {
    margin-bottom: 24px;
}

.erid-modal-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.erid-modal-info-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 8px 16px;
    font-size: 13px;
}

.erid-modal-info-label {
    font-weight: 600;
    color: #666;
}

.erid-modal-info-value {
    color: #333;
    word-break: break-word;
}

.erid-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 12px;
}

.erid-modal-table th {
    background: #f5f5f5;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.erid-modal-table td {
    padding: 8px;
    border: 1px solid #e0e0e0;
    vertical-align: top;
}

.erid-modal-table tr:hover {
    background: #f9f9f9;
}

.erid-modal-table-deleted {
    background: #f5f5f5 !important;
}

.erid-modal-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.erid-modal-stats-toggle {
    color: #1976d2;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
}

.erid-modal-stats-toggle:hover {
    color: #1565c0;
}

.erid-modal-stats-row {
    display: none;
}

.erid-modal-stats-row.show {
    display: table-row;
}

.erid-modal-stats-cell {
    padding: 12px 16px !important;
    background: #f9f9f9 !important;
    border-left: 3px solid #1976d2 !important;
}

.erid-modal-stats-details {
    font-size: 12px;
    line-height: 1.6;
}

.erid-modal-stats-item {
    display: inline-block;
    margin-right: 24px;
    margin-bottom: 8px;
}

.erid-modal-stats-item strong {
    color: #1976d2;
}

.erid-modal-text-content {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #1976d2;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.erid-modal-text-item {
    margin-bottom: 12px;
}

.erid-modal-text-item:last-child {
    margin-bottom: 0;
}

.erid-modal-text-number {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

/* Publications Modal */
.publications-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.publications-modal-content {
    background-color: #fff;
    margin: 30px auto;
    padding: 0;
    border-radius: 8px;
    width: 95%;
    max-width: 1400px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.publications-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid #e0e0e0;
}

.publications-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
}

.publications-modal-close {
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.publications-modal-close:hover {
    color: #ffeb3b;
}

.publications-modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.publications-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.publications-modal-body table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

.publications-modal-body table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}

.publications-modal-body table tr:hover {
    background-color: #f9f9f9;
}

/* Pad Info Panel - виджет информации о площадке */
.pad-info-panel {
    font-size: 11px;
    line-height: 1.5;
}

.pad-info-content {
    padding: 10px;
}

.pad-info-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.pad-info-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.pad-info-fields {
    margin-bottom: 12px;
}

.pad-field-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.pad-field-label {
    flex: 0 0 70px;
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

.pad-field-value {
    flex: 1;
    font-size: 10px;
    color: #333;
    word-break: break-word;
}

.pad-editable {
    background: #f5f5f5;
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: text;
    transition: all 0.15s;
    min-height: 18px;
    outline: none;
}

.pad-editable:hover {
    background: #eee;
    border-color: #ddd;
}

.pad-editable:focus,
.pad-editable.editing {
    background: #fff;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.pad-editable.changed {
    background: #fff3e0;
    border-color: #ff9800;
}

.pad-field-select {
    flex: 1;
    font-size: 10px;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f5f5f5;
    cursor: pointer;
    max-width: 100%;
}

.pad-field-select:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.pad-field-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.pad-field-readonly .pad-field-value {
    color: #888;
    font-size: 9px;
}

.pad-info-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

.pad-info-actions {
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.pad-save-btn {
    width: 100%;
    padding: 8px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.pad-save-btn:hover:not(:disabled) {
    background: #1565c0;
}

.pad-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Pad Link - кликабельные названия площадок */
.pad-link {
    color: #1976d2;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.pad-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* Stats Generation Modal */
.stats-gen-modal-content {
    max-width: 1100px;
}

.stats-gen-editable:hover {
    background: #e3f2fd;
    border-color: #90caf9 !important;
}

.stats-gen-editable:focus {
    background: #fff;
    border-color: #1976d2 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* ============================================================ */
/* User Settings Modal                                          */
/* Density: compact; no inline styles — защита от «уезжания».   */
/* ============================================================ */

.user-settings-modal .us-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    width: min(640px, 94vw);
    max-height: min(84vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Шапка: title + chat_id/user_id — переносятся корректно при нехватке места */
.user-settings-modal .us-head {
    padding: 10px 40px 10px 16px;
    border-bottom: 1px solid #ececec;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}
.user-settings-modal .us-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    flex: 0 0 auto;
}
.user-settings-modal .us-ids {
    font-size: 11px;
    color: #888;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    overflow: hidden;
}
.user-settings-modal .us-id-key {
    color: #aaa;
    font-weight: 500;
    margin-right: 3px;
}
.user-settings-modal .us-id-user code {
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

/* Cabinet-bar (владелец + кабинет) */
.user-settings-modal .us-cab-bar {
    padding: 8px 16px;
    border-bottom: 1px solid #ececec;
    background: #fafafa;
}

/* Табы */
.user-settings-modal .us-tabs {
    display: flex;
    gap: 2px;
    padding: 4px 12px 0;
    border-bottom: 1px solid #ececec;
    flex-wrap: wrap;
}
.user-settings-modal .us-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    margin-bottom: -1px;
}
.user-settings-modal .us-tab:hover { color: #1976d2; }
.user-settings-modal .us-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    font-weight: 600;
}

/* Тело вкладки */
.user-settings-modal .us-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.user-settings-modal .us-section { margin-bottom: 12px; }
.user-settings-modal .us-section:last-child { margin-bottom: 0; }
.user-settings-modal .us-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
    margin: 6px 0 6px;
    font-weight: 600;
}
.user-settings-modal .us-summary {
    background: #fafbfc;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 8px 10px;
}
.user-settings-modal .us-row {
    font-size: 12px;
    padding: 2px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.user-settings-modal .us-key {
    color: #999;
    min-width: 72px;
    font-size: 11px;
}

/* Форма: 2 колонки, но аккуратный min-width против overflow */
.user-settings-modal .us-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.user-settings-modal .us-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.user-settings-modal .us-field-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}
.user-settings-modal .us-field select,
.user-settings-modal .us-field input {
    width: 100%;
    padding: 5px 7px;
    font-size: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}
.user-settings-modal .us-field select:focus,
.user-settings-modal .us-field input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15);
}

.user-settings-modal .us-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}
.user-settings-modal .us-actions-hint {
    color: #999;
    font-size: 10px;
}
.user-settings-modal .us-hint-sm { margin-top: 4px; }

.user-settings-modal .us-extend-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.user-settings-modal .us-btn-sm {
    padding: 4px 10px !important;
    font-size: 11px !important;
    min-height: auto !important;
}
.user-settings-modal .us-hint {
    font-size: 11px;
    color: #777;
    background: #f5f7fa;
    border-left: 3px solid #90caf9;
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 3px;
}
.user-settings-modal .us-empty,
.user-settings-modal .us-loading {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 13px;
}
.user-settings-modal .us-error {
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
}

.user-settings-modal .us-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    letter-spacing: 0.4px;
}
.user-settings-modal .us-badge.ok { background: #e8f5e9; color: #2e7d32; }
.user-settings-modal .us-badge.warn { background: #fff3e0; color: #e65100; }

/* Расширения — строки списка */
.user-settings-modal .us-ext-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.user-settings-modal .us-ext-row {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 8px 10px;
    background: #fafafa;
    transition: background 0.15s;
}
.user-settings-modal .us-ext-row:hover { background: #f5f5f5; }
.user-settings-modal .us-ext-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-settings-modal .us-ext-text { flex: 1; min-width: 0; }
.user-settings-modal .us-ext-title {
    font-size: 13px;
    color: #222;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.user-settings-modal .us-ext-id {
    color: #999;
    font-size: 10px;
    font-family: monospace;
}
.user-settings-modal .us-ext-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.user-settings-modal .us-ext-configure {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}
.user-settings-modal .us-ext-configure:hover { background: #fff; color: #1976d2; }
.user-settings-modal .us-ext-config {
    margin-top: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}
.user-settings-modal .us-ext-config textarea {
    width: 100%;
    font-family: monospace;
    font-size: 12px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    resize: vertical;
    box-sizing: border-box;
}

/* iOS-style switch */
.user-settings-modal .us-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.user-settings-modal .us-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.user-settings-modal .us-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    transition: 0.2s;
    border-radius: 20px;
}
.user-settings-modal .us-switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.user-settings-modal .us-switch input:checked + .us-switch-slider { background: #1976d2; }
.user-settings-modal .us-switch input:checked + .us-switch-slider:before {
    transform: translateX(16px);
}

/* Блок владельца в шапке модалки (остаётся виден при смене вкладок) */
.user-settings-modal .us-owner {
    min-width: 0;
}
.user-settings-modal .us-owner-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}
.user-settings-modal .us-owner-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.user-settings-modal .us-owner-tariff {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 1px 6px;
    border-radius: 8px;
    background: #f0f0f0;
    color: #757575;
    flex-shrink: 0;
}
.user-settings-modal .us-owner-tariff-pro { background: #e8f5e9; color: #2e7d32; }
.user-settings-modal .us-owner-tariff-ip { background: #fff3e0; color: #e65100; }
.user-settings-modal .us-owner-tariff-ip_expert_tariff { background: #fff3e0; color: #e65100; }
.user-settings-modal .us-owner-tariff-ooo { background: #f3e5f5; color: #7b1fa2; }
.user-settings-modal .us-owner-tariff-admin { background: #ffebee; color: #c62828; }
.user-settings-modal .us-owner-tariff-plus { background: #e3f2fd; color: #1565c0; }

.user-settings-modal .us-owner-sub {
    font-size: 11px;
    color: #777;
    margin-top: 1px;
}
.user-settings-modal .us-owner-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.user-settings-modal .us-owner-contact {
    font-size: 10px;
    color: #1565c0;
    text-decoration: none;
    background: #e3f2fd;
    padding: 1px 6px;
    border-radius: 3px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-settings-modal .us-owner-contact:hover { background: #bbdefb; }

.user-settings-modal .us-owner-counters {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
}

.user-settings-modal .us-cab-line {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e5e5e5;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.user-settings-modal .us-cab-line label {
    display: flex;
    align-items: center;
    gap: 4px;
}
.user-settings-modal .us-cab-label {
    color: #888;
}
.user-settings-modal .us-cab-provider { color: #aaa; }
.user-settings-modal .us-cab-select {
    padding: 2px 6px;
    font-size: 11px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: #fff;
    font-family: inherit;
}

/* Кнопка-шестерёнка в CRM-карточке */
.crm-card-settings {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    padding: 2px 6px;
    margin-left: 4px;
}
.crm-card-settings:hover {
    color: #1976d2;
    border-color: #1976d2;
    background: #e3f2fd;
}
