/* LogReader — вкладка админки L2 */

.logreader-main {
    padding: 20px;
}

.lr-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 16px;
}

.lr-title {
    margin: 0 0 4px;
    padding: 0;
    border: none;
    font-size: 26px;
    color: #222;
}

.lr-subtitle {
    color: #666;
    font-size: 14px;
}

.lr-version {
    color: #888;
    font-size: 13px;
    background: #f1f3f5;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 4px 10px;
    white-space: nowrap;
}

.lr-top-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lr-top-tab {
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    border-radius: 5px 5px 0 0;
    margin-bottom: -2px;
}

.lr-top-tab:hover {
    background: #f1f3f5;
    color: #222;
}

.lr-top-tab.active {
    background: #fff;
    color: #007bff;
    border-color: #e5e5e5;
    border-bottom: 2px solid #fff;
    font-weight: bold;
}

.lr-page {
    display: none;
}

.lr-page.active {
    display: block;
}

.lr-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lr-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.lr-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lr-card-head .lr-card-title {
    margin-bottom: 0;
}

.lr-hint {
    color: #6c757d;
    font-size: 12px;
    margin-top: 8px;
}

.lr-hint-inline {
    color: #999;
    font-size: 11px;
    margin-left: auto;
}

.lr-muted {
    color: #6c757d;
    font-size: 13px;
}

.lr-badge {
    display: inline-block;
    min-width: 20px;
    background: #e9ecef;
    color: #495057;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: normal;
    text-align: center;
}

.lr-input {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    min-width: 0;
}

.lr-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.lr-input.lr-grow {
    flex: 1;
}

.lr-input.lr-small {
    width: 130px;
}

.lr-input.lr-tiny {
    width: 78px;
}

.lr-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.lr-period-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.lr-radio {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.lr-devices-card {
    min-height: 220px;
}

.lr-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.lr-device-card {
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    padding: 12px;
    background: #fbfcfd;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    position: relative;
}

.lr-device-card:hover {
    border-color: #80bdff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.08);
}

.lr-device-card.selected {
    border-color: #007bff;
    background: #f1f8ff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}

.lr-device-top {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.lr-device-check {
    margin-top: 3px;
}

.lr-device-host {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    word-break: break-all;
}

.lr-device-comment {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
    min-height: 16px;
}

.lr-device-meta {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.lr-status {
    display: inline-block;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    background: #e9ecef;
    color: #495057;
}

.lr-status.connected {
    background: #d4edda;
    color: #155724;
}

.lr-status.connecting {
    background: #fff3cd;
    color: #856404;
}

.lr-status.error {
    background: #f8d7da;
    color: #721c24;
}

.lr-device-info {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.lr-chip {
    background: #f1f3f5;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #555;
}

.lr-chip.ok {
    background: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.lr-chip.warn {
    background: #fff8e1;
    border-color: #ffe0b2;
    color: #8d6e63;
}

.lr-device-progress {
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    margin-top: 9px;
    overflow: hidden;
}

.lr-device-progress > div {
    height: 100%;
    background: #007bff;
    width: 0;
    transition: width 0.3s;
}

.lr-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.lr-mini-btn {
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    cursor: pointer;
}

.lr-mini-btn:hover {
    background: #f1f3f5;
    border-color: #adb5bd;
}

.lr-actionbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.lr-actionbar-sep {
    width: 1px;
    height: 24px;
    background: #e1e4e8;
    margin: 0 4px;
}

.lr-actions-inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lr-empty {
    color: #999;
    font-style: italic;
    padding: 18px 10px;
    text-align: center;
    border: 1px dashed #dee2e6;
    border-radius: 5px;
}

.lr-progress-wrap {
    margin-bottom: 8px;
}

.lr-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.lr-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.lr-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #4dabf7);
    transition: width 0.25s;
}

.lr-console {
    background: #1e1f22;
    color: #d7dae0;
    border-radius: 5px;
    padding: 10px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    height: 220px;
    overflow-y: auto;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.lr-console-line {
    border-bottom: 1px solid #2e3034;
    padding: 1px 0;
}

.lr-console-line .lr-console-time {
    color: #8b929e;
    margin-right: 8px;
}

.lr-console-line.success {
    color: #7ee787;
}

.lr-console-line.error {
    color: #ff7b72;
}

.lr-console-line.warning {
    color: #e3b341;
}

.lr-console-line.info {
    color: #d7dae0;
}

.lr-analyze-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.lr-file-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px;
    background: #fff;
    font-size: 13px;
    max-width: 100%;
}

.lr-upload-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lr-upload-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 5px 9px;
    font-size: 12px;
    color: #555;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.lr-analyses-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lr-analysis-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid #dfe3e8;
    background: #fbfcfd;
    border-radius: 5px;
    padding: 9px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.lr-analysis-card:hover {
    border-color: #80bdff;
    background: #f1f8ff;
}

.lr-analysis-title {
    font-weight: bold;
    color: #222;
    font-size: 14px;
}

.lr-analysis-meta {
    color: #777;
    font-size: 12px;
    margin-top: 2px;
}

.lr-analysis-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.lr-settings-grid {
    display: grid;
    grid-template-columns: 230px minmax(220px, 1fr);
    gap: 10px 14px;
    align-items: center;
    max-width: 900px;
}

.lr-label {
    color: #555;
    font-size: 13px;
}

.lr-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.lr-check {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

/* ============================ MODALS ============================ */

.lr-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(20, 25, 35, 0.55);
    padding: 20px;
    overflow: auto;
}

.lr-modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.lr-modal-dialog {
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
}

.lr-modal-dialog.lr-modal-large {
    max-width: 1500px;
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
}

.lr-modal-dialog.lr-modal-small {
    max-width: 460px;
}

.lr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.lr-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

.lr-modal-subtitle {
    color: #777;
    font-size: 12px;
    margin-top: 3px;
    word-break: break-word;
}

.lr-modal-actions {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.lr-modal-actions-right {
    justify-content: flex-end;
    margin-top: 16px;
}

.lr-modal-body {
    padding: 14px 18px;
    overflow: auto;
    flex: 1;
}

.lr-device-tabs,
.lr-result-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 12px;
}

.lr-device-tab,
.lr-result-tab {
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    padding: 7px 12px;
    margin-bottom: -1px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    color: #555;
    font-size: 13px;
}

.lr-device-tab:hover,
.lr-result-tab:hover {
    background: #f1f3f5;
}

.lr-device-tab.active,
.lr-result-tab.active {
    background: #fff;
    border-color: #e5e5e5;
    border-bottom: 1px solid #fff;
    color: #007bff;
    font-weight: bold;
}

.lr-result-content {
    font-size: 13px;
    color: #333;
}

.lr-stats-pre {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 5px;
    padding: 14px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    color: #333;
}

.lr-filterbar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
}

.lr-filter-btn {
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 12px;
    cursor: pointer;
}

.lr-filter-btn:hover {
    background: #e9ecef;
}

.lr-filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.lr-filterbar select {
    padding: 4px 7px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
}

.lr-info-line {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.lr-table-wrap {
    overflow: auto;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    max-height: calc(100vh - 300px);
}

.lr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 0;
    background: #fff;
}

.lr-table th,
.lr-table td {
    border: 1px solid #e9ecef;
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.lr-table th {
    background: #f1f3f5;
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 11px;
    color: #495057;
}

.lr-table tr:nth-child(even) {
    background: #fcfcfd;
}

.lr-table tr.date-row td {
    background: #e9f2ff;
    font-weight: bold;
    color: #0b4f8a;
}

.lr-table tr.clickable {
    cursor: pointer;
}

.lr-table tr.clickable:hover {
    background: #f1f8ff;
}

.lr-table td.lr-wrap {
    white-space: normal;
    word-break: break-word;
    min-width: 220px;
}

.lr-table .lr-detail-row td {
    background: #f8f9fa;
    padding: 8px 12px;
}

.lr-status-text.ok { color: #1e7e34; font-weight: bold; }
.lr-status-text.warn { color: #b26a00; font-weight: bold; }
.lr-status-text.error { color: #c82333; font-weight: bold; }
.lr-status-text.muted { color: #6c757d; font-weight: bold; }
.lr-status-text.info { color: #0069d9; font-weight: bold; }

.lr-detail-block {
    margin: 6px 0 10px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    background: #fff;
}

.lr-detail-block > .lr-detail-title {
    background: #f1f3f5;
    padding: 5px 9px;
    font-weight: bold;
    color: #444;
    font-size: 12px;
    border-bottom: 1px solid #e1e4e8;
}

.lr-detail-block > .lr-detail-body {
    padding: 8px 10px;
}

.lr-kv {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    font-size: 12px;
    color: #555;
}

.lr-kv span b {
    color: #333;
}

.lr-event-list {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #555;
    font-family: "Courier New", monospace;
}

.lr-event-list li {
    margin: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.lr-suspicious {
    color: #c82333;
    font-weight: bold;
}

.lr-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: #f1f3f5;
    border: 1px solid #e1e4e8;
    font-size: 11px;
    color: #555;
    margin-right: 4px;
}

.lr-tag.red { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.lr-tag.green { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.lr-tag.yellow { background: #fff3cd; border-color: #ffeeba; color: #856404; }
.lr-tag.blue { background: #d1ecf1; border-color: #bee5eb; color: #0c5460; }

.lr-confirm-text {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.lr-mono {
    font-family: "Courier New", monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .lr-settings-grid {
        grid-template-columns: 1fr;
    }
    .lr-title-row {
        flex-direction: column;
    }
    .lr-modal {
        padding: 6px;
    }
    .lr-modal-dialog {
        margin: 6px auto;
        max-height: calc(100vh - 12px);
    }
    .lr-modal-dialog.lr-modal-large {
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
    }
}

/* Поддержка тёмной темы основной админки (переменные style.css) */
.dark-theme .logreader-main {
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-title,
.dark-theme .lr-card-title,
.dark-theme .lr-device-host,
.dark-theme .lr-analysis-title,
.dark-theme .lr-modal-title {
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-subtitle,
.dark-theme .lr-muted,
.dark-theme .lr-hint,
.dark-theme .lr-analysis-meta,
.dark-theme .lr-device-comment,
.dark-theme .lr-info-line,
.dark-theme .lr-label,
.dark-theme .lr-modal-subtitle {
    color: var(--text-color-muted, #aaa);
}
.dark-theme .lr-card,
.dark-theme .lr-modal-dialog,
.dark-theme .lr-modal-header,
.dark-theme .lr-analysis-card,
.dark-theme .lr-device-card,
.dark-theme .lr-upload-item,
.dark-theme .lr-filterbar,
.dark-theme .lr-detail-block,
.dark-theme .lr-detail-block > .lr-detail-body {
    background: var(--main-bg, #2a2a2a);
    border-color: var(--border-color, #444);
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-modal-header,
.dark-theme .lr-detail-block > .lr-detail-title,
.dark-theme .lr-filterbar,
.dark-theme .lr-upload-item {
    background: var(--form-bg, #2c2c2c);
}
.dark-theme .lr-input,
.dark-theme .lr-file-input,
.dark-theme .lr-filterbar select,
.dark-theme .lr-mini-btn,
.dark-theme .lr-filter-btn {
    background: var(--input-bg, #333);
    border-color: var(--input-border, #555);
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-filter-btn.active {
    background: var(--btn-primary-bg, #2c7ab8);
    border-color: var(--btn-primary-bg, #2c7ab8);
    color: #fff;
}
.dark-theme .lr-table,
.dark-theme .lr-table th,
.dark-theme .lr-table td {
    background: var(--main-bg, #2a2a2a);
    border-color: var(--border-color, #444);
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-table th {
    background: var(--table-header-bg, #333);
}
.dark-theme .lr-table tr:nth-child(even) {
    background: var(--table-alt-row, #303030);
}
.dark-theme .lr-table tr.clickable:hover {
    background: var(--table-hover-bg, #3a3a3a);
}
.dark-theme .lr-table tr.date-row td {
    background: var(--info-bg, #1d3c44);
    color: var(--info-color, #75b9c8);
}
.dark-theme .lr-table .lr-detail-row td {
    background: var(--form-bg, #2c2c2c);
}
.dark-theme .lr-stats-pre,
.dark-theme .lr-console {
    background: var(--log-bg, #1a1a1a);
    border-color: var(--log-border, #444);
    color: var(--log-text, #e0e0e0);
}
.dark-theme .lr-empty {
    border-color: var(--border-color, #444);
    color: var(--text-color-muted, #aaa);
}
.dark-theme .lr-badge {
    background: var(--form-bg, #2c2c2c);
    color: var(--text-color, #f0f0f0);
}

/* ===== Упрощённый интерфейс: импорт по ссылке и встроенный результат ===== */
.lr-import-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}
.lr-import-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lr-import-label {
    font-weight: bold;
    font-size: 13px;
    color: var(--text-color, #333);
}
.lr-import-or {
    align-self: center;
    color: var(--text-color-muted, #999);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.lr-device-add-row {
    margin-bottom: 10px;
}
.lr-result-card {
    border-top: 3px solid var(--btn-primary-bg, #3498db);
}
.lr-result-subtitle {
    color: var(--text-color-muted, #777);
    font-size: 12px;
    margin-top: 3px;
    word-break: break-word;
}
.lr-result-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lr-result-toolbar select {
    padding: 6px 9px;
    border: 1px solid var(--input-border, #ced4da);
    border-radius: 4px;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
    font-size: 13px;
    min-width: 220px;
}
.lr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 9px;
    margin-bottom: 14px;
}
.lr-kpi {
    background: var(--form-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e1e4e8);
    border-radius: 6px;
    padding: 10px 12px;
}
.lr-kpi-value {
    font-size: 21px;
    font-weight: bold;
    line-height: 1.15;
    color: var(--text-color, #222);
}
.lr-kpi-label {
    font-size: 11px;
    color: var(--text-color-muted, #777);
    margin-top: 3px;
}
.lr-kpi.ok .lr-kpi-value { color: #1e7e34; }
.lr-kpi.warn .lr-kpi-value { color: #b26a00; }
.lr-kpi.error .lr-kpi-value { color: #c82333; }
.lr-result-sections {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lr-result-section {
    border: 1px solid var(--border-color, #e1e4e8);
    border-radius: 6px;
    background: var(--main-bg, #fff);
    overflow: hidden;
}
.lr-result-section > summary {
    cursor: pointer;
    padding: 10px 13px;
    font-weight: bold;
    color: var(--text-color, #333);
    background: var(--form-bg, #f8f9fa);
    user-select: none;
    list-style: none;
}
.lr-result-section > summary::-webkit-details-marker { display: none; }
.lr-result-section > summary::before {
    content: "▸";
    display: inline-block;
    width: 16px;
    color: var(--link-color, #007bff);
}
.lr-result-section[open] > summary::before { content: "▾"; }
.lr-result-section > summary .lr-section-hint {
    font-weight: normal;
    font-size: 12px;
    color: var(--text-color-muted, #777);
    margin-left: 8px;
}
.lr-section-body {
    padding: 10px 12px 12px;
}
.lr-search-input {
    min-width: 230px;
    flex: 0 1 300px;
}
.dark-theme .lr-import-label,
.dark-theme .lr-result-section > summary,
.dark-theme .lr-kpi-value {
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-kpi,
.dark-theme .lr-result-section {
    background: var(--main-bg, #2a2a2a);
    border-color: var(--border-color, #444);
}
.dark-theme .lr-result-section > summary {
    background: var(--form-bg, #2c2c2c);
}
@media (max-width: 950px) {
    .lr-import-grid {
        grid-template-columns: 1fr;
    }
    .lr-import-or {
        text-align: center;
    }
}

/* Дополнительная читаемость тёмной темы в модальных окнах и деталях */
.dark-theme .lr-modal {
    background: rgba(0, 0, 0, 0.72);
}
.dark-theme .lr-modal-dialog,
.dark-theme .lr-modal-body {
    background: var(--main-bg, #2a2a2a);
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-modal-header {
    background: var(--form-bg, #2c2c2c);
    border-color: var(--border-color, #444);
}
.dark-theme .lr-modal-title,
.dark-theme .lr-modal .lr-kv b,
.dark-theme .lr-modal .lr-detail-title {
    color: var(--text-color, #f0f0f0);
}
.dark-theme .lr-modal-subtitle,
.dark-theme .lr-confirm-text,
.dark-theme .lr-modal .lr-kv,
.dark-theme .lr-modal .lr-event-list {
    color: var(--text-color-muted, #c8c8c8);
}
.dark-theme .lr-modal .btn-secondary,
.dark-theme .lr-modal .lr-mini-btn {
    background: var(--btn-secondary-bg, #444);
    color: var(--btn-secondary-text, #eee);
    border-color: var(--border-color, #555);
}
.dark-theme .lr-modal .lr-detail-block {
    background: var(--main-bg, #2a2a2a);
    border-color: var(--border-color, #444);
}
.dark-theme .lr-modal .lr-detail-block > .lr-detail-title {
    background: var(--table-header-bg, #333);
    color: var(--text-color, #f0f0f0);
}
